fix(cli): give setup-claude a fallback profile generator like setup-codex - #6138
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…odex setup-codex.mjs generates a generic profile (fallbackCodexProfile) for any live-catalog model not matched by the hardcoded categoriseModel() pattern list (glm/kimi/mimo/deepseek/gemma4/…). setup-claude.mjs never got the equivalent, so any catalog that doesn't contain those specific old models (e.g. a fresh install with a custom OpenAI-compatible provider) produces zero Claude Code profiles with no error, just a silent "0 written, N skipped". Adds fallbackClaudeProfile(), reusing the already-exported isCodexCompatibleTextModel() filter and a newly-exported profileNameFromModelId() helper from setup-codex.mjs, wired into syncClaudeProfilesFromModels() the same way setup-codex.mjs wires its own fallback: categoriseModel(id) ?? fallbackClaudeProfile(id, m).
29999a1 to
88d9243
Compare
…claude-fallback-profile
|
Merged — thank you, @derhornspieler! 🙏 Good catch on the asymmetry: |
81f5bce
into
diegosouzapw:release/v3.8.44
…odex (diegosouzapw#6138) Give setup-claude a fallback profile generator like setup-codex. Integrated into release/v3.8.44.
Summary
setup-codex.mjshasfallbackCodexProfile()so any live-catalog model not matched by the hardcodedcategoriseModel()pattern list (glm/kimi/mimo/deepseek/gemma4/…) still gets a generated profile.setup-claude.mjsnever got the equivalent — so any catalog that doesn't contain those specific old model names (e.g. a fresh install using a custom OpenAI-compatible provider) silently produces zero Claude Code profiles, just "0 written, N skipped" with no error.fallbackClaudeProfile(), reusing the already-exportedisCodexCompatibleTextModel()filter and a newly-exportedprofileNameFromModelId()helper fromsetup-codex.mjs, wired the same waysetup-codex.mjswires its own fallback:categoriseModel(id) ?? fallbackClaudeProfile(id, m).claude/*,codex/*, and custom self-hosted OpenAI-compatible provider models (noglm/kimi/mimomatches) —omniroute setup-claudewent from 0 profiles written / 59 skipped to profiles generated for every compatible text model.Related Issues
Validation
npm run lint— 0 errors (4270 pre-existinganywarnings, unrelated to this change)npm run test:unit(full monorepo suite) — ran to completion. 15 pre-existing failures across 5 files (combo-builder-opencode-prefix,copilot-runOmniRouteCli,guardrails/visionBridgeHelpers.callVisionModel,kiro-multi-account-isolation,provider-translate-path-golden), verified identical on the unmodified base commit (32e4c906e, same test names, same counts) — confirmed pre-existing/environment-sensitive (local machine state), not caused by this change. Zero failures in any file this PR touches.npm run test:coverage— not run locally; this is a 2-function, ~20-line addition to existing CLI helper modules, low coverage-impact surfaceTests Added Or Updated
tests/unit/cli/setup-claude.test.ts:fallbackClaudeProfile creates a profile for a live-catalog model unmatched by categoriseModelfallbackClaudeProfile skips media and non-text modelssyncClaudeProfilesFromModels falls back to a generic profile for unmatched catalog modelstests/unit/cli/setup-codex.test.ts(3/3) and the fulltests/unit/cli/*.test.tssuite (92/92) also verified green.Coverage Notes
bin/cli/commands/setup-claude.mjs(newfallbackClaudeProfileexport + one-line change to thecategoriseModel(id)call site) andbin/cli/commands/setup-codex.mjs(exports the previously-privateprofileNameFromModelIdhelper — no behavioral change, existingsetup-codex.test.tssuite still passes 3/3 unmodified).fallbackCodexProfileinsetup-codex.test.ts.Reviewer Notes
src//open-sse/code touched — this is CLI-helper-only (bin/cli/commands/).profileNameFromModelIdexport is additive (was already a pure function, just unexported); no call sites elsewhere reference it, verified via repo-wide grep before exporting.release/v3.8.44per repo convention (notmain).32e4c906e(same worktree, files reverted then restored) rather than assumed pre-existing — see Validation section.