refactor: delegate model resolution to Claude Code#77
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fc64a6dae5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const normalized = String(model).trim(); | ||
| return normalized || undefined; |
There was a problem hiding this comment.
Keep built-in aliases case-insensitive
For users who type a documented family alias with capitalization (for example $cc:review --model Opus or --model Sonnet), this now forwards Opus/Sonnet literally, while Claude Code documents the aliases as lowercase (opus, sonnet, haiku, fable) and warns that --model values are not prechecked, so mistyped values fail on the first request (checked https://code.claude.com/docs/en/model-config). The old alias lookup was case-insensitive, so these invocations previously worked; normalize only recognized built-in aliases before returning so provider-specific IDs remain untouched.
Useful? React with 👍 / 👎.
Sources and design precedent
codex-plugin-ccstable companion passes arbitrary model names to Codex and keeps only narrow convenience aliasing.OpenAI alignment: host CLI owns model resolution
This PR makes the stable OpenAI boundary front-and-center: the wrapper owns orchestration and a small user-facing default policy, while the host CLI owns evolving model aliases, provider routing, account eligibility, and discovery.
Like OpenAI's reciprocal plugin,
cc-plugin-codexnow forwards arbitrary model aliases and full/provider-specific IDs directly to its host CLI. It removes stale version pins and does not force[1m]behavior that depends on account and provider configuration.Anthropic alignment
Claude Code
/modelremains the authoritative account/provider-aware picker. Managed model restrictions, provider-specific names, alias versions, and extended-context eligibility stay under Claude Code or administrator control instead of being duplicated in this plugin.Stack dependency
Depends on #76. This PR contains that Fable-support commit plus model-delegation and uniform-effort commits. Review only this PR's additional work with the stack comparison. After #76 merges, this PR's upstream diff should reduce to those follow-up changes.
What changed
high.opusas the model used when--modelis omitted.--effortauthoritative./modelas the authoritative discovery mechanism.Intentional local policy
OpenAI's stable companion leaves omitted model and effort values to Codex. This plugin intentionally keeps a small compatibility policy: omitted model selects the friendly
opusalias, and every friendly alias defaults tohigheffort. Alignment covers host-owned model resolution; it does not require identical product defaults.Full and provider-specific IDs remain pure pass-through values with no inferred effort because their supported capabilities can vary by provider and configuration.
User impact
Claude Code can advance aliases without a plugin release. Users get one predictable
higheffort default across Fable, Opus, Sonnet, and Haiku, while explicit effort settings still win. Users can inspect current model choices with/modeland pass any listed alias or full ID to the plugin.Validation
npm run check— 504 unit tests, 43 integration tests, and 22 E2E tests passed.--effort high.