Skip to content

feat(providers): latest Claude models on Anthropic Subscription profile - #520

Open
SleepySML wants to merge 12 commits into
codemie-ai:mainfrom
SleepySML:EPMCDME-14341_subscription-model-access
Open

feat(providers): latest Claude models on Anthropic Subscription profile#520
SleepySML wants to merge 12 commits into
codemie-ai:mainfrom
SleepySML:EPMCDME-14341_subscription-model-access

Conversation

@SleepySML

Copy link
Copy Markdown
Contributor

Summary

On an Anthropic Subscription profile, CodeMie was removing model access from a user who already pays for it: the -m/--model flag was silently swallowed, and the newer-than-pinned version prompt defaulted to downgrading Claude Code below the newest models. This PR passes the user's --model straight through to Claude Code, stops setup from asking for/storing a model that never takes effect, makes codemie models list explain (not error) the subscription model source, and flips the newer-than-verified prompt so its default continues on the installed version — subscription-scoped; the minimum-version block is unchanged.

Ticket: EPMCDME-14341https://jiraeu.epam.com/browse/EPMCDME-14341

Changes

  • Model passthroughAgentCLI publishes the explicit --model as CODEMIE_CLI_MODEL (cleared first, so a stale shell value never leaks); the anthropic-subscription provider's enrichArgs injects --model into the claude binary (dedup-guarded). No --model → Claude Code's own default. The shared env pipeline is untouched, so API-key/SSO/Bedrock/LiteLLM/moonshot are unaffected.
  • Version pin — the newer-than-verified prompt defaults to continue on the installed version for subscription (newerVersionPromptDefault / olderSupportedModelNote); the older-but-supported prompt adds a "newer models may be unavailable" note and still offers the update; the below-minimum block is unchanged; proxied providers keep the tested install default.
  • Launch banner states the session model (or a per-session phrase) instead of unknown.
  • models list on a subscription profile prints where models come from and how to switch in-session (/model), exiting 0.
  • Setup no longer prompts for or stores a model; the success summary states the per-session choice.

Impact

Subscription users can now select and actually run the newest Claude models they're entitled to via codemie-claude --model <id>, and accepting the version prompt's default no longer strips newer models by downgrading the binary. No entitlement logic is added — Claude Code owns any refusal, CodeMie relays it.

Testing

  • Unit: 3969 passed. New tests: enrichArgs passthrough incl. dedup + --plugin-dir composition, version-prompt policy, launch-model-display, models-list message, setup summary, cli-model-env clear-before-set (incl. the shell-preset leak case), buildConfig('') → no model, and a moonshot-subscription isolation guard.
  • lint, typecheck, build, license-check, commitlint: green.
  • Integration guards proxy-routing-guard (subscription proxy bypass) and model-tier-e2e (non-subscription env pipeline): pass. The full test:integration (cli project) hangs locally on an unrelated subprocess/PTY test needing the live backend — CI runs it unconditionally.

Checklist

  • Self-reviewed (multi-lens code review; 3 findings fixed and re-verified)
  • Tests added and passing
  • No breaking changes (subscription-scoped; other providers unchanged)
  • Full CI integration suite (owed to CI)

🤖 Generated with Claude Code

SleepySML and others added 12 commits August 31, 2026 14:11
On an anthropic-subscription profile, AgentCLI records an explicit -m/--model
in CODEMIE_CLI_MODEL and the provider's enrichArgs injects it into the claude
binary args (dedup-guarded, never from the stored profile), so the user's model
choice reaches Claude Code instead of being blanked.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
…bscription

On an anthropic-subscription profile the newer-than-verified Claude Code prompt
now defaults to continuing on the installed version instead of installing the
older pinned one, and the older-but-supported prompt notes that newer models may
be unavailable. Proxied providers keep the tested 'install' default; the
minimum-version block is unchanged.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
The launch banner now shows the explicit --model on a subscription profile, or a
per-session phrase (instead of 'unknown') when none was passed, since CODEMIE_MODEL
is blanked for this provider. Other providers are unchanged.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
…f erroring

`codemie models list` on an anthropic-subscription profile now prints where models
come from (the user's Anthropic subscription + installed Claude Code) and how to
switch in-session with /model, exiting 0 instead of the "not supported" error.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
Anthropic Subscription setup no longer prompts for a model (which was pre-filled
with 'sonnet' and never took effect); it stores an empty model and the success
summary states the model is chosen per session by Claude Code and the user's
Anthropic subscription.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
Code review CR-001: setting CODEMIE_CLI_MODEL only when --model was passed let a
value already present in the environment (e.g. shell-exported) survive into a
no---model subscription launch and be injected as --model. Extract applyCliModelEnv,
which deletes the var first, so it reflects only this launch's explicit --model.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
…pty string

Code review CR-002: setup now passes an empty model for anthropic-subscription, but
buildConfig still stored model:'' — spec CS6 says store no model. Omit the field
when empty so the persisted profile has no model key (avoids an empty-string value
on a get->update round-trip). Adds the buildConfig-empty test (plan test item 5).

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
…ough

Code review CR-003 (plan test item 2): add a regression test asserting the
CODEMIE_CLI_MODEL passthrough stays anthropic-subscription only — moonshot wires no
claude enrichArgs and never injects --model even with CODEMIE_CLI_MODEL set.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
Spec, plan, technical analysis, complexity assessments, code-review verdicts,
QA report, and gate/decision ledgers for EPMCDME-14341.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
Manual edge-case check found the dedup guard missed the `--model=value` form
(reachable via raw passthrough, e.g. `-m X -- --model=Y`), which double-injected
--model. Match both `--model` and `--model=` before injecting.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
…ides

Knowledge-harvester: add an Anthropic Subscription Provider section to
external-integrations.md covering the no-stored-model behavior, the
CODEMIE_CLI_MODEL side-channel, and the subscription-scoped version-prompt
policy; add a Service Overview row.

Refs: EPMCDME-14341
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hbz7irf4enuYb3G5r3jdxi
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