You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Joob1n (via GitHub)" <gi...@apache.org> on 2026/09/18 10:44:31 UTC

[PR] feat(runtime): offer Command Code GO thinking levels [maka]

Joob1n opened a new pull request, #5484:
URL: https://github.com/apache/maka/pull/5484

   ## Problem
   
   Command Code GO is the only Command Code plan without Provider API access, so it rides the CLI's `/alpha/generate` transport. That transport accepts `reasoning_effort`, and the `commandcode-cli` branch in `model-factory.ts` already maps a level onto it — but the level never arrives: the thinking-level switcher does not appear for `commandcode-go` (or plain `commandcode`).
   
   The cause is a metadata miss, not a wire gap. Command Code exposes no reasoning metadata:
   
   - `GET /provider/v1/models` (public, no key) returns 70 models with only `id`, `object`, `created`, `owned_by`, `name`, `context_length`, `supported_endpoints`.
   - `GET /provider/v1/models/<id>` is 404 — not a registered route.
   - models.dev has no Command Code provider, so `model-metadata.generated.ts` has zero `commandcode` entries.
   
   So `lookupModelMetadata('commandcode-go', id)` returns `{}`, `thinkingOptionsForModel` returns `undefined`, `thinkingVariantsForModel` returns `[]`, and the UI hides the switcher by convention. That leaves the `model-factory.ts` mapping as dead code.
   
   ## Change
   
   Add a static per-model table in `model-metadata.ts` (`COMMAND_CODE_MODEL_METADATA`), wired to both `commandcode` and `commandcode-go`. The levels are ported from `Mars-Sea/dsh-commandcode-provider`'s `KNOWN_EFFORTS` (MIT), which was re-verified against `command-code@1.53.0`'s bundled model table (`dist/cli.mjs`, the provider effort map). Because models.dev has no entry for the provider, `lookupModelMetadata` returns the static override directly, so the full chain lights up with no change to the relay gating.
   
   Two rules from the reference are preserved and documented in the source:
   
   - Models that reason automatically with a depth Command Code chooses (Tencent Hy3/Hy4 without levels, GLM-5/5.1/5.2-Fast, and the previews the reference keeps in `KNOWN_THINKING_MODELS`) carry no selectable effort. They stay out of the table, so no selector is offered for them — matching the CLI, which omits `reasoning_effort` for them.
   - Only the Provider-API effort table is authoritative here; OAuth (anthropic/openai) levels are not mixed in.
   
   Also drop the `max` -> `high` downgrade in the `commandcode-cli` branch of `model-factory.ts`. `max` is a real CLI effort word (`claude-fable-5-1`, `moonshotai/Kimi-K3`, `gpt-5.6-*`, ...), and the reference forwards the level verbatim; the downgrade silently sent a weaker request than the user chose.
   
   ## Tests
   
   - `packages/core/src/__tests__/model-metadata.test.ts`: the table serves both providers; every declared effort is a known `ThinkingLevel`; a model with no declared level stays uncovered.
   - `packages/runtime/src/__tests__/model-factory-thinking.test.ts`: selectable efforts surface; automatic-reasoning models expose nothing; an unknown model exposes and sends nothing; the chosen level — including `max` — is forwarded verbatim.
   
   ## Caveat
   
   The ported table was verified against `command-code@1.53.0`; this branch pins `command-code@1.54.0`, and the CLI bundle was not re-read for 1.54.0. The header comment records the source and version so a future re-sync can re-read the pinned bundle. A wrong effort word is refused by the wire or ignored by the model, so it fails loudly rather than mis-billing.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] feat(runtime): offer Command Code GO thinking levels [maka]

Posted by "M4n5ter (via GitHub)" <gi...@apache.org>.
M4n5ter merged PR #5484:
URL: https://github.com/apache/maka/pull/5484


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org