diff --git a/packages/opencode/src/session/llm.ts b/packages/opencode/src/session/llm.ts index 4be6e2538f..ee4a1df3d2 100644 --- a/packages/opencode/src/session/llm.ts +++ b/packages/opencode/src/session/llm.ts @@ -39,6 +39,7 @@ export namespace LLM { small?: boolean tools: Record retries?: number + output?: "tool" } export type StreamOutput = StreamTextResult @@ -215,6 +216,7 @@ export namespace LLM { tools, maxOutputTokens, abortSignal: input.abort, + toolChoice: input.output === "tool" ? "required" : undefined, headers: { ...(input.model.providerID.startsWith("opencode") ? {