You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Reasoning from local OpenAI-compatible models (llama.cpp/Ollama/LM Studio) is discarded — no official toggle #1118
Describe the bug
When connecting Zoo Code to a local OpenAI-compatible chat model that emits a reasoning_content field (llama.cpp, Ollama's OpenAI endpoint, LM Studio), the reasoning is silently discarded from the assistant messages. The model therefore cannot see its own reasoning chain, which reduces output quality and inflates token usage on follow-up turns.
To Reproduce
Run a local OpenAI-compatible server that streams reasoning_content alongside content, e.g. llama.cpp llama-server (any reasoning model such as Qwen3.6/QwQ/DeepSeek-R1).
In Zoo Code, add it as an OpenAI-compatible provider with the local base URL.
Run any task and observe the messages sent back to the provider on the next turn.
The assistant message contains only content, the reasoning_content is dropped.
Expected behavior reasoning_content should be preserved and fed back so the local model sees its own reasoning, OR there should be an official setting to enable R1-format handling for OpenAI-compatible providers.
What version of zoo are you running
3.74.0 (also affects current main)
openAiR1FormatEnabled exists only on the provider's options object but is never set anywhere in the codebase — no UI setting, no package.json configuration, no provider-creation code touches it. So the R1 format path (which parses and preserves reasoning_content) is effectively dead for every model whose id doesn't literally contain deepseek-reasoner.
The deepseekReasoner flag then gates convertToR1Format(...) (line 106) and the reasoning parse/save logic further down in the streaming path. Local models are left with reasoning stripped.
Workaround (current)
Patch the bundled dist/extension.js to force the R1 flag (d=!0 for the OpenAI stream) and hard-enable preserveReasoning. Details and the exact search/replace strings are documented. A source-level equivalent of the same change is what this issue asks to be fixed in-tree.
A source-level fix is proposed in PR #1119: enabling the existing R1 format toggle now also sets info.preserveReasoning on the OpenAI-compatible provider, so reasoning_content is preserved in follow-up context instead of being stripped by Task.ts.
Workaround for the currently installed version (3.74.0) — exact extension.js patches
Since the source fix in PR #1119 requires a rebuild, here are the exact patch strings to apply to the bundled extension of Zoo Code 3.74.0. They force the R1 format for all models (so reasoning_content is parsed) and hard-enable reasoning preservation, which is the in-tree equivalent of the PR fix.
Activity
ch405canova-sudo commentedon Aug 4, 2026
A source-level fix is proposed in PR #1119: enabling the existing R1 format toggle now also sets
info.preserveReasoningon the OpenAI-compatible provider, soreasoning_contentis preserved in follow-up context instead of being stripped byTask.ts.ch405canova-sudo commentedon Aug 4, 2026
Workaround for the currently installed version (3.74.0) — exact extension.js patches
Since the source fix in PR #1119 requires a rebuild, here are the exact patch strings to apply to the bundled extension of Zoo Code 3.74.0. They force the R1 format for all models (so
reasoning_contentis parsed) and hard-enable reasoning preservation, which is the in-tree equivalent of the PR fix.File:
~/.vscode-oss/extensions/zoocodeorganization.zoo-code-3.74.0-universal/dist/extension.jsP1 — Force R1 format for all models (parse reasoning_content)
Find (original):
Replace with:
P2 — LiteLLM: always normalize reasoning via
My()Find (original):
Replace with:
Note: there is a second, similar line
n=My(r,{mergeToolResultText:!0,normalizeToolCallId:bh})— that one is already correct and must NOT be touched.P3 — opencode-go: always normalize reasoning via
My()Find (original):
Replace with:
P4 — buildClean: hard-enable reasoning flag
Find (original):
Replace with:
Apply & verify
Restart VSCodium/Zoo fully afterwards. Each of the four strings appears exactly once.
ch405canova-sudo commentedon Aug 4, 2026
Reported and fixed jointly by chaos (@ch405canova-sudo) and opencode.