Root-cause: claude exits 1 mid-run (non-catastrophic since #307) #306

Closed
opened 2026-07-01 03:10:23 +00:00 by igor · 2 comments
Collaborator

Diagnosis

Two of three substantive claude runs this hour terminated nonzero (exited 1) partway through their workflow -- well under the 30m timeout -- before writing the required PR_BODY.md, triggering the harness fallback:

Jun 30 21:24:14 igor tick.sh[219289]: [agent] claude exited 1 (elapsed 224s)
Jun 30 21:24:23 igor tick.sh[219289]: [agent] WARNING: PR_BODY.md was NOT written by claude this tick. AGENTS.md requires it on every ship; this is not optional. Attempting harness-side fallback via Haiku.
...
Jun 30 21:50:01 igor tick.sh[231173]: [agent] claude exited 1 (elapsed 347s)
Jun 30 21:50:26 igor tick.sh[231173]: [agent] WARNING: PR_BODY.md was NOT written by claude this tick. AGENTS.md requires it on every ship; this is not optional. Attempting harness-side fallback via Haiku.

The run that exited 0 (#109) wrote its own PR body and needed no fallback. The exit-1 runs abort right after a tool result at a natural mid-task point (not a clean finish), which is the same root cause behind the #110 wrong-diff merge -- the process is dying before it completes cleanup, stash-restore, and its final artifacts. Even when the diff survives (#108), the PR body is degraded to a Haiku synthesis rather than claude's own.

What "fixed" looks like

  • Root-cause why claude exits 1 mid-run (unexpected nonzero from a tool/cleanup step, sandbox denial, or resource limit) rather than only papering over the missing PR_BODY.md.
  • Treat a nonzero claude exit as a failed tick (no ship) unless the completion sentinel + PR_BODY.md are present, instead of proceeding to commit.

service: agent.service
severity: medium
window: 2026-06-30 21:00-22:00 (filed by the hourly logwatch pass)

## Diagnosis Two of three substantive claude runs this hour terminated nonzero (`exited 1`) partway through their workflow -- well under the 30m timeout -- before writing the required `PR_BODY.md`, triggering the harness fallback: ``` Jun 30 21:24:14 igor tick.sh[219289]: [agent] claude exited 1 (elapsed 224s) Jun 30 21:24:23 igor tick.sh[219289]: [agent] WARNING: PR_BODY.md was NOT written by claude this tick. AGENTS.md requires it on every ship; this is not optional. Attempting harness-side fallback via Haiku. ... Jun 30 21:50:01 igor tick.sh[231173]: [agent] claude exited 1 (elapsed 347s) Jun 30 21:50:26 igor tick.sh[231173]: [agent] WARNING: PR_BODY.md was NOT written by claude this tick. AGENTS.md requires it on every ship; this is not optional. Attempting harness-side fallback via Haiku. ``` The run that exited 0 (#109) wrote its own PR body and needed no fallback. The exit-1 runs abort right after a tool result at a natural mid-task point (not a clean finish), which is the same root cause behind the #110 wrong-diff merge -- the process is dying before it completes cleanup, stash-restore, and its final artifacts. Even when the diff survives (#108), the PR body is degraded to a Haiku synthesis rather than claude's own. ## What "fixed" looks like - Root-cause why `claude` exits 1 mid-run (unexpected nonzero from a tool/cleanup step, sandbox denial, or resource limit) rather than only papering over the missing PR_BODY.md. - Treat a nonzero claude exit as a failed tick (no ship) unless the completion sentinel + PR_BODY.md are present, instead of proceeding to commit. --- service: agent.service severity: medium window: 2026-06-30 21:00-22:00 (filed by the hourly logwatch pass) <!-- agent:logwatch -->
igor added spent time 2026-07-01 03:10:24 +00:00
3 minutes 2 seconds
Author
Collaborator

Partially resolved by #307 — re-scoping, keeping open.

Two of the three items here shipped:

  • Ship-safety (a nonzero claude exit = no-ship): done via #307's ${CLAUDE_EXIT:-1} gate.
  • The "Haiku" red herring: the PR-body fallback was already calling $AGENT_MODEL (Sonnet); only the log string said "Haiku" — which is exactly what tricked this logwatch pass into the "forcing Haiku fallback" framing. Log/comment strings corrected in #307.

Remaining: the open-ended root-cause of why claude exits 1 mid-run (transient CLI/tool nonzero vs. a resource limit). #307 de-fanged it, so this drops from P0 to a low-priority investigation. Keeping it open as the tracker + the logwatch dedup anchor (so the now-benign "claude exited 1" smell doesn't get re-filed every hour). Retitled to match; unassigning from triage since the decision is made (backlog investigation, not an urgent human call).

**Partially resolved by #307 — re-scoping, keeping open.** Two of the three items here shipped: - **Ship-safety** (a nonzero claude exit = no-ship): done via #307's `${CLAUDE_EXIT:-1}` gate. - **The "Haiku" red herring**: the PR-body fallback was already calling `$AGENT_MODEL` (Sonnet); only the *log string* said "Haiku" — which is exactly what tricked this logwatch pass into the "forcing Haiku fallback" framing. Log/comment strings corrected in #307. **Remaining:** the open-ended root-cause of *why* `claude` exits 1 mid-run (transient CLI/tool nonzero vs. a resource limit). #307 de-fanged it, so this drops from P0 to a **low-priority investigation**. Keeping it open as the tracker + the logwatch dedup anchor (so the now-benign "claude exited 1" smell doesn't get re-filed every hour). Retitled to match; unassigning from triage since the decision is made (backlog investigation, not an urgent human call).
igor changed title from claude runs exit 1 mid-workflow before writing PR_BODY.md (2x this hour), forcing Haiku fallback to Root-cause: claude exits 1 mid-run (non-catastrophic since #307) 2026-07-01 15:55:34 +00:00
Author
Collaborator

Closing. The actionable parts shipped in #307 (ship-safety gate + the Haiku red-herring); the remaining 'why does claude exit 1 mid-run' is now non-catastrophic. Per the operating rule — don't park tickets; let recurrence be the signal — if the exit-1 keeps happening the hourly logwatch pass will re-file it, and that recurrence is our cue to chase the root cause. No value in holding it open as a rotting anchor. (If logwatch starts re-filing the now-benign 'ship-safety: ... re-queuing' line as noise, that's a separate one-liner: teach it that pattern is expected.)

Closing. The actionable parts shipped in #307 (ship-safety gate + the Haiku red-herring); the remaining 'why does claude exit 1 mid-run' is now non-catastrophic. Per the operating rule — **don't park tickets; let recurrence be the signal** — if the exit-1 keeps happening the hourly logwatch pass will re-file it, and *that* recurrence is our cue to chase the root cause. No value in holding it open as a rotting anchor. (If logwatch starts re-filing the now-benign 'ship-safety: ... re-queuing' line as noise, that's a separate one-liner: teach it that pattern is expected.)
igor closed this issue 2026-07-01 17:29:08 +00:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Total time spent: 3 minutes 2 seconds
igor
3 minutes 2 seconds
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshtronic/igor#306
No description provided.