Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
36ef6cc
fix(ai): finalize Bedrock redacted reasoning at block end (#51999)
rekram1-node Sep 29, 2026
34a8938
fix(ai): bind Bedrock Claude thinking blocks by default (#51959)
rekram1-node Sep 29, 2026
293d60a
chore(desktop): bump electron to 44.4.5 (#52005)
Hona Sep 29, 2026
41d4a9c
fix(session-ui): render moved notice as a timeline divider (#52009)
Hona Sep 29, 2026
a604b7f
fix(ui): calm diff word highlights with @pierre/diffs 1.5.1 (#51236)
Hona Sep 29, 2026
14af33d
fix(ai): show provider error bodies when no message is recognized (#5…
rekram1-node Sep 29, 2026
ff72659
fix(desktop): give isolated dev service a fixed port (#52013)
Hona Sep 29, 2026
2aaa265
fix(ai): read provider error messages from common body layouts (#52014)
rekram1-node Sep 29, 2026
6712cc4
fix(core): turn off Workers AI thinking through the chat template (#5…
rekram1-node Sep 29, 2026
b30c4d0
fix(ai): enable explicit caching on more message protocol routes (#51…
opencode-agent[bot] Sep 29, 2026
d76f968
feat(core): tell users how to sign back in to OpenCode Console (#51847)
vimtor Sep 29, 2026
b29dab3
fix(core): drop SSO link from Console sign-in error (#52062)
vimtor Sep 29, 2026
7ef4a1a
feat(tui): show recently closed tabs in new session menu
kitlangton Sep 29, 2026
0f931d3
chore(core): refresh bundled models.dev snapshot
opencode-agent[bot] Sep 29, 2026
948047a
fix(tui): use disclosure icon for low activity errors (#52097)
opencode-agent[bot] Sep 29, 2026
3126808
fix(ai): defer Mistral thinking metadata until block end (#52008)
rekram1-node Sep 29, 2026
a565ea8
feat(cli): allow disabling the background service (#52107)
opencode-agent[bot] Sep 29, 2026
83fafda
feat(cli): continue run after rejecting a permission ask (#51968)
jlongster Sep 29, 2026
7db941a
docs(console): add GPT 6.1 Sol to model list
fwang Sep 29, 2026
c14a1f5
feat(core): preserve provider response body in session errors (#52136)
rekram1-node Sep 29, 2026
bc5ff1c
fix(cli): answer subagent asks in run and keep parallel rejections co…
jlongster Sep 29, 2026
89d37a0
fix(core): restrict database files to their owner (#52150)
rekram1-node Sep 29, 2026
b694d2b
fix(core): explain ChatGPT token-sharing errors (#52158)
rekram1-node Sep 29, 2026
16ef62c
feat(app): show ChatGPT usage limit dialog (#52153)
rekram1-node Sep 29, 2026
621a5b0
feat(app): show ChatGPT token-sharing guidance (#52160)
rekram1-node Sep 29, 2026
4d90907
feat(core): add separate ChatGPT token-sharing OAuth method (#52147)
rekram1-node Sep 29, 2026
135995d
test: stabilize V2 CI test suites (#52159)
opencode-agent[bot] Sep 29, 2026
4c33a25
feat(cli): add auth export and auth import commands (#52139)
thdxr Sep 29, 2026
0f83038
fix(core): align ChatGPT token sharing with updated partner guide (#5…
rekram1-node Sep 29, 2026
4deda18
fix(app): align ChatGPT usage copy and links (#52163)
rekram1-node Sep 29, 2026
c2a39ac
fix(core): stop promising a ChatGPT usage reset (#52168)
rekram1-node Sep 29, 2026
a2fc196
fix(stats): match document background to page theme (#52169)
opencode-agent[bot] Sep 29, 2026
8d8a7bc
sync release versions for v2.0.20
Sep 29, 2026
cb7efec
chore(sync): merge upstream v2 through v2.0.20
cursoragent Sep 29, 2026
82349b5
test: stub connection status in fork plugin fixtures
cursoragent Sep 29, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(core): turn off Workers AI thinking through the chat template (an…
  • Loading branch information
rekram1-node authored Sep 29, 2026
commit 6712cc4c2c2be26c5baa2db9af6c530ca950b713
21 changes: 20 additions & 1 deletion packages/core/src/variant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,25 @@ const nvidiaChat: Protocol = (model, support) => {
}
}

// Workers AI ignores or rejects `reasoning_effort: "none"` on most models. Kimi's chat template reads
// `thinking`; the others read `enable_thinking`, so both are sent.
const workersAITemplate = (thinking: boolean): Overlay => ({
body: { chat_template_kwargs: { enable_thinking: thinking, thinking } },
})

const workersAIChat: Protocol = (_, support) => {
switch (support.type) {
case "effort":
return efforts(support.values ?? EFFORTS, (effort) =>
effort === "none" ? workersAITemplate(false) : { settings: { reasoningEffort: effort } },
)
case "toggle":
return toggle(workersAITemplate(false), workersAITemplate(true))
case "budget_tokens":
return []
}
}

const basetenTemplate = (enable_thinking: boolean): Overlay => ({
body: { chat_template_args: { enable_thinking } },
})
Expand Down Expand Up @@ -552,7 +571,7 @@ const PROTOCOLS: Readonly<Record<string, Protocol>> = {
"@opencode/ai/providers/alibaba/chat": alibabaChat,
"@opencode/ai/providers/baseten": basetenChat,
"@opencode/ai/providers/cerebras": openaiChat,
"@opencode/ai/providers/cloudflare-workers-ai": openaiChat,
"@opencode/ai/providers/cloudflare-workers-ai": workersAIChat,
"@opencode/ai/providers/deepinfra": deepinfraChat,
"@opencode/ai/providers/deepseek": deepseekChat,
"@opencode/ai/providers/fireworks": openaiChat,
Expand Down
31 changes: 31 additions & 0 deletions packages/core/test/variant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,37 @@ test("caps Alibaba thinking budget variants at 64k", () => {
])
})

test("spells Workers AI thinking controls through the chat template", () => {
const pkg = "@opencode/ai/providers/cloudflare-workers-ai"
const off = { body: { chat_template_kwargs: { enable_thinking: false, thinking: false } } }
const on = { body: { chat_template_kwargs: { enable_thinking: true, thinking: true } } }
expect(
resolve(model(pkg, "@cf/deepseek-ai/deepseek-v4-flash-0731"), [
{ type: "effort", values: ["none", "low", "high", "max"] },
]),
).toEqual([
{ id: "none", ...off },
{ id: "low", settings: { reasoningEffort: "low" } },
{ id: "high", settings: { reasoningEffort: "high" } },
{ id: "max", settings: { reasoningEffort: "max" } },
])
expect(resolve(model(pkg, "@cf/zai-org/glm-4.7-flash"), [{ type: "toggle" }])).toEqual([
{ id: "none", ...off },
{ id: "thinking", ...on },
])
expect(
resolve(model(pkg, "@cf/qwen/qwen3.8-27b"), [
{ type: "toggle" },
{ type: "effort", values: ["low", "medium", "xhigh"] },
]),
).toEqual([
{ id: "none", ...off },
{ id: "low", settings: { reasoningEffort: "low" } },
{ id: "medium", settings: { reasoningEffort: "medium" } },
{ id: "xhigh", settings: { reasoningEffort: "xhigh" } },
])
})

test("spells Chat Completions variants for hosting providers", () => {
expect(
resolve(model("@opencode/ai/providers/openai-compatible", "deepseek-ai/deepseek-v4-pro", undefined, "nvidia"), [
Expand Down