Skip to content

Catalog pinned to CLI 1.44.0: models added upstream (deepseek-v4.1-flash, etc.) can never have reasoning enabled #90

Description

@Fu3rte

Bundled catalog is generated from command-code@1.44.0; CLI is at 1.53.0. Models added upstream since then are missing from MODEL_REASONING/MODEL_EFFORTS, so their reasoning can never be enabled.

Example: deepseek/deepseek-v4.1-flash

Upstream registry (command-code@1.53.0, dist/cli.mjs):

DEEPSEEK_V4_1_FLASH:{id:"deepseek/deepseek-v4.1-flash",reasoning:!0,
  reasoningEfforts:["low","high","max"],contextWindow:1e6}

Bundled catalog: absent from both MODEL_REASONING and MODEL_EFFORTSreasoning: false, no levels.
The endpoint accepts it fine; the parameter is simply never sent.

Other models affected (reasoning:true upstream, absent locally): minimax/minimax-m3-free (low/medium/high), tencent/Hy3, gpt-6-astra (low/medium/high/xhigh/max).

Root cause

MODEL_EFFORTS/MODEL_REASONING drive everything, and commandcode-catalog-overrides.ts only offers MODEL_EFFORT_OVERRIDES — an efforts hook. There is no way to override the reasoning flag, so a model missing from the generated catalog stays permanently non-reasoning:

  • src/core.ts:145if (!level || level === "off" || !model.reasoning) return undefinedreasoning_effort never sent
  • index.ts:137compat.supportsReasoningEffort: MODEL_EFFORTS[model.id] !== undefinedfalse
  • src/models.ts:86thinkingMetadataForModel returns undefined for any id not in MODEL_REASONING

So MODEL_EFFORT_OVERRIDES alone can't fix it either — efforts without the flag still hit the core.ts:145 guard.

Reproduce

pi -p --model commandcode/deepseek/deepseek-v4.1-flash --thinking max --no-session "prove it thinks"
# no reasoning content, no reasoning tokens

Workaround (works today, no fork needed)

~/.pi/agent/models.json:

{"providers":{"commandcode":{"modelOverrides":{
  "deepseek/deepseek-v4.1-flash":{
    "reasoning":true,
    "thinkingLevelMap":{"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"},
    "compat":{"supportsReasoningEffort":true}
  }}}}}

All three are required — reasoning clears the core.ts:145 guard, thinkingLevelMap maps pi levels, and compat.supportsReasoningEffort is what actually puts the field on the wire.

Verified against a local echo server: --thinking highreasoning_effort:"high", max"max", off → absent. Against the real endpoint, a hard prompt returns thinking content (e.g. 219 reasoning tokens); low correctly returns none.

Suggested fix

Either bump COMMAND_CODE_CLI_VERSION and re-run npm run sync:commandcode-catalog (fixes all four, but drifts again), or add a reasoning-flag override to commandcode-catalog-overrides.ts:

export const MODEL_REASONING_OVERRIDES: Readonly<Record<string, true>> = {
  "deepseek/deepseek-v4.1-flash": true,
  // ...
}

merged into MODEL_REASONING in src/models.ts alongside MODEL_EFFORT_OVERRIDES, so newly added upstream models can be enabled without waiting for a catalog sync. Note the daily drift check (check:commandcode-catalog) currently only compares the generated file, so it doesn't catch models that upstream added but the pinned version never had.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions