From a782bbfe25569bae2de2f77b7cdee8b5ffa71671 Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Tue, 10 Mar 2026 00:27:36 +0000 Subject: Remove legacy claude field and working_dir backward compat - Remove Claude field alias from Task struct (already removed in sandbox) - Remove UnmarshalJSON from AgentConfig that silently accepted working_dir - Remove legacy claude fallback in scanTask (db.go) - Remove TestGetTask_BackwardCompatibility test that validated removed behavior Co-Authored-By: Claude Sonnet 4.6 --- internal/storage/db_test.go | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'internal/storage/db_test.go') diff --git a/internal/storage/db_test.go b/internal/storage/db_test.go index 5f786ac..d28a4a8 100644 --- a/internal/storage/db_test.go +++ b/internal/storage/db_test.go @@ -733,35 +733,3 @@ func TestListRecentExecutions_LargeDataset(t *testing.T) { }) } -func TestGetTask_BackwardCompatibility(t *testing.T) { - db := testDB(t) - now := time.Now().UTC().Truncate(time.Second) - - // Legacy config JSON using "claude" field instead of "agent" - legacyConfig := `{"claude":{"model":"haiku","instructions":"legacy instructions","max_budget_usd":0.5}}` - - _, err := db.db.Exec(` - INSERT INTO tasks (id, name, description, config_json, priority, timeout_ns, retry_json, tags_json, depends_on_json, state, created_at, updated_at) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, - "legacy-id", "Legacy Task", "A legacy test", legacyConfig, "normal", - 0, "{}", "[]", "[]", "PENDING", now, now, - ) - if err != nil { - t.Fatalf("inserting legacy task: %v", err) - } - - got, err := db.GetTask("legacy-id") - if err != nil { - t.Fatalf("getting legacy task: %v", err) - } - - if got.Agent.Instructions != "legacy instructions" { - t.Errorf("instructions: want 'legacy instructions', got %q", got.Agent.Instructions) - } - if got.Agent.Model != "haiku" { - t.Errorf("model: want 'haiku', got %q", got.Agent.Model) - } - if got.Agent.MaxBudgetUSD != 0.5 { - t.Errorf("budget: want 0.5, got %f", got.Agent.MaxBudgetUSD) - } -} -- cgit v1.2.3