Preserve claude's raw stream on a nonzero exit, so a claude-bomb is diagnosable #326
Labels
No labels
Agent
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
joshtronic/igor#326
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Blind spot
When claude exits nonzero on its own (
rc=${PIPESTATUS[0]}inclaude_run_with_cost), the harness handles it correctly — ship-safety refuses the partial worktree and re-queues. But the raw claude stream ($scratch/claude-stream.jsonl) lives in the worktree's.agent/scratch, which is torn down with the worktree.crashlog_preserveonly fires when the tick itself dies beforeclaude_run_with_costreturns (the #279 signature). On a cleanrc=1return there is nothing preserved — so there's no forensic trail for why claude exited nonzero.Concrete cost
vps-showdown#41bombed twice — claude exited 1 after ballooning to 3.4–4.7 GB (~350× a normal tick), producing no committable work. The root cause is only inferable (likely a Node/V8 heap blowup from trying to build a generated site), because the stream was already gone by the time anyone looked. Every "claude exited N" is currently un-diagnosable after the fact.Fix
On a nonzero claude exit (rc ≠ 0, distinct from a clean timeout), preserve the raw stream + display log to a durable location — same mechanism as
crashlog_preserve— keyed by call-site + timestamp, size-capped and rotated so it can't grow unbounded. Then a bomb leaves a readable post-mortem instead of a guess.Notes
claude_run_with_cost/ the crashlog path. Should be done carefully with abin/test-*.shcase, not a fast mechanical edit.Status/Blocked). No behavior bug here.Concrete symptom that motivated this: logwatch #325 — claude exited 1 twice on vps-showdown#41 (4.7 GB peak) and the crash reason was unknowable because the stream wasn't preserved. This issue is the visibility half of closing that gap; the scope half is vps-showdown#46 (re-scoped, build-free). Closing #325 in favor of the two.