Skip to content

Commit 0f3e831

Browse files
esrehmkiESRE-dev
authored andcommitted
compaction: prevent tool calls from models that ignore prompt instructions
* Qwen3 and other open-weight models hallucinate tool calls during compaction despite the prompt saying not to, crashing the session with "Tool call not allowed while generating summary" FIX * set toolChoice: "none" at the API protocol level so the model is structurally prevented from emitting tool calls
1 parent a27d3c1 commit 0f3e831

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

packages/opencode/src/session/compaction.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ When constructing the summary, try to stick to this template:
263263
},
264264
],
265265
model,
266+
toolChoice: "none",
266267
})
267268

268269
if (result === "compact") {

0 commit comments

Comments
 (0)