You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Scheduled Claude thread fails every run with "Insufficient context allowance" while the task reports succeeded #28654
A scheduled task bound to a long-lived Claude thread failed for about 34 hours with Insufficient context allowance for the provider handoff, while the task's lastRunStatus stayed succeeded. The thread was not permanently wedged: a manual /compact recovered it. T3 just never tried that itself.
Steps to reproduce
Bind an hourly scheduled task to a thread on claudeAgent (claude-opus-5-5, 1M window) and let the native session grow large (about 808k tokens here, after 400+ runs).
Run a turn on that thread with another provider (Codex), so a handoff back to Claude is pending.
Let the next scheduled run start on Claude.
Expected
T3 compacts the native session, or otherwise makes room, and the run proceeds. If it can't, the schedule reports the failure.
Actual
The run fails 0.2-0.4s after starting, with ContextHandoffBudgetError, without reaching Claude. Provider auto-compaction therefore never fires.
Every later run fails the same way. This thread had 37 such failures between 2026-10-30 and 2026-11-01.
list_scheduled_tasks kept reporting lastRunStatus: "succeeded", apparently because the message was delivered and the run started. An unattended automation has no signal that it stopped working.
Cause (from the shipped bundle)
handoffBudget computes window - native - current - max(16000, window / 4). At 808k of 1M that is 0 or less, so deliverContextHandoffs raises ContextHandoffBudgetError. The check only runs on non-compaction turns; a bare /compact sets deferInline, which is why it recovers the thread.
Suggested fix
When the budget is exhausted on a provider with supportsCompaction, compact automatically and retry the turn once.
Report the run's terminal status in the scheduled task's lastRunStatus.
Workaround
Send a bare /compact to the thread. The next normal turn then succeeds.
Related
#15997, #19875, #23275, #23142: same error, in other providers or triggers. #19875 is the case where /compact cannot recover.
Environment
T3 Code desktop, CLI t3 v0.1.0, Linux (Arch-based, Omarchy), Claude Agent provider with Codex as the other provider.
I ran this as a provider-switch integration scenario that matches the report: Claude with a 1M window and 808k tokens already used natively, a Codex turn in between, then a Claude turn.
On current main (8760d063e9), the run completes. The server logs Recovering provider context in a fresh native session (reason handoff_budget_exhausted), starts Claude in a fresh native session, and hands it the thread history, including the Codex turn.
Activity
juliusmarminge commentedon Nov 1, 2026
I ran this as a provider-switch integration scenario that matches the report: Claude with a 1M window and 808k tokens already used natively, a Codex turn in between, then a Claude turn.
Insufficient context allowance for the provider handoff. Compact the target conversation…, the same error as in this report.Recovering provider context in a fresh native session(reasonhandoff_budget_exhausted), starts Claude in a fresh native session, and hands it the thread history, including the Codex turn.That recovery shipped in https://git.cafe/pingdotgg/t3code/pulls/25610 (07242abff3), first released in v0.1.4. This report is from
t3 v0.1.0, so updating should stop the repeated failures without a manual/compact.The second part,
lastRunStatusshowingsucceededfor a run whose turn failed, is tracked in https://git.cafe/pingdotgg/t3code/issues/17889 and has an open fix in https://git.cafe/pingdotgg/t3code/pulls/23131.Closing this one as fixed on main. The status reporting continues in https://git.cafe/pingdotgg/t3code/issues/17889.