summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLuke Parker <[email protected]>2026-04-15 08:02:27 +1000
committerGitHub <[email protected]>2026-04-15 08:02:27 +1000
commitf9d99f044df4d506aac897a1c27d1a0b1f894ae9 (patch)
treea89dd42e935b0f745920640d6a9d19ee20879cf1
parentbbd5faf5cdc702a143f4b1438405131312a63533 (diff)
downloadopencode-f9d99f044df4d506aac897a1c27d1a0b1f894ae9.tar.gz
opencode-f9d99f044df4d506aac897a1c27d1a0b1f894ae9.zip
fix(session): keep GitHub Copilot compaction requests valid (#22371)
-rw-r--r--packages/opencode/src/session/llm.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts
index 3ab35958a..732ad7a9f 100644
--- a/packages/opencode/src/session/llm.ts
+++ b/packages/opencode/src/session/llm.ts
@@ -205,7 +205,11 @@ export namespace LLM {
// calls but no tools param is present. When there are no active tools (e.g.
// during compaction), inject a stub tool to satisfy the validation requirement.
// The stub description explicitly tells the model not to call it.
- if (isLiteLLMProxy && Object.keys(tools).length === 0 && hasToolCalls(input.messages)) {
+ if (
+ (isLiteLLMProxy || input.model.providerID.includes("github-copilot")) &&
+ Object.keys(tools).length === 0 &&
+ hasToolCalls(input.messages)
+ ) {
tools["_noop"] = tool({
description: "Do not call this tool. It exists only for API compatibility and must never be invoked.",
inputSchema: jsonSchema({