Skip to content

chore: add claude-opus-4-7 to claudecode DefaultModels#1733

Merged
looplj merged 1 commit into
looplj:unstablefrom
qinkangdeid:fix/claudecode-default-models-add-opus-4-7
May 28, 2026
Merged

chore: add claude-opus-4-7 to claudecode DefaultModels#1733
looplj merged 1 commit into
looplj:unstablefrom
qinkangdeid:fix/claudecode-default-models-add-opus-4-7

Conversation

@qinkangdeid

Copy link
Copy Markdown
Contributor

Claude Code 2.x lists claude-opus-4-7 as a first-class model, but claudecode.DefaultModels() still tops out at claude-opus-4-6 / claude-sonnet-4-6.

Because FetchModels short-circuits on OAuth claudecode channels and returns this hardcoded list (internal/server/biz/model_fetcher.gogetDefaultModelsByType(TypeClaudecode)), the UI cannot surface 4-7 on a Claude MAX channel. The orchestrator route table then rejects requests for that model with 422 model not found: claude-opus-4-7.

Change: one-line addition to llm/transformer/anthropic/claudecode/constants.go's DefaultModels(), same shape as #1605 (gpt-5.5 for codex) and #1006 (gpt-5.4).

Tested locally: with this change, a Claude MAX OAuth channel whose supportedModels picks up claude-opus-4-7 from FetchModels returns HTTP 200 from api.anthropic.com/v1/messages when Claude Code clients request claude-opus-4-7.

Reference

Claude Code 2.x ships claude-opus-4-7 as a first-class model, but
`claudecode.DefaultModels()` still tops out at 4-6 / sonnet-4-6. As a
result, channels of type `claudecode` (Claude MAX OAuth) cannot expose
4-7 via the UI's FetchModels probe — supportedModels never gets the new
entry, so the orchestrator route table rejects requests with HTTP 422
`model not found: claude-opus-4-7`.

Same one-line shape as looplj#1605 (gpt-5.5 for codex) and looplj#1006 (gpt-5.4).

**Tested locally**: with this change, a Claude MAX OAuth channel whose
supportedModels gets claude-opus-4-7 from FetchModels returns HTTP 200
from api.anthropic.com/v1/messages when claude code clients request
claude-opus-4-7.
@qinkangdeid

Copy link
Copy Markdown
Contributor Author

End-to-end verified after manually appending claude-opus-4-7 to a Claude MAX OAuth channel's supportedModels:

$ curl -sS -X POST https://<axonhub>/anthropic/v1/messages \
    -H 'x-api-key: <key>' \
    -H 'anthropic-version: 2023-06-01' \
    -H 'content-type: application/json' \
    -d '{"model":"claude-opus-4-7","max_tokens":50,"messages":[{"role":"user","content":"reply with the single word: pong"}]}'

HTTP 200, 1.6s
{
  "id": "msg_01FP2EX5APhWxvSC3eh2Np8Y",
  "type": "message", "role": "assistant",
  "content": [{"type": "text", "text": "pong"}],
  "model": "claude-opus-4-7",
  "stop_reason": "end_turn",
  ...
}

So the route works end-to-end against api.anthropic.com on the OAuth/MAX path; the only thing missing in unstable is the FetchModels short-circuit list, which this PR fixes so new claudecode channels pick up 4-7 without manual supportedModels patching.

@greptile-apps

greptile-apps Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds claude-opus-4-7 to the hardcoded DefaultModels() list in the Claude Code transformer, which is the static list returned by FetchModels for OAuth/MAX channels that cannot hit the live Anthropic models endpoint.

  • Adds a single entry \"claude-opus-4-7\" to claudecode.DefaultModels(), consistent in shape with the existing claude-opus-4-6 and claude-sonnet-4-6 entries (no date suffix).
  • The model ID already exists in frontend/src/features/models/data/providers.json, so the UI metadata is already in place; this change wires the backend model-fetch path to surface it for Claude Code channels.

Confidence Score: 5/5

Safe to merge — one-line addition to a static list with no logic changes.

The change is a single string appended to a hardcoded slice. The model ID matches what's already registered in providers.json, the surrounding list follows the same dateless-suffix convention used for 4-6 models, and there are no control-flow, auth, or data-path changes involved.

No files require special attention.

Important Files Changed

Filename Overview
llm/transformer/anthropic/claudecode/constants.go Adds claude-opus-4-7 to the hardcoded DefaultModels() list; follows the same pattern as the existing claude-opus-4-6 / claude-sonnet-4-6 entries and the model ID already exists in providers.json.

Sequence Diagram

sequenceDiagram
    participant CC as Claude Code Client
    participant AH as AxonHub Orchestrator
    participant MF as ModelFetcher (biz)
    participant DM as DefaultModels()
    participant API as api.anthropic.com

    CC->>AH: Request models list (OAuth/MAX channel)
    AH->>MF: FetchModels(TypeClaudecode)
    MF->>MF: tryReturnDefaultModels()
    MF->>DM: claudecode.DefaultModels()
    DM-->>MF: [..., "claude-opus-4-6", "claude-sonnet-4-6", "claude-opus-4-7"]
    MF-->>AH: ModelIdentify list
    AH-->>CC: supportedModels includes claude-opus-4-7

    CC->>AH: POST /v1/messages (model: claude-opus-4-7)
    AH->>AH: Route lookup — model found
    AH->>API: Proxy request
    API-->>AH: 200 OK
    AH-->>CC: 200 OK
Loading

Reviews (1): Last reviewed commit: "chore: add claude-opus-4-7 to claudecode..." | Re-trigger Greptile

@looplj looplj merged commit d52aa26 into looplj:unstable May 28, 2026
4 checks passed
ldm0206 added a commit to ldm2060/axonhub that referenced this pull request May 29, 2026
…ge title config, request filter preservation, structured response items

Upstream commits merged:
- fix: model settings dialog overflow (looplj#1716)
- chore: custom page title config after login (looplj#1720)
- feat: preserve request log filters on detail navigation (looplj#1723)
- feat(llm): support responses websocket sessions (looplj#1730)
- chore: add claude-opus-4-7 to claudecode DefaultModels (looplj#1733)
- fix(channels): show real i18n label for single-variant types (looplj#1734)
- fix(llm): accept structured response item arguments (looplj#1728)

Resolved 4 import-path conflicts (looplj -> ldm2060) and adapted
session scope integration in auth middleware. Fixed Windows flaky
WebSocket test for platform-specific socket error messages.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
junjiangao pushed a commit to junjiangao/axonhub that referenced this pull request May 30, 2026
Claude Code 2.x ships claude-opus-4-7 as a first-class model, but
`claudecode.DefaultModels()` still tops out at 4-6 / sonnet-4-6. As a
result, channels of type `claudecode` (Claude MAX OAuth) cannot expose
4-7 via the UI's FetchModels probe — supportedModels never gets the new
entry, so the orchestrator route table rejects requests with HTTP 422
`model not found: claude-opus-4-7`.

Same one-line shape as looplj#1605 (gpt-5.5 for codex) and looplj#1006 (gpt-5.4).

**Tested locally**: with this change, a Claude MAX OAuth channel whose
supportedModels gets claude-opus-4-7 from FetchModels returns HTTP 200
from api.anthropic.com/v1/messages when claude code clients request
claude-opus-4-7.

Co-authored-by: qinkangdeid <qinkangdeid@gmail.com>
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.

2 participants