summaryrefslogtreecommitdiff
path: root/internal/api
diff options
context:
space:
mode:
authorClaude <noreply@anthropic.com>2026-05-03 03:58:19 +0000
committerClaude <noreply@anthropic.com>2026-05-03 03:58:19 +0000
commit85c3bf4d28b0903a2005356339e6ea56855b8c80 (patch)
tree2ffbc4fcf585aef8091f02b3315a3234267c5618 /internal/api
parent99115d8158137083239c45e5a860b718ff4cefa1 (diff)
chore: post-epic cleanup — green test suite, no skips
Addresses the cleanup queue captured in docs/plans/local-oss-runner.md after the local-OSS-models epic landed. After this commit `go test -race ./...` is green across every package with zero `t.Skip` calls and no excluded tests. Real bugs fixed: - claude.go setupSandbox callsites used `sandboxDir, err := ...` which shadowed the outer variable, so BlockedError.SandboxDir was always empty. Resume-after-block was broken for both new and stale-sandbox paths. TestBlockedError_IncludesSandboxDir now exercises the right invariant. - TestPool_ActivePerAgent_DeletesZeroEntries flake under -race: the cleanup defer in execute()/executeResume() runs AFTER handleRunResult sends on resultCh, so consumers observing a result could see a still-counted activePerAgent entry. Extracted decActiveAgent(agentType, *cleaned) helper; called explicitly before every resultCh send, defer becomes a no-op via the cleaned flag. Verified clean over `go test -race -count=10`. Test infrastructure made hermetic: - gitSafe now also passes -c commit.gpgsign=false / -c tag.gpgsign=false so sandbox tests pass on hosts whose global config requires signing. - Bare repos in tests initialized with `-b main` (HEAD symbolic ref matched to the branch we push) so `git log` after push works. - TestSandboxCloneSource_FallsBackToOrigin uses a local-FS origin URL, matching sandboxCloneSource's intentional filter against network URLs. - TestGeminiLogs_ParsedCorrectly URL fixed to the actual log route (/api/executions/{id}/log). GeminiRunner gap closed (partial): - parseGeminiStream now walks lines for `result` events, surfacing is_error as an error and total_cost_usd as the float return value. - GeminiRunner.Run propagates parsed cost to Execution.CostUSD. - TestParseGeminiStream_ParsesStructuredOutput unskipped. Notes: - GeminiRunner is still simulated end-to-end (Run writes hardcoded stream data instead of execing the binary). The result/cost parser now exists; finishing the runner is a smaller, contained follow-up. Kept on the deferred queue. - Frontend "Local" agent option and a minor storage.db.go logger TODO remain on the deferred queue, both intentionally — neither blocks anything in flight. https://claude.ai/code/session_017Edeq947TpSm1vQTxMhi1J
Diffstat (limited to 'internal/api')
-rw-r--r--internal/api/server_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/api/server_test.go b/internal/api/server_test.go
index 5c0deba..516e289 100644
--- a/internal/api/server_test.go
+++ b/internal/api/server_test.go
@@ -255,7 +255,7 @@ func TestGeminiLogs_ParsedCorrectly(t *testing.T) {
}
// 6. Verify the content retrieved via the API endpoint.
- req = httptest.NewRequest("GET", "/api/tasks/"+tk.ID+"/executions/"+exec.ID+"/log", nil)
+ req = httptest.NewRequest("GET", "/api/executions/"+exec.ID+"/log", nil)
w = httptest.NewRecorder()
srv.Handler().ServeHTTP(w, req)