Before submitting
Area
apps/server (orchestration v2 context handoff, OpenCode adapter)
Environment
- T3 Code Nightly
0.0.46-nightly.20261003.2610, macOS arm64
- OpenCode
2.0.22
- Model
opencode-go/deepseek-v4.1-flash (1M context per opencode models)
Steps to reproduce
- Run a long OpenCode thread. Here
contextUsage.usedTokens was ~581k, which is fine for a 1M model.
- From that thread, delegate work to Codex with
delegate_task and let it finish. The result is queued as a context handoff (strategy: manual_context, status: ready).
- Send any message in the thread.
Expected behavior
The subagent result is delivered on the next turn (inline, or deferred/pointer if it doesn't fit), and the thread keeps working.
Actual behavior
Every turn fails with:
Provider error: Insufficient context allowance for the provider handoff. Compact the target conversation or use a larger-context model; the current request has not been truncated.
Plain messages ("Status?", "hi") fail too, so the thread is unusable until /compact is run manually. After /compact, the next turn delivered both queued handoffs inline and the thread recovered.
Likely cause (from reading the bundled server code)
- The provider thread's
contextUsage was { "usedTokens": 581117 } with no maxTokens. That means the OpenCode adapter's windowOf(cwd, model) returned undefined for this thread. readModels fills contextWindows from client.model.list with a 5s timeout and errors ignored, so a slow or failed lookup leaves the window unknown.
handoffBudget then falls back to a 128k window: 128k − 581k − reserve gives a budget of 0. Even a short summary handoff can't fit, so deliverContextHandoffs throws ContextHandoffBudgetError on every turn.
Suggestions
- Make the OpenCode window lookup reliable: retry
model.list, or fall back to the model's catalog limit rather than 128k for 1M-context models.
- When the handoff budget is 0, degrade instead of failing the turn. For example, defer the handoff or deliver a
t3_thread_read pointer (this already happens when coverage is too large), or show a one-click "Compact and retry" with the error.
Workaround
Run /compact in the thread. To prevent it, cap the model's limit.context (e.g. 128000) in OpenCode config so OpenCode auto-compacts before T3's fallback window is reached.
Note from the reporter
Big fan of the product and happy to be using it. I'm a non-technical user who has gotten proficient with coding agents. My Claude Code was helping me manage T3 and caught this, so take that for what it's worth.
Before submitting
delegate_taskresult.Area
apps/server (orchestration v2 context handoff, OpenCode adapter)
Environment
0.0.46-nightly.20261003.2610, macOS arm642.0.22opencode-go/deepseek-v4.1-flash(1M context peropencode models)Steps to reproduce
contextUsage.usedTokenswas ~581k, which is fine for a 1M model.delegate_taskand let it finish. The result is queued as a context handoff (strategy: manual_context,status: ready).Expected behavior
The subagent result is delivered on the next turn (inline, or deferred/pointer if it doesn't fit), and the thread keeps working.
Actual behavior
Every turn fails with:
Provider error: Insufficient context allowance for the provider handoff. Compact the target conversation or use a larger-context model; the current request has not been truncated.Plain messages ("Status?", "hi") fail too, so the thread is unusable until
/compactis run manually. After/compact, the next turn delivered both queued handoffs inline and the thread recovered.Likely cause (from reading the bundled server code)
contextUsagewas{ "usedTokens": 581117 }with nomaxTokens. That means the OpenCode adapter'swindowOf(cwd, model)returned undefined for this thread.readModelsfillscontextWindowsfromclient.model.listwith a 5s timeout and errors ignored, so a slow or failed lookup leaves the window unknown.handoffBudgetthen falls back to a 128k window:128k − 581k − reservegives a budget of 0. Even a short summary handoff can't fit, sodeliverContextHandoffsthrowsContextHandoffBudgetErroron every turn.Suggestions
model.list, or fall back to the model's catalog limit rather than 128k for 1M-context models.t3_thread_readpointer (this already happens when coverage is too large), or show a one-click "Compact and retry" with the error.Workaround
Run
/compactin the thread. To prevent it, cap the model'slimit.context(e.g. 128000) in OpenCode config so OpenCode auto-compacts before T3's fallback window is reached.Note from the reporter
Big fan of the product and happy to be using it. I'm a non-technical user who has gotten proficient with coding agents. My Claude Code was helping me manage T3 and caught this, so take that for what it's worth.