From 695b0b5c3572494c98c45fdacd74d777ab37d36e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 7 Apr 2026 09:15:08 +0300 Subject: fix: recover gracefully from corrupted alias cache instead of hard-failing When the task alias cache file contains invalid JSON (e.g. from a concurrent write race producing two concatenated JSON objects), the previous code returned a hard error that blocked all `ask` subcommands. Now loadTaskAliasCache discards the corrupt file and starts fresh, assigning new alias IDs on the next run. Validation errors (e.g. next_id reuse) still surface as errors since those indicate a logic bug. Also fix stale v1 reference in integration test aliasCachePath. Co-Authored-By: Claude Sonnet 4.6 --- integrationtests/ask_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'integrationtests') diff --git a/integrationtests/ask_test.go b/integrationtests/ask_test.go index 0ce36fe..0ebdb01 100644 --- a/integrationtests/ask_test.go +++ b/integrationtests/ask_test.go @@ -272,7 +272,7 @@ func mustTaskAlias(t *testing.T, ctx context.Context, uuid string) string { func aliasCachePath(t *testing.T, cacheRoot string) string { t.Helper() - return filepath.Join(cacheRoot, "hexai", "ask", "task-aliases-v1.json") + return filepath.Join(cacheRoot, "hexai", "ask", "task-aliases-v2.json") } // cleanupOrphanedIntegrationTasks deletes any tasks with the +integrationtest -- cgit v1.2.3