Skip to content

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

Closed

Description

@JacobStephens2

This was generated by AI during triage.

The final Spec review of JacobStephens2/chart35#239 stopped at 2026-10-08 20:13 UTC after all 17 Tickets had landed into the Spec branch. The Run notification reported only Cause: claude exited 1, hiding the provider's actionable error. The preserved Spec PR is https://github.com/JacobStephens2/chart35/pull/261.

The captured terminal result was:

{"type":"result","subtype":"success","is_error":true,"api_error_status":429,"result":"You've hit your monthly spend limit · raise it at https://claude.ai/settings/usage?from=cc_cli_limit_message · your weekly limit resets Oct 10, 2am (UTC)"}

The preceding root assistant API error contains api_error: usage_limit_reached, rateLimitType: seven_day, resetsAt: 1791597600, overageStatus: rejected, and overageDisabledReason: org_level_disabled_until. The prose describes a monthly spend limit while the structured fields identify weekly usage exhaustion with extra usage rejected. Reporting must preserve these distinctions, rather than infer a monthly reset from the weekly timestamp or classify every HTTP 429 as a transient throttle.

The session log is /home/jacob/.thirdshift/logs/JacobStephens2/chart35/sessions/239-20261008T132659+0000-spec-review.jsonl, with the root API error at record 810 and the terminal result at record 813. The command log with the same run stem records claude exited 1 at line 3090.

At main commit 3a81a11ff06dd4db14407732f1f282da60072f5a, the shared stream decoder records Claude's failure flag but explicitly supplies no diagnostic on completion. Grok already retains diagnostic text. Verification here consists of the captured failing Run and inspection of the current decoder; no live account limit was deliberately exhausted.

Quota-aware routing and fallback are tracked separately in #583. This issue is the bounded diagnostic-reporting bug.

Activity

  1. added
    bugSomething isn't working
    needs-triageMaintainer needs to evaluate this issue
    on Oct 9, 2026
  2. JacobStephens2 commented on Oct 9, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Agent Brief

    Category: bug
    Summary: Preserve Claude's terminal failure diagnostic and supplied usage-limit details in the Run's failure reporting.

    Current behavior:
    The Claude protocol decoder detects failed terminal results, including subtype: success with is_error: true, but discards diagnostic text at completion. The Harness therefore returns claude exited 1 or claude's turn failed; the Run's terminal output and notification cannot explain the actual provider failure. An observed Spec review hit a usage/spend limit and HTTP 429 after all its Tickets landed.

    Desired behavior:
    A failed Claude session carries its own terminal diagnostic through Harness completion to the Run's failure cause, terminal output, and Run notification. Prefer meaningful terminal errors entries, then nonempty terminal result text, with a relevant root API error as a fallback. Retain supplied usage-limit information needed to explain the limit and its reported reset; do not invent absent information or collapse distinct weekly and monthly limits. A recovered earlier API error or a child-agent error must not by itself fail a successfully completed parent session, and successful terminal prose must never become an error diagnostic merely because the process later exits nonzero.

    Key interfaces:

    • The Claude dialect of Stream and its Decoder::complete result: retain diagnostic facts in addition to the failure flag.
    • Facts, Completion, and Harness failure formatting: preserve meaningful diagnostics and supplied structured limit details through failure, without requiring callers to parse raw logs.
    • Sessions, Cause, and Account: the terminal and notification consume the same failure cause.

    Acceptance criteria:

    • Replaying successful earlier results followed by the captured subtype: success, is_error: true, HTTP 429 result produces a failed outcome whose cause includes the actual spend-limit message, for a nonzero process exit and for a zero exit with a failed terminal result.
    • Terminal string errors take precedence over nonempty failed-result text; missing or malformed diagnostic fields retain a useful generic failure without panicking.
    • Supplied weekly reset and extra-usage rejection facts survive reporting; absent reset data is not invented, and HTTP 429 alone is not called a subscription usage limit.
    • Earlier recoverable root errors and child-agent errors followed by parent success do not fail the session or contaminate its final diagnostic.
    • Existing successful-session, interruption, usage-summary, killed-background-work, and other Harness behaviors remain correct.
    • A session/Run reporting test shows the meaningful cause in both terminal output and the Run notification, without exposing unrelated raw event content.

    Out of scope:

    • Automatic retry, cooldowns, fallback Harness selection, subscription preflight, or changing account spending settings.
    • Changing whether an incomplete Spec review qualifies as a Failed spec run.
    • Interpreting review reports or making their absence a failure.
    • A general Harness refactor.
  3. added
    ready-for-agentFully specified, ready for an AFK agent
    in-progressA Claim: thirdshift has taken this issue
    and removed
    needs-triageMaintainer needs to evaluate this issue
    ready-for-agentFully specified, ready for an AFK agent
    on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions