Skip to content

Commit f9d99f0

Browse files
authored
fix(session): keep GitHub Copilot compaction requests valid (#22371)
1 parent bbd5faf commit f9d99f0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/opencode/src/session

packages/opencode/src/session/llm.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ export namespace LLM {
205205
// calls but no tools param is present. When there are no active tools (e.g.
206206
// during compaction), inject a stub tool to satisfy the validation requirement.
207207
// The stub description explicitly tells the model not to call it.
208-
if (isLiteLLMProxy && Object.keys(tools).length === 0 && hasToolCalls(input.messages)) {
208+
if (
209+
(isLiteLLMProxy || input.model.providerID.includes("github-copilot")) &&
210+
Object.keys(tools).length === 0 &&
211+
hasToolCalls(input.messages)
212+
) {
209213
tools["_noop"] = tool({
210214
description: "Do not call this tool. It exists only for API compatibility and must never be invoked.",
211215
inputSchema: jsonSchema({

0 commit comments

Comments
 (0)