Skip to content

Preserve Claude failure diagnostics and usage-limit details - #591

Merged
JacobStephens2 merged 2 commits into
mainfrom
issue-587
Oct 9, 2026
Merged

JacobStephens2 merged 2 commits into
mainfrom
issue-587

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

Claude failures now carry the provider's diagnostic and supplied limit facts to the Run's terminal output and notification.

failed Claude session
  terminal errors → failed-result text → relevant root API error → generic cause
  + supplied API status, limit window, reset and extra-usage facts
    → Completion → Sessions → Cause
      → terminal output + Run notification

A pending root API error also supplies the diagnostic when the process exits before its final result. Parent recovery clears stale errors, and child results preserve the parent's outcome and usage.

Evidence

  • Before: claude_terminal_failure_keeps_the_captured_spend_limit_message_for_either_exit failed with only claude's turn failed.
    After: the captured spend-limit message and HTTP status survive both zero and nonzero exits.
  • Before: the Spec review's exact claude_root_api_error_is_a_fallback_when_process_exits_without_a_result reproduction failed with only claude exited 1.
    After: that same command passes all four combinations of exit status and earlier success; its regression test is retained.
  • The Run reporting test verifies the same meaningful cause in terminal output and the notification, without unrelated raw event content. Supplied weekly and extra-usage resets remain distinct, and a bare HTTP 429 receives no invented usage-limit classification.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings, 49 interpretation tests, and both updated Architecture review failure tests pass.
  • Full suite: cargo test passed: 1528 passed, 1 existing ignored test, zero failures across 39 test binaries.

Test seams

  • Harness interpretation: feed Claude stream events through Interpretation::condense, then observe Interpretation::finish with the process exit status.
  • Run reporting: execute thirdshift with a local Claude stand-in and observe terminal failure output and the Run notification captured by a local Resend stand-in.

Unaddressed findings

  • Standards: none.
  • Spec: none. The one reproduced P2 finding was fixed and its test retained.

Review coverage

Both axes read every changed file. Changed files left unread: none.

Merge Danger

Door: two-way

The decoder change can be reverted.

Blast Radius: Harness

Claude failure causes gain diagnostic text and supplied provider facts.

Closes #587

Built with codex · gpt-6.1-sol · xhigh

@JacobStephens2
JacobStephens2 merged commit 7e7f1bb into main Oct 9, 2026
17 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-587 branch October 9, 2026 06:38
@JacobStephens2 JacobStephens2 mentioned this pull request Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preserve Claude's terminal error instead of reporting only 'claude exited 1'

1 participant