Repository navigation
Description
What happens
internal/runtime is the package that makes the CI test job (go test -race -coverprofile=coverage.out ./...) hit Go's 10-minute per-package timeout on unrelated PRs (#9210). Its time in that job on main:
Commit on main |
Run | internal/runtime |
|---|---|---|
| f24d145 (2026-11-04, before #8913) | 41923315717 | 99 s |
| 32d3cd8 (2026-11-05, #8913 merge) | 41943203088 | 348 s |
| 35228e6 (2026-11-11) | 43067882310 | 463 s |
#9304 raises the timeout to 20 minutes. That stops the false failures but leaves the cost. This issue removes the cost.
Cause
Five tests fill production-sized caches and buffers. Under the race detector each event pays for secret-pattern regex scans, so the loops are slow. Times are from go test -race -count=1 -json ./internal/runtime on an arm64 Mac (package total 255 s; the 74 tests added by #8913 take 118 s of it):
| Test | File | Time | Why it is slow |
|---|---|---|---|
TestTaskProgressCacheAdmissionRetainsGuardsAndDedup |
task_progress_cache_test.go |
74 s | 17 tasks x 1,034 agent events to overflow the 16,384-row cache, then replays every cached row |
TestCodexRedactingWriter_FlushesAtTheLineCap |
codex_redact_test.go |
26 s | writes 9 MiB through the redacting writer to cross the 8 MiB line cap |
TestTaskProgressRelaunchRetiresSupersededRows |
task_progress_cache_test.go |
19 s | 4 generations x 2,000 agent events |
TestClaudeWorkflowLargeSnapshotsDoNotReprint |
claude_task_cache_test.go |
12 s | 20 repeats of a 1,000-agent and a 500-agent snapshot |
TestProgressCacheOwnsNormalizedStrings |
progress_allocation_test.go |
8.5 s | 32 rows x three 1 MiB padded strings, each scanned for secrets |
The first test takes 1.2 s without -race, so the cost is the event count times the race detector, not a bug in the renderer.
The behaviour these tests prove (admission limits hold, existing rows and guards survive overflow, unchanged snapshots are not reprinted, cached strings do not pin large backing arrays, an endless line is flushed) does not depend on the limits being 1,024 or 16,384 or 8 MiB. It can be proved with limits of a few entries.
What to change
Scope is internal/runtime only. Default limits and production behaviour stay exactly as they are.
- Make the limits settable in tests.
progressReconciler(progress_reconciler.go): hold the task-entry, agents-per-task, row and status-entry limits as fields that default tomaxTaskProgressEntries,maxTaskProgressAgentsPerTask,maxTaskProgressRowsandmaxStatusProgressEntries. The three checks intask_progress_reconciler.goandstatus_progress.goread the fields.codexRedactingWriter(codex_redact.go): hold the line cap as a field that defaults tocodexRedactMaxLine.- No exported API, flag, config field or environment variable. Tests in the same package set the fields directly.
- Shrink the five tests to run against small limits (for example 4 agents per task, 8 rows, a 1 KiB line cap) with the same assertions:
TestTaskProgressCacheAdmissionRetainsGuardsAndDedup: keep every assertion; overflow small limits instead of the defaults.TestTaskProgressRelaunchRetiresSupersededRows: two generations and a handful of agents are enough to show that a relaunch retires the old rows and keeps dedup.TestClaudeWorkflowLargeSnapshotsDoNotReprint: small snapshots, two or three repeats; keep the "printed once", hidden-task and stale-run assertions and adjust the expected counts.TestProgressCacheOwnsNormalizedStrings: a few rows instead of 32, with the heap threshold scaled so that retaining the padded strings still fails the test.TestCodexRedactingWriter_FlushesAtTheLineCap: small cap, a few KiB of input.
- One cheap test that the defaults are wired: a new reconciler and a new redacting writer carry the constant values. This replaces the slow tests as the guard against a default being dropped.
- Optional, same PR if trivial:
TestTaskControlAdmissionNeverFlushesExistingTasks,TestTaskProgressRendererBoundedStateandTestStatusProgressCapacityUpdateKeepsExistingEntries(about 1 s each) can use the same small limits.
Do not delete any of the five tests outright unless a shrunk version cannot keep its assertion; if one is deleted, say which and why in the PR description.
Note on #8913
Four of the five tests came in with #8913 (cc @jctanner). Nothing they assert is removed. What changes is that they overflow small test-only limits rather than the production defaults, so the default sizes themselves are covered by the wiring test in item 3 and not by a fill-to-the-limit run.
Out of scope
.github/workflows/and the Makefile (ci(test): give go test a 20m per-package timeout #9304 covers the timeout).- Other slow packages (
internal/cli,internal/repos): tracked in test: internal/cli, repos, scaffold, and runtime dominate the ~7m45s CI unit-test step #8651. TestCodexRun_AdmissionCheckCountsTheChildrenOnDisk(7 s, many real sub-cases) and the rest of the package.
Done when
go test -race -count=1 ./internal/runtimepasses, and none of the five tests takes more than 1 s on a developer machine.- The
testjob on the PR reportsinternal/runtimeat or below about 150 s (348 to 590 s today). Put the before and after lines from the job log in the PR description. - Package coverage in the same job does not drop by more than rounding from 93.9%.
make lintpasses.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
waynesun09 commentedon Nov 11, 2026
/fs-code
Do not sign off commits: no
git commit -s, noSigned-off-bytrailer.fullsend-ai-triage commentedon Nov 11, 2026
🤖 Finished Triage · ✅ Success · Started 11:41 PM UTC · Completed 11:43 PM UTC
Commit:
35228e6· View workflow run →Runtime: claude · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.17
fullsend-ai-coder commentedon Nov 11, 2026
🤖 Code ·⚠️ Cancelled · Started 11:41 PM UTC · Ended 11:43 PM UTC
Commit:
35228e6· View workflow run →fullsend-ai-triage commentedon Nov 11, 2026
Triage found this issue ready for implementation. The fix targets and the five constants you named exist in
internal/runtimewhere described. No open PR or sub-issue addresses it. #9210 (the timeout symptom) and #8651 (broader slow-test tracking) are related context but not blockers.Implementation notes
task_progress_reconciler.go,status_progress.goandcodex_redact.go. The check sites are intask_progress_reconciler.go(two places),status_progress.goandcodex_redact.go.Proposed test case
Done criteria:
go test -race -count=1 ./internal/runtimepasses with none of the five tests above 1 s, the CI package time is at or below about 150 s, coverage stays within rounding of 93.9%, andmake lintpasses.Next steps:
/fs-code— agent creates a PR to implement this issue/fs-code <your instruction>— agent implements with your specific guidancefullsend-ai-coder commentedon Nov 11, 2026
🤖 Finished Code ·⚠️ Cancelled · Started 11:41 PM UTC · Completed 11:43 PM UTC
Commit:
35228e6· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high
fullsend-ai-coder commentedon Nov 11, 2026
🤖 Finished Code · ✅ Success · Started 11:45 PM UTC · Completed 12:01 AM UTC
Commit:
35228e6· View workflow run →Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $2.11
test(#9347): keep the row-limit and one-field leak checks at small li…
test(fullsend-ai#9347): run runtime cache tests against small test-on…
Merge pull request fullsend-ai#9349 from fullsend-ai/agent/9347-shrin…