[WRONG BRANCH] fix(commandcode): share reasoning-facts table and fix GLM slug decoding for API-key preset - #1800
Conversation
…ng for API-key preset The `commandcode` (API-key) registry entry was missing the official model-profile reasoning-facts table that the OAuth `command-code` entry carries. Two symptoms followed: 1. The Codex catalog advertised no reasoning levels for API-key models (deepseek-v4-flash/pro, GLM-5.x), so clients forced effort none and requests failed with 400 'messages.content.type is invalid'. 2. The router's known-ids decode source missed the native slash ids, so Codex-facing slugs like `commandcode/deepseek-deepseek-v4-pro` were forwarded upstream verbatim and rejected with 400 'unsupported_model'. Also fix the GLM table keys to match the exact upstream ids (`zai-org/GLM-5.3` not `zai-org/glm-5.3`) and make the effort lookup case-insensitive, and add GLM-5 / 5.1 / 5.2-Fast (verified high/max from their official profiles).
|
✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe change aligns Command Code GLM model identifiers with upstream casing, adds new GLM profiles, makes profile lookups case-insensitive, shares reasoning metadata with the API-key provider, and adds registry and alias regression coverage. ChangesCommand Code model support
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change restores reasoning options and correct model-id decoding for the API-key provider, with regression coverage and passing verification; no actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Its title has been prefixed with |
Problem
The
commandcode(API-key) registry entry was missing the official model-profile reasoning-facts table that the OAuthcommand-codeentry carries. Two user-visible failures followed:content.type400 — the Codex catalog advertisedsupported_reasoning_levels: []for every API-key model (deepseek-v4-flash/pro,GLM-5.x), so clients forced effortnoneand requests failed with:unsupported_model400 — the router's known-ids decode source (knownModelIdsForProviderunions registrymodelReasoningEffortskeys) missed the native slash ids, so Codex-facing slugs likecommandcode/deepseek-deepseek-v4-prowere forwarded upstream verbatim (instead ofdeepseek/deepseek-v4-pro) and rejected intermittently (only when the live-models cache was cold):Fix
src/providers/registry.ts: addmodelReasoningEfforts: COMMAND_CODE_MODEL_REASONING_EFFORTSto thecommandcode(API-key) entry — same shared table the OAuthcommand-codeentry uses. This both restores the reasoning picker and feeds the router's known-ids decode source.src/providers/command-code-efforts.ts:zai-org/GLM-5.3, notzai-org/glm-5.3) so the exact-match known-ids decode works.commandCodeReasoningEfforts/refreshCommandCodeReasoningEffortslookups case-insensitive.GLM-5,GLM-5.1,GLM-5.2-Fast(verified high/max from their official profile pages).Verification
commandcode/deepseek-deepseek-v4-proandcommandcode/zai-org-GLM-5.3decode back to native slash ids.bun test tests/slug-codec.test.ts tests/command-code-provider.test.ts tests/routing-compatibility.test.ts tests/provider-registry-parity.test.ts— all pass.deepseek-*[high, max, ultra],zai-org-GLM-5.3[low, high, max, ultra].commandcode/deepseek-deepseek-v4-proandcommandcode/zai-org-GLM-5.3requests (incl.reasoning_effort) return 200 with reasoning tokens.Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
Bug Fixes