Skip to content

Surface worker death reasons; auto-resume at limit reset; optional model fallback #175

Description

@365atw

What happened (real incident, 2026-07-12 ~00:32 America/Denver)

A 6h+ overnight gnhf run (--agent claude, model pinned via ANTHROPIC_MODEL) died with
"3 consecutive failures / claude exited with code 1:" — with an EMPTY error body — and then
sat at its "[ctrl+c to exit]" end screen until morning. The actual reason existed the whole
time, recorded in each worker's session transcript as a synthetic assistant message:

"You've hit your session limit · resets 3:40am (America/Denver)"

The run resumed cleanly in the morning with zero changes, meaning ~3.5h of potential work
time (from the 3:40am reset to morning) was lost purely to the runner not knowing why its
worker died.

Requests, in priority order

  1. Relay the worker's death reason. When a claude worker exits non-zero, read the tail of
    its session transcript (~/.claude/projects//.jsonl) for a synthetic
    assistant message and surface that text in the failure banner and (ideally) a machine-readable
    run-state file. "claude exited with code 1:" with an empty body should never be the final word.
  2. Auto-resume at the stated reset time. When the death reason matches a session/usage-limit
    message that names a reset time, schedule the next iteration attempt for that time instead of
    burning the remaining consecutive-failure budget immediately (3 retries in 12 minutes against
    a wall that resets hours later).
  3. Optional model fallback. A flag such as --fallback-model <m> (or --on-limit rotate)
    so a run pinned to a premium model can degrade gracefully to a model with remaining headroom
    rather than dying. Default off to preserve current behavior.
  4. Machine-readable end state. Write "stop condition met" / "N consecutive failures" (+ reason)
    to a sidecar file on disk when the TUI reaches its end screen, so supervisors do not have to
    scrape the terminal to learn a run has ended while the process is still alive at
    "[ctrl+c to exit]".

Environment

gnhf with --agent claude, Claude Code 2.1.207, WSL2 Ubuntu. Happy to provide the full
night-1 log and session transcripts on request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-prTriage: aligned and ready for a contributor pull request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions