Skip to content
Source
Sign inSign up
pingdotgg/t3code

Usage-limit auto-resume does not reactivate a usageLimited /goal #45646

Openvibhor1102(GitHub profile, opens in a new tab) opened this issue 0 comments

What happened

When a /goal thread hits a provider usage limit and later auto-resumes via autoResumeLimitedThreads, the turn continues, but the goal stays stuck in usage_limited (usageLimited). Goal progress (tokensUsed, timeUsedSeconds) stops updating, multi-turn goal continuation stops if that single turn finishes, and command notices are no longer steered into the active turn.

Diagnosis

  1. UsageLimitRecoveryWorker.ts (limitRecoveryCommand) dispatches a plain message.dispatch with text: "Continue where you left off." and usageLimitContinuationOfRunId.
  2. In CodexAdapterV2.ts, startTurn only calls activateGoal (thread/goal/set with status: "active") when the message parses as a /goal command or when goalsPausedForWake.has(nativeThreadId) and the goal status is "paused".
  3. A usage-limit failure transitions Codex's goal to usageLimited ("usage_limited" in T3 Code's projection), not "paused", and never adds it to goalsPausedForWake.
  4. As a result, CodexAdapterV2 falls through to a regular single turn/start without reactivating the goal. Orchestrator.ts also skips steering command notices into the active turn because providerThread.goal?.status !== "active". (Note: Claude's nextClaudeGoal in ClaudeAdapterV2.ts also does not restore goal state on "Continue where you left off.".)

Steps to reproduce

  1. Enable "Resume at reset" (autoResumeLimitedThreads).
  2. Start a /goal on a Codex thread and let it run until a usage limit is reached (thread/goal/updated emits status: "usageLimited").
  3. Wait for the reset time so UsageLimitRecoveryWorker auto-resumes the thread.
  4. Observe the provider event log and projection DB: thread/resume emits status: "usageLimited", turn/start is sent without thread/goal/set({ status: "active" }), and providerThread.goal.status remains "usage_limited".

Version

0.1.13 (source-verified on upstream/main at d17aa43c82)

Environment

Linux 7.3.5-200.fc44.x86_64 x86_64, Node v24.22.2, codex-cli 0.172.0

Evidence

# Run 5 hits usage limit -> goal becomes usageLimited
[2026-11-29T11:51:43.541Z] incoming thread/goal/updated: status="usageLimited", tokensUsed=229967, timeUsedSeconds=1956
[2026-11-29T11:51:43.620Z] outgoing turn/start: input=[{"type":"text","text":"Continue where you left off."}]
# No outgoing thread/goal/set({ status: "active" }); zero thread/goal/updated events for the rest of the run.
# Same pattern on Run 9 -> Run 10 auto-resume at 16:52:03Z; projection remains status="usage_limited".

#31909 (closed as duplicate of #25951) covered manual user messages not resuming a usageLimited goal and the Resume button being hidden while busy, not automatic UsageLimitRecoveryWorker continuations.

Fix applied or workaround

None applied. Workaround is manually sending /goal resume after the thread stops.

Filed by

Antigravity (Gemini 4 Hydrogen) via triage playbook

  1. vibhor1102(GitHub profile, opens in a new tab) added labelsvia-triage

  2. tanstack-source added labelsbug

Sign in to join this conversation.