commandcode 0.1.15: DeepSeek models that take reasoning_effort "off" offer an off level and are sent "off" for it (#334)

CHENJIAMIAN measured Command Code's Provider API on a GOAT key: "off"
gives 0 reasoning tokens on deepseek-v4-pro, v4-flash,
v4-flash-vision-exp, v4.1-flash and v4.1-flash-fast; "none" is refused
as no option, thinking {"type":"disabled"} is ignored, and
deepseek-v4-flash-fast and Kimi-K3 refuse "off". The plugin offered no
off level and passed magpie's none on unchanged, so every way of asking
for off still thought.

- THINK_OFF: those five models list none, low, high, max on the
  Provider API's list and in the default list (low/high/max are the
  levels magpie borrowed from DeepSeek for them before).
- The Provider API fetch sends reasoning_effort "off" for none or a
  client's "off" on those models, and drops the field for any other
  model, which refuses both spellings. Other levels go as they came.
- Go's /alpha/generate: not measured with "off", so its levels are
  unchanged and off (none or "off") is sent as no level, as none was.

magpie needs no change: a plugin model's variants are its levels
(pluginCatalog), and magpie sends none to a plugin model that lists it
(TestPluginThinkingOff).

Run at base 421117e (origin/main, fetched just before the commit):
- packages/commandcode: TMPDIR=$H HOME=$H/home bun test, 62 pass 0 fail.
- repo root: HOME=<temp> bun test, 2317 pass 0 fail; bun
  scripts/check.mjs ok.
- think-off.test.mjs against the old index.mjs: 5 of 6 red (none sent
  as "none", no "none" level listed, Go sent "off"); the sixth, other
  levels unchanged, passes on both, as it should.

Not tried: no real Command Code account was used. The "off" behaviour
rests on the reporter's measurements, and Go's /alpha/generate with
"off" is untested. The Responses API path (reasoning.effort) is not
rewritten: magpie and OpenCode ask these models on chat completions.
This commit is contained in:
yetone
2026-10-23 15:58:40 +08:00
parent 421117ef75
commit 652f06dc4d
4 changed files with 184 additions and 7 deletions
+8
View File
@@ -112,6 +112,14 @@ that refusal reaches the agent.
The Go models carry their reasoning levels, and a requested level is
fitted to the nearest one the model has.
Thinking can be turned off on the Provider API for DeepSeek V4 Pro, V4
Flash, V4 Flash Vision (exp), V4.1 Flash and V4.1 Flash Fast. These models
offer an off level (`none`), and the plugin sends it as Command Code's
`reasoning_effort: "off"`. A client's own `"off"` is sent the same way. The
other models, DeepSeek V4 Flash Fast and Kimi K3 among them, refuse `"off"`,
so turning thinking off sends them no level. Go's `/alpha/generate` hasn't
been tried with `"off"`, so it is sent no level there either.
The `/models` list doesn't say which models take images. A model is marked
as taking them when it is a Claude model, or when the default list or the
CLI's table says so. For any other model the plugin says nothing either