Skip to content

Ops/zhipu anthropic deploy#4004

Open
JDHK01 wants to merge 3 commits into
Wei-Shaw:mainfrom
JDHK01:ops/zhipu-anthropic-deploy
Open

Ops/zhipu anthropic deploy#4004
JDHK01 wants to merge 3 commits into
Wei-Shaw:mainfrom
JDHK01:ops/zhipu-anthropic-deploy

Conversation

@JDHK01

@JDHK01 JDHK01 commented Jul 10, 2026

Copy link
Copy Markdown

Summary

Adds an optional per-group Claude Code tier→model mapping so client configs generated from the admin UI work against
upstreams that don't natively understand Claude's claude-3-haiku/opus/sonnet names (e.g. Anthropic-compatible third-party
endpoints), without hardcoding any model names.

Admins set claude_code_default_models {haiku, sonnet, opus} on a group (Anthropic-platform section, mirroring the existing
OpenAI messages-dispatch UI). Non-empty tiers are emitted into:

  • "Use Key" modal — Terminal / CMD / PowerShell + VSCode settings.json, as ANTHROPIC_DEFAULT_*_MODEL
  • "Import to CCS" deeplink — as haikuModel/sonnetModel/opusModel (CC Switch V1 protocol)

Empty tiers are omitted, so upstreams that natively understand Claude model names (e.g. real Anthropic) need no
configuration. No model names are hardcoded — values come from the group config.

Changes

Backend: domain.ClaudeCodeDefaultModels; ent field + migration 174; service/handler/dto wiring incl. the user-side
key-list payload (so the modal reads it without an extra call).
Frontend: types + admin group form (anthropic-only) + i18n; UseKeyModal + ccswitchImport consume the field
dynamically.

Verification

  • go build ./... + go test ./internal/service/... ./internal/handler/... pass
  • vue-tsc + vite build pass; ccswitchImport unit tests cover no-mapping / full / partial
  • migration 174 auto-applied end-to-end, /health ok

Notes

  • Lives on the user-visible Group DTO (like allow_messages_dispatch) — key holders need it to configure their client;
    model names are not credentials.
  • Follows the exact pattern of the existing messages_dispatch_model_config field.

JDHK01 and others added 3 commits July 10, 2026 17:05
Add an optional per-group `claude_code_default_models {haiku, sonnet, opus}`
config so admins can remap Claude Code's Opus/Sonnet/Haiku tiers to the model
names a given upstream accepts. Non-empty tiers are emitted into the client
configs generated by the "Use Key" modal (Terminal/CMD/PowerShell + VSCode
settings.json, as ANTHROPIC_DEFAULT_*_MODEL) and the "Import to CCS" deeplink
(haikuModel/sonnetModel/opusModel, CC Switch V1 protocol). Empty tiers are
omitted, so upstreams that natively understand Claude model names (e.g. real
Anthropic) need no configuration — no model names are hardcoded anywhere.

Backend:
- domain.ClaudeCodeDefaultModels; ent field + migration 174
- service/handler/dto wiring, including the user-side key-list payload so the
  "Use Key" modal reads the mapping without an extra API call

Frontend:
- types + admin group form (anthropic-only section, mirrors the existing OpenAI
  messages-dispatch pattern) + i18n (en/zh)
- UseKeyModal + ccswitchImport consume group.claude_code_default_models
  dynamically; the previous hardcoded constant and its generator are removed

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA. ✅
Posted by the CLA Assistant Lite bot.

@JDHK01

JDHK01 commented Jul 10, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Jul 10, 2026
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