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
fix(provider): honor the host's tool set so compaction can summarize (#91)
opencode calls the model with `tools: {}` on a compaction/summary turn, and
the bundled ai-sdk converts an empty tool record to `options.tools ===
undefined`. The Cursor agent runs its own tools regardless of what the host
declared, and the provider forwarded that activity as provider-executed
`tool-call` / `tool-input-start` parts. opencode's SessionProcessor rejects
those on a summary turn:
case "tool-input-start":
case "tool-call":
if (assistantMessage.summary)
throw Error(`Tool call not allowed while generating summary: ${name}`)
so the turn hard-errored and the session could not be compacted at all.
A host that declared no tools cannot accept tool parts, so route those turns
through the existing `"reasoning"` tool-display path: Cursor's tool activity
is folded into reasoning text instead of crossing the tool-execution
boundary. Turns that do declare tools are untouched and still render
structured blocks.
The empty-array case matters as well as `undefined`: ai-sdk's early return
only covers a null tool set, so a non-empty `tools` filtered down by
`activeTools` arrives as `[]`.
Manual `/compact` has been affected all along. Auto-compaction became
reachable only in 0.7.1-next.0, because #89 published real per-model context
windows — before that opencode resolved `limit.context` to 0 for every Cursor
model, and a zero context limit structurally disables the auto-compaction
trigger.
0 commit comments