[Bug]: Usage-limited Claude thread is never armed for auto-resume when background-task wake runs finish as `completed` right after the limit stop #16815
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related but different: #15665 (a follow-up turn fails with resetAt: null) and #16233 (a queued background notification blocks snooze). Here the follow-up turns are not failures at all: they finish as completed, so the thread is never armed for auto-resume.
Filed by the user's Claude Code agent at their request. Everything below is sanitized: no conversation content, project names, paths or account details. Thread labels A and B are arbitrary.
Area#
apps/server
Summary#
With Auto-resume limited threads and Snooze limited threads both on, a Claude thread that hit its five-hour limit while background subagents were running was never scheduled to resume. Its limited run stored a valid future reset, but about 2 seconds later a background-task notification started a new root run that finished as completed in under 2 seconds. Five more such runs followed. The thread's latest executed run was therefore completed, limitRecovery stayed null, no limit-resume: message was ever dispatched, and the thread sat idle for 4 h 42 m after the reset until the user sent a message.
A second Claude thread on the same account, where no further run followed the limited one, hit the same limit window about 73 seconds later. It was armed and resumed 1 second after the reset.
Steps to reproduce#
Observed incident on an unmodified official nightly. Not a minimized reproduction, and no fresh quota-consuming run was made.
- Settings:
autoResumeLimitedThreads: true,snoozeLimitedThreads: true. - In a Claude (
claudeAgent, Orchestrator V2) thread, start several background subagents (11 in this incident) and let the root turn end normally while they work. - Exhaust the five-hour usage window. A background-task notification starts a root run that fails with
usage_limit. - Other background subagents die on the same limit. Each one's completion notification starts another root run within seconds.
- Wait for the reported reset time.
The reproduction in #15665 (real CLI against a mock Messages API) should be adaptable: after the first limited turn, let a background task complete so its wake turn starts within a few seconds.
Expected behavior#
The limited run is armed for recovery and the thread resumes at the reset time, exactly as the comparison thread did. A wake turn that makes no progress because the account is limited should not cancel or hide a pending recovery.
Actual behavior#
Thread A, read-only from the V2 projection tables. t0 is the moment the limited run failed. R is the stored reset, t0 + 4 h 20 m.
| Run | Started by | Ended | Ran for | Status | Turn items |
|---|---|---|---|---|---|
| 2 | background-task notification | t0 | 30.5 s | failed | ..., assistant_message (the provider's limit text), error with failure.class: usage_limit, failure.code: api_error_429, failure.resetAt: R |
| 3 | background-task notification | t0 + 2.1 s | 1.8 s | completed | notification, checkpoint |
| 4 | background-task notification | t0 + 6.8 s | 0.6 s | completed | notification, checkpoint |
| 5 | background-task notification | t0 + 9.8 s | 0.8 s | completed | notification, checkpoint |
| 6 | background-task notification | t0 + 34.3 s | 0.7 s | completed | notification, system_notice, checkpoint |
| 7 | background-task notification | t0 + 41.0 s | 1.3 s | completed | notification, assistant_message (61 characters: You've hit your session limit · resets 3am (America/New_York)), checkpoint |
| 8 | background-task notification | t0 + 5 m 14 s | 0.6 s | completed | notification, system_notice, checkpoint |
- Thread A
limitRecovery:null. It was never armed. - Thread A turn items matching
limit-resume: none. - Thread A next activity: a user message at
R + 4 h 42 m. - Runs 3 to 8 carry no
erroritem. Run 7 stores the provider's limit message as an ordinary completed assistant message.
Thread B, same account and same limit window, no run after the limited one:
| Event | Time |
|---|---|
Limited run failed (usage_limit, resetAt: R) | about t0 + 73 s |
limitRecovery armed | { autoResume: true, snooze: true, resetAt: R } |
limit-resume run requested | R + 1 s |
| That run | completed, and the thread kept working |
Analysis#
Read from the installed server bundle of this build, not from a source checkout.
ProjectionStore.getLimitRecoveryCandidatesselects each thread's latest executed run (the run that ended last) and requiresr.status = 'failed'plus ausage_limiterror item with a non-nullresetAton that same run.limitRecoveryCommandin the usage-limit recovery worker returnsnullunlessthread.status === "failed"andthread.lastErrorClass === "usage_limit".- So a wake run that ends as
completedbecomes the latest executed run and removes the thread from the candidate set. In this incident that happened 2.1 s after the limit stop, before the limited run had been armed. - Separately, a turn that could not do any work because the account was limited was classified
completed. In run 7 the only output is the provider's limit text.
Why this is not covered by a fix for #15665: carrying the reset onto follow-up failures does not help when the follow-up turns are not recorded as failures.
Possible directions, for the maintainers to judge:
- Classify a wake turn whose provider result is the limit message or a 429 as a
usage_limitfailure, including when a background-task notification started it. - Let candidate selection use the most recent
usage_limitfailure whose reset is still in the future, ignoring later notification-only runs that produced no work. - Hold background-task wake turns while the thread is limited, and release them with the resume.
Impact#
Major degradation or frequent failure.
Auto-resume silently does nothing for threads that have background agents running when the limit hits, which is the pattern most likely to exhaust a limit. Nothing resumed the thread and its work idled overnight. I did not capture how the thread was presented in the UI at the time.
Version or commit#
T3 Code (Nightly) 0.0.46-nightly.20261005.2702, official Windows build. Claude Code CLI 2.1.292.
Environment#
- Windows 11 Pro 10.0.26200, desktop app with its local server.
- Provider
claudeAgent, modelclaude-opus-5-5, Claude subscription login, Orchestrator V2. - The machine did not sleep during the window (no Kernel-Power sleep or wake events), and the same server process was running before the limit and after the reset.
Logs or stack traces#
None retained. server.trace.ndjson rotates at 10 MB roughly every three minutes here, so the files covering the limit stop and the reset were gone by morning. The evidence above comes from orchestration_v2_projection_runs, orchestration_v2_projection_turn_items and orchestration_v2_projection_threads, opened read-only.
Workaround#
Send a message to the thread after the reset. Avoid launching many background agents when the usage window is nearly spent.
juliusmarminge added labelsbug
juliusmarminge added labelsvia-triage
Still reproduces on
0.0.46-nightly.20261009.2861(3b6af0bd1600), Windows 10 Pro 10.0.19045, Claude Code CLI 2.1.295,autoResumeLimitedThreads: true. This time the server traces were still on disk, so they show the arming race directly. Times are UTCTime Event 12:21:04.774 Provider rate_limit_event:rejected,five_hour, reset 12:40:0012:21:05.595 Recovery sweep. Nothing to arm yet 12:21:06.365 Run 49, started by a "7 background tasks failed" notification, fails with usage_limitandresetAt12:40:0012:21:06.880 First wake run dispatched ( message.dispatchwith aprovider-continuation:command), 515 ms after the failure12:21:08.332 Run 50 completed. Provider resultsuccess,is_error: false,num_turns: 0, 14 ms12:21:10.611 Next sweep. The latest executed run is now run 50 ( completed), so nothing is armed12:21:18.605 and 12:21:25.536 Runs 51 and 52 complete the same way 12:40:00 onward No limit-arm:orlimit-resume:command and no new run (checked through 12:41)- The thread has no
limitRecovery. Its latest run stayed run 52 (completed) until a manual message at 12:43 - Runs 50 to 52 hold only a
notificationand an emptycheckpoint, so the recommended option above (skip later runs that did no work) would cover them - The thread itself promised a resume: "Claude usage limit reached. This turn is paused until the 5-hour limit resets in 19m."
Client side, from the installed bundle. The composer banner reads the same latest-run status (
Pi.status === "failed" && Pi.lastErrorClass === "usage_limit"in_chat), so it needs the same rule as the candidate query. Otherwise an armed thread would resume with no visible Cancel auto-resume control. In this incident the banner condition held for about 0.5 s, from the push after the failure (12:21:06.372) to the run 50 update (about 12:21:07.10). The client did process that state, since it sent athread.visitfor this thread at 12:21:06.590. In that window the banner could only offer Resume at reset, because Cancel auto-resume requires an armed recovery# Provider events log (trimmed) [12:21:04.774Z] rate_limit_event {"status":"rejected","rateLimitType":"five_hour","resetsAt":1791549600} [12:21:07.458Z] result {"subtype":"success","is_error":false,"num_turns":0,"result":"","duration_ms":14} [12:21:18.486Z] result {"subtype":"success","is_error":false,"num_turns":0,"result":"","duration_ms":14} [12:21:25.484Z] result {"subtype":"success","is_error":false,"num_turns":0,"result":"","duration_ms":12} # server.trace.ndjson (start time, span, command) 12:21:05.595Z UsageLimitRecoveryWorker.sweep 12:21:06.372Z ws.orchestrationV2.projectShellItems 12:21:06.590Z orchestrationV2.dispatch.once thread.visit 12:21:06.880Z orchestrationV2.dispatch.once message.dispatch provider-continuation:message:... 12:21:10.611Z UsageLimitRecoveryWorker.sweep # No limit-arm: or limit-resume: command in any retained traceAfter the reset the subagents were resumed by hand, and their failure notification rows kept a red Failed badge while they ran. That part is filed separately as #17486
- The thread has no
Note
Posted by Claude Opus 5.5 (Claude Code) at Matthew's request. Sanitized: no conversation content, project names, paths or account details.
Still reproduces on T3 Code 0.1.0 (
t3 serve, Windows 11 Home 26200), Claude Code CLI 2.1.301,autoResumeLimitedThreads: true,snoozeLimitedThreads: true.What's new here: the earlier reports in this issue are the arming race, where the wake run lands before the next sweep, so the thread is never armed. In this case the thread was armed, 5 s after the failure. A wake run 4.5 minutes later still cancelled the resume, because
limitRecoveryCommandrequiresthread.status === "failed"on the latest run at resume time too. Closing the race alone wouldn't fix this. The "latest executed run" rule has to change, as option 2 / #17862 does.Times are UTC. The orchestrator thread had two background subagents running when the root turn ended at 22:38:30.
Time Event 22:40:04.480 rate_limit_event:rejected,five_hour,resetsAt01:10:0022:40:04.972 Run 17, started by subagent A's failure notification: result is_error: true,api_error_status: 42922:40:09.870 limit-arm:<thread>:<run 17>:1792199400000(thread.metadata.update) dispatched, exitSuccess22:44:37.245 Subagent B had been waiting on a long-running command. Its next API call is rejected22:44:37.351 SDK wake turn for B's failure notification: result success,is_error: false,num_turns: 0,result: ""22:44:37.928 Run 18 completed. Its only items arenotification,system_notice("This turn is paused until the 5-hour limit resets in 2h 26m") and an emptycheckpoint01:10:00 No limit-resume:dispatched01:13:02 Manual message. The thread runs normally Notes:
- The provider stream for run 18 has only that one empty
successresult, and nois_error: trueresult. So #19543 (a buffered root failure replaced by later empty results) wouldn't cover this case. #17862's no-work rule would, because run 18 holds onlynotification/system_notice/checkpoint. - Run 18 shows the limit
system_notice, but it still endscompleted. That's relevant to option 1 (classifying such wake turns asusage_limit). - Control case: the same thread hit the limit earlier that day (18:38:33). No wake run followed, and it resumed at 20:10:00.540, right at the reset.
# provider events (trimmed) 22:40:04.480Z rate_limit_event {"status":"rejected","rateLimitType":"five_hour","resetsAt":1792199400} 22:40:04.972Z result {"subtype":"success","is_error":true,"num_turns":1,"api_error_status":429} 22:44:37.245Z rate_limit_event {"status":"rejected","rateLimitType":"five_hour","resetsAt":1792199400} 22:44:37.264Z system task_notification {"status":"failed"} 22:44:37.351Z result {"subtype":"success","is_error":false,"num_turns":0,"stop_reason":null,"result":""} # server.trace.ndjson 22:40:09.870Z orchestrationV2.dispatch.once thread.metadata.update limit-arm:<thread>:<run 17>:1792199400000 Success # no limit-resume: command for this thread in any retained trace through 02:35Z- The provider stream for run 18 has only that one empty
Additional occurrence on macOS, official nightly
0.1.1-nightly.20261018.3302.A Claude thread did not resume after its advertised usage-limit reset. This appears consistent with this issue: a background-task notification started a turn that reported the usage limit but was recorded as
completed.Environment#
- T3 Code Nightly desktop app with a local backend.
- Version:
0.1.1-nightly.20261018.3302. - macOS
26.6.2(25G83), Apple Silicon. - Provider:
claudeAgent. - Model:
claude-opus-5-5, High effort, Full access. - Time zone:
Europe/Warsaw(UTC+02:00 on the incident date). - Both settings were enabled when inspected:
{ "autoResumeLimitedThreads": true, "snoozeLimitedThreads": true }
Observed sequence#
Incident date: 18 October 2026. All times below are Europe/Warsaw.
- The thread was coordinating background subagents.
- At 14:35:10, a notification reading
4 background tasks failedstarted root run 424. - That run emitted:
followed by:Claude usage limit reached. This turn is paused until the 5-hour limit resets in 2h 45m.You've hit your session limit · resets 5:20pm (Europe/Warsaw) - At 14:35:11, the run was recorded as
completed. - At 17:30, ten minutes after the advertised reset, the thread had not resumed. The attached screenshot shows the system clock at 17:30 and the limit messages still visible.
- A read-only inspection around 17:32 confirmed that no subsequent run had been created.
This is an observed incident, not a deterministic minimal reproduction. I have not performed another quota-consuming reproduction.
Expected behavior#
With automatic recovery enabled, T3 should schedule a retry at the reported reset time. A turn that only reports an exhausted usage limit should retain the recovery information needed for that retry.
Actual behavior and persisted state#
The thread remained idle after the reset:
latest run ordinal: 424 latest run status: completed activeRunId: null pendingRequestCount: 0 snoozedUntil: nullThe final run’s timeline contained:
notification: 4 background tasks failed system_notice: Claude usage limit reached... assistant_message: You've hit your session limit · resets 5:20pm... checkpointThere was no
erroritem in that run’s timeline.The thread’s persisted
limitRecoverystill referenced an older run, 239, with an already-expired reset:{ "runId": "<older run 239>", "resetAt": "2026-10-16T20:40:00.000Z", "autoResume": true, "snooze": true }It did not reference run 424 or the current reset,
2026-10-18T15:20:00.000Z.Additional context and limitations#
Local state also records a provider-session stop and restart-related background-task cleanup at 14:37:29, between the limit event and the reset. Recovery across that lifecycle change may therefore be relevant.
The evidence comes from the thread API and read-only inspection of local SQLite state. I have not traced the recovery worker or confirmed the underlying code defect. The stale recovery record and the
completedclassification are observations, not proof of a specific root cause.Impact and workaround#
Unattended work remained stopped after the expected reset, requiring manual intervention. Manual continuation had not been tested at the time of inspection.
Note
Posted by Claude Opus 5.5 (Claude Code) at the user's request. Sanitized: no conversation content, project names, paths or account details.
Still happens on
0.1.1-nightly.20261019.3373: macOS 27.0.1 on Apple Silicon, desktop app with a local backend, Claude Code CLI 2.1.304,claude-opus-5-5(High, Full access). Settings:autoResumeLimitedThreads: true,snoozeLimitedThreads: true. I took the version from the server trace logs for that day. I can't confirm it was the exact build running at the incident time.What's new here: the limited run never got a
failedstatus. The run that showed the "paused until reset" notice was recorded ascompleted. The next run did fail withusage_limit, but withresetAt: null(the #15665 shape). An empty wake run then ended ascompleted2 s later. So none of the three runs met the recovery conditions on its own: afailedstatus plus a non-nullresetAton the latest run. #19543 merged after this incident. It keeps a buffered quota failure from being replaced inside one result buffer. Here the three wake runs were separate root runs, so I don't think it covers this case. Changing the "latest executed run" rule, as option 2 / #17862 does, still seems necessary.Sequence#
An orchestrator thread had three background subagents running when its root turn ended normally (run 13, 22:29:40Z). All three subagents hit the five-hour limit at about the same moment. Each one's failure notification started its own root run. Times are UTC, 2026-10-19. The reset was 23:50:00Z (
five_hour:1792453800).Run Started by Requested → completed Status Turn items 14 notification for subagent A's failure 22:48:03.968 → 22:48:04.033 completednotification,system_notice"Claude usage limit reached. This turn is paused until the 5-hour limit resets in 1h 2m.",checkpoint15 notification for subagent B's failure 22:48:04.038 → 22:48:04.499 failednotification,assistant_message"You've hit your session limit · resets 3:50am (Asia/Tbilisi)",error{"class":"usage_limit","code":"api_error_429","retryable":true,"resetAt":null}16 notification for subagent C's failure 22:48:06.415 → 22:48:06.469 completednotification,checkpointAfter that:
- The thread has no
limitRecovery, nosnoozedUntil, and nolimit-arm:orlimit-resume:messages. - No run was created after the 23:50:00Z reset. The thread sat idle until the user noticed about 6 hours later.
- The UI still shows the "paused until … resets in 1h 2m" banner from run 14, so it promises a resume that was never armed.
The server trace logs on disk start after the reset, so I can't show the sweeps from the incident window. The run and turn-item rows above come read-only from
statev2.sqlite(orchestration_v2_projection_runs,orchestration_v2_projection_turn_items).Three gaps in one incident#
- Run 14: the usage-limit
system_noticewas emitted, carrying the reset in its id, but the run ended ascompletedwith noerroritem. This is the same classification gap as run 7 in the original report. - Run 15: this run did fail as
usage_limit, but withresetAt: null, so it can't be armed even though run 14's notice had the reset 0.5 s earlier. - Run 16: an empty wake run (just
notification+checkpoint) became the latest executed run, so the thread dropped out ofgetLimitRecoveryCandidateseither way.
Fixing any one of these alone wouldn't have resumed this thread. Doing all of the following would have:
- Carry the reset from the provider's
rate_limit_event/ usage-limit notice onto anyusage_limitfailure in the same window. - Pick candidates from the most recent limit signal whose reset is still in the future, rather than from the latest run.
- Skip notification-only runs, or hold them while the thread is limited.
Workaround#
Send any message in the thread after the reset.
- The thread has no
Reproduced both recovery failures against 21da3061aa: a usage-limited Claude thread was never armed for auto-resume when a background-task wake run finished as completed right after the limit stop. The fix in https://git.cafe/pingdotgg/t3code/pulls/22775 (9fd419a6e9) keeps recovery armed across pre-reset wakes so Resume and Stop agree; 99 focused tests and paired isolated-server histories back it. Real Claude quota exhaustion remains unverified.
Still happens on 0.1.7-nightly (Linux, desktop AppImage, 2026-11-01). The build installed on disk at the time was
0.1.7-nightly.20261101.4035.- A Claude run failed with
usage_limitat 23:21:25Z (reset 00:10:00Z), and recovery was armed (autoResume: true,snooze: true). - A background-subagent wake run started at 23:21:54Z and finished as
completed0.3 s later. - Nothing resumed at 00:10. The thread stayed idle until a manual message at 02:30.
Evidence is from the local
statev2.sqlite(runs 125–127) and the provider event log. #22775 isn't onmainyet, which fits this.- A Claude run failed with
Still reproduces on
0.1.8-nightly.20261104.4165(commit8b44f42b), macOS (Darwin 27.2.0, arm64), desktop app with its local server, providerclaudeAgent, Claude subscription limit. Settings:autoResumeLimitedThreads: true,snoozeLimitedThreads: true. Read-only from the V2 projection tables. Times are UTC. Thread labels are arbitrary.This adds two things to the thread: it still happens on 0.1.8, and it happens with native Claude subagents (Task tool), not only background tasks. It also covers both variants from earlier comments, "never armed" and "armed, then cancelled by a later wake".
Thread A: wake runs landed before arming
All reset times are 04:40:00.
Time Event 02:47:01.9 Run 33 (started by a "Subagent failed" notification) fails: usage_limit,api_error_429,resetAt04:40:0002:47:03 to 02:47:16 Runs 34 to 38 each start from another "Subagent ... failed" notification and finish as completedin 30 to 230 ms. Each holds only anotificationitem04:40 onward No limit-arm:orlimit-resume:command. Next activity is a user-started run at 14:50Six native subagents failed on the same limit between 02:47:01 and 02:47:16. The parent thread had been idle waiting on them.
Thread B: armed, then hidden
Time Event 02:47:29.6 Run 46 fails with usage_limit,resetAt04:40:00shortly after limitRecovery={ autoResume: true, snooze: false, resetAt: 04:40:00 }for run 4602:47:34.7 Run 47 starts from a notification, completedat 02:47:35.6, only anotificationitem04:40 onward No limit-resumemessage. The thread is not a candidate because the latest executed run iscompletedThe same thread on Nov 2: run 19 failed with
usage_limitat 09:11:57 (resetAt12:40:00). Runs 20 to 23 were notification-only andcompletedwithin 25 seconds. It was never armed and nothing resumed at 12:40.Control group, same account and windows
- Thread C hit the Nov 3 window at 02:48:05 and no run followed the failed one.
limit-resumeran at 04:40:02.286 and the thread kept working. - Four threads that hit the Nov 2 window with no run after the failure all resumed at 12:40:02.
So the pattern holds: if the limited run stays the latest executed run, auto-resume works. If any
completedwake lands after it, auto-resume never fires.Source
In this build,
ProjectionStore.getLimitRecoveryCandidatesstill joins the latest executed run (ORDER BY completed_at DESC) and requiresr.status = 'failed', andlimitRecoveryCommandstill requiresthread.status === "failed". This matches the analysis earlier in the issue. The subagents' own failures aren't the problem, since the root run recordsusage_limititself. The latercompletedruns are.I haven't run #22775 against these threads. From its description, its R1 (wake before arm) and R2 (already armed) cases match Threads A and B.
Posted by Claude Opus 5.5 (Claude Code, run from T3 Code's triage flow) at the user's request. Sanitized: no conversation content, project names, paths or account details.
- Thread C hit the Nov 3 window at 02:48:05 and no run followed the failed one.
I tried to reproduce this on the current build and could not.
On origin/main f03db4fbef I added a ProjectionStore test (branch factory/repro-16815, commit 03cafacd90). It creates a thread whose root run fails with a usage_limit error item (resetAt 4h ahead, code api_error_429), then a second root run that ends 'completed' 2 s later and holds only a notification item (subagent, outcome failed).
vp test run src/orchestration-v2/ProjectionStore.test.ts -t limitin apps/server: before the wake run, getLimitRecoveryCandidates({autoResume:true, snooze:true}) returns the thread with latestRunId = the limited run. After the wake run it returns nothing (AssertionError: expected undefined to not equal undefined), so no limit-arm or limit-resume would be dispatched. I could not reproduce it in a running app: it needs a real Claude subscription usage limit plus background-task wakes, which no VM has, and the Replay dev provider can emit neither. The fix PRs #17862, #22775 and #31219 are all closed unmerged, and the code on main still selects only the latest executed run and requires status 'failed'.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
juliusmarminge closed this
yspreen(GitHub profile, opens in a new tab) linked this to #38498
Sign in to join this conversation.
Note
Grok responding on behalf of Julius.
Thanks for the detailed write-up. I checked it against
mainand it's a real bug.Root cause
ProjectionStore.getLimitRecoveryCandidates(apps/server/src/orchestration-v2/ProjectionStore.ts:3362-3436) joins only the thread's latest executed run (ordered bycompleted_at), and requiresr.status = 'failed'plus a rooterroritem on that same run withfailure.class = 'usage_limit'and a non-nullfailure.resetAtthat's later than the run'scompleted_at.limitRecoveryCommand(apps/server/src/orchestration-v2/UsageLimitRecoveryWorker.ts:11-25) returnsnullunlessthread.status === "failed"andlastErrorClass === "usage_limit". Arming (limit-arm:) only happens on a scheduler sweep (UsageLimitRecoveryWorker.ts:78-113), so it isn't immediate.ClaudeAdapterV2(Adapters/ClaudeAdapterV2.ts:3081+) bufferstask_notificationframes and dispatches continuation runs with no check againstlimitRecoveryor a recentusage_limitfailure. A wake run that ends 2 s after the limit stop becomes the latest executed run, so the thread drops out of the candidate set before the sweep ever arms it.completedbecauseproviderFailureFromResult(ClaudeAdapterV2.ts:2517-2555) returnsnullfor asuccessresult withis_error: false. TheusageLimitedheuristic (ClaudeAdapterV2.ts:6469-6477) only fires when the turn saw a rejected rate-limit event or a rate-limited assistant message. A notification-only turn, or one that just echoes the limit text (your run 7), doesn't meet either condition.Fix options
usage_limit. This is worth doing, but it isn't enough alone. Runs 3-6 and 8 produced no limit signal at all, so they would still becompleted.usage_limitfailure with a future reset, skipping later runs that did no work (notification/checkpoint/system_notice only). Recommended. It's adapter-agnostic, it fixes this incident directly, and it also covers the arming race. Both the SQL andlimitRecoveryCommandneed to stop relying onthread.status === "failed"for this case, keyed off the limited run's id.Suggested plan: do (2) now and (1) as hardening, and handle (3) together with #16233.
Related: #15665 (a follow-up failure with
resetAt: null) is a different symptom from the same "latest run only" rule. #16233, #15130 and #14169 are adjacent but not duplicates. PR #15553 is UI-only and doesn't change arming.Workaround: after the reset, send any message to the thread. Avoid leaving background subagents running near the limit if you rely on auto-resume.