Skip to content

exec phase idles until run.timeout after the worker opened the PR, then reports 'Out of credits' from a stale rate-limit event #1626

Open

Description

@admarble

Summary

Two exec phases in one sequant run finished their work (PR opened, final assistant message posted) 18 and 24 minutes before run.timeout, then sat idle until the timeout ended them. The run table reported both as ✘ failed · Out of credits, although the subscription window was open and a follow-up run executed normally minutes later. State was left at exec: failed with open, green PRs and no exec marker on the issue, so --resume would re-run exec.

Two separate problems:

  1. Phase-complete detection waits on process exit. A worker that has pushed, opened the PR and posted its final message is done, but the phase stays open until the Claude Code process exits or run.timeout fires.
  2. A timeout is labelled with a stale rate-limit event. The driver retains any rate_limit_event with billing markers (overageDisabledReason: out_of_credits, five-hour window, live resetsAt) regardless of status (isRateLimitFailureInfo → hasBillingMarkers), and billingHaltReason then names it as the cause of a later, unrelated failure. The run log's errorContext carried {category: billing, errorType: BillingError, errorMetadata: {rateLimitType: five_hour, overageDisabledReason: out_of_credits, resetsAt: …}} on a phase whose real end was durationSeconds ≈ 1803. The event's status is not retained, so the log cannot show whether it was allowed_warning or rejected.

Environment

  • sequant 2.20.0, Claude Code driver, --no-tui -v, --resume --concurrency 2, phases spec,exec,qa, run.timeout 1800
  • macOS, Claude Max subscription (overage disabled)
  • Next.js/TypeScript repo, three small issues, exec on Sonnet

Timeline (UTC, from the run log and the worker transcripts)

Issue exec start PR opened + final message phase end idle
A 01:32:21 01:37:53 02:02:25 (1803.9 s, "Out of credits") 24 min
B 01:51:14 02:03:36 02:21:17 (1802.8 s, "Out of credits") 18 min
  • The third issue in the same run passed exec → qa normally (exec 2 min, qa 16 min).
  • A one-word claude -p probe answered at 02:20, and sequant run A B --phases qa ran and passed at 02:25–02:27, an hour before the recorded resetsAt.
  • Worker B had a 120 s tsc command that Claude Code moved to the background; its output file ends in [killed] stamped at the phase end, so that background task was alive at the kill. Worker A's background command had finished three minutes before its final message, so a lingering background task does not explain both.
  • Earlier timeouts in the same repo (four judgment issues on Opus, Oct 13–15) were a different shape: the worker was still active 1–5 min before the timeout and had no PR. Those were genuine time-outs.

Expected

  • A phase whose worker has opened the PR and posted a final message completes when the stream yields the final result, or after a short grace period, not at run.timeout.
  • A phase that ends by timeout is reported as Timeout after 1800s (as the Oct 13–15 runs were) unless the captured rate-limit event has status: rejected. Retaining status in errorMetadata would make this checkable after the fact.
  • On a timeout where the branch has a commit and an open PR, state should not be left as exec: failed without an exec marker; at minimum the summary should say the PR exists.

Repro (best effort)

Run an exec phase on a subscription account that is near its five-hour cap with overage disabled (so a rate_limit_event with overageDisabledReason: out_of_credits is emitted during the session), with a worker that starts a long tsc/jest command that Claude Code moves to the background, and let the worker finish and open the PR. Observe whether the phase ends at the final message or at run.timeout, and what reason the run table prints.

Happy to attach the two run logs (with repo-specific paths redacted) on request.

Activity

  1. added
    bug
    on Oct 30, 2026
  2. admarble commented on Nov 3, 2026

    @admarble
    ContributorAuthor

    What happens

    In a 42-run replay (sequant 2.20.0 at 31c6f8bd, Claude Code driver, defaults, no .sequant/settings.json, so phaseTimeout 1,800 s), four exec phases ended at the timeout and the run table said Out of credits. In three of the four, the next run on the same account started within a minute and ran normally (F4 → F5; FP → the next pilot run; F5 → nothing, it was the last); after F3 our batch sat stopped for three hours for a reason of our own, so that gap says nothing. The Claude Code transcripts of the four hold no rate_limit_event line; those transcripts may not record SDK stream events, so what the driver's stream carried is not visible to us.

    Evidence

    Run log phases[].durationSeconds and the stdout line, per run:

    Run exec durationSeconds error stdout exec model in the run log Committed before the cutoff
    pilot #1143 FP, 2026-11-02 1802.081 Out of credits [10:09:44] ✘ #23 exec Out of credits null (spec phase: claude-fable-5-1) no (0 commits; scored 0 by our hygiene rule)
    batch #1153 F3, 2026-11-03 1802.035 Out of credits [05:40:10] ✘ #112 exec Out of credits null (spec: Fable) yes (e8ac387)
    batch #1153 F4 1802.064 Out of credits same label null (spec: Fable) yes
    batch #1153 F5 1801.747 Out of credits same label null (spec: Fable) yes

    All four durations are phaseTimeout (1,800 s) plus about two seconds. The run log's exec model is null in each, because the driver reported no modelUsage for the aborted phase, so the record of which model ran exec is the transcript, not the log.

    Each exec transcript is active up to the cut. The last tool call before the kill: pilot FP 16:09:41Z against a kill at 16:09:44Z (a jest run); F3 11:40:03Z against 11:40:10Z; F4 15:17:30Z against 15:17:56Z; F5 15:56:59Z against 15:57:24Z. The longest idle before a kill is 26 s, which is a tool call still running, not a stalled agent. After the pilot's cut, a native claude -p run on the same account started ten minutes later and completed. In the batch, the ten F runs on claude-opus-5-5 (#1143, #1144) never hit the timeout; of the five on Fable (#1153), three did (F3, F4, F5, $4.18 to $4.63 each by the SDK estimate, cut short) and the two that did not ran the quality loop twice each and cost $45.44 and $46.93.

    The mechanism matches the second problem in #1626: buildStructuredError (drivers/claude-code.ts) prefers a retained rateLimitInfo or billing_error over the abort, and runRetryFallbacks (phase-executor.ts) then surfaces "the accurate structured message (e.g. "Out of credits")" and skips the retry. A phase that the executor's own setTimeout aborted is reported as a billing failure.

    Ask

    Beside #1626's asks: when the phase ended because abortController.abort() fired from the timeout, label it as a timeout (Phase timed out after 1800 s) whatever the stream carried earlier, and record the cause in the run log's errorContext. A replay or benchmark that reads the run table cannot otherwise tell a 30-minute task from an empty wallet.

    Why it matters

    Three of these runs had committed and went on to pass most of their acceptance criteria under independent verifiers; the label hid that the only thing wrong was the budget of time. In our write-up the finding had to be reconstructed from transcripts.


    From a private replay study of sequant on our own repos; raw runs are not public. Filed by the owner.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions