Found in the 2026-09-28 code audit (finding N-5).
Where: internal/daemon/pool.go:200-233 vs exit codes at internal/cli/exec.go:37-49.
Problem: The pool stops retrying only on exit 0 or ExitPermanent (76) and treats 75 as tempfail. zero exec also exits 2 (usage), 3 (provider), 4 (incomplete) and 130 (interrupted); all are treated as crashes and retried up to MaxAttempts = 5 with backoff. Exit 4 means the agent already ran (edits, shell commands, pushes), so each retry repeats side effects and re-bills the provider. All attempts are appended to one session buffer, merging several runs into one stream.
Suggested fix: map 2, 3, 4 and 130 to permanent; retry only launch/read errors and crash-type exits (1, signal). Better: never retry once the worker has emitted output.
Tests: fake-launcher test for exit codes 2/3/4/130.
Found in the 2026-09-28 code audit (finding N-5).
Where:
internal/daemon/pool.go:200-233vs exit codes atinternal/cli/exec.go:37-49.Problem: The pool stops retrying only on exit 0 or
ExitPermanent(76) and treats 75 as tempfail.zero execalso exits 2 (usage), 3 (provider), 4 (incomplete) and 130 (interrupted); all are treated as crashes and retried up toMaxAttempts= 5 with backoff. Exit 4 means the agent already ran (edits, shell commands, pushes), so each retry repeats side effects and re-bills the provider. All attempts are appended to one session buffer, merging several runs into one stream.Suggested fix: map 2, 3, 4 and 130 to permanent; retry only launch/read errors and crash-type exits (1, signal). Better: never retry once the worker has emitted output.
Tests: fake-launcher test for exit codes 2/3/4/130.