Skip to content

refactor: delegate model resolution to Claude Code#77

Open
mychaelconnolly wants to merge 3 commits into
sendbird:mainfrom
mychaelconnolly:agent/delegate-model-aliases
Open

refactor: delegate model resolution to Claude Code#77
mychaelconnolly wants to merge 3 commits into
sendbird:mainfrom
mychaelconnolly:agent/delegate-model-aliases

Conversation

@mychaelconnolly

@mychaelconnolly mychaelconnolly commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Sources and design precedent

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-codex now 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 /model remains 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

  • Removed fixed Opus, Sonnet, and Haiku model mappings.
  • Trimmed and forwarded every explicit model value without rewriting it.
  • Standardized implicit effort for friendly aliases: Fable, Opus, Sonnet, and Haiku each default to high.
  • Kept opus as the model used when --model is omitted.
  • Kept explicit --effort authoritative.
  • Stopped guessing effort for full or provider-specific model IDs.
  • Documented Claude Code /model as the authoritative discovery mechanism.
  • Updated unit, integration, E2E, and skill-contract expectations for pass-through routing and the uniform alias effort policy.

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 opus alias, and every friendly alias defaults to high effort. 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 high effort default across Fable, Opus, Sonnet, and Haiku, while explicit effort settings still win. Users can inspect current model choices with /model and 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.
  • Added integration coverage proving all four friendly aliases reach Claude Code with --effort high.
  • PR feat: add Fable using host-owned model routing #76's live no-tools Fable smoke remains valid with pass-through routing.

@mychaelconnolly
mychaelconnolly marked this pull request as ready for review July 18, 2026 14:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +672 to +673
const normalized = String(model).trim();
return normalized || undefined;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant