Repository navigation
Commit ed36ed5
committed
feat(opencode): add chunking rule for large write tool calls
OpenCode's tool-call streaming over @ai-sdk/anthropic via GitHub Copilot
truncates large 'write' payloads at the 32 000 output-token cap, leaving
an orphaned tool call that the agent sees as 'Tool execution aborted'
with no recoverable state (upstream issue anomalyco/opencode#33687).
Empirical evidence on this host across 30+ days: 9 of 10 orphaned writes
hit output=32000, finish=length. Successful writes go up to ~58 KB but
the tail is thin and unreliable. 20 KB / 400 lines is a conservative
threshold that leaves plenty of token headroom for reasoning and pre-
text on the same turn.
The rule tells the agent to emit the first chunk with 'write' and append
the remainder with a 'bash' heredoc, which avoids the streaming path
that triggers the bug.1 parent 5752f01 commit ed36ed5
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
0 commit comments