Skip to content

Conversation

@wonderyl
Copy link

Without this PR claude-sonnet-4-5-20250929 will be translated to claude-sonnet-4 instead.

@caozhiyuan
Copy link
Contributor

@wonderyl config claude code settings.json like this

    "ANTHROPIC_BASE_URL": "http://localhost:4141",
    "ANTHROPIC_AUTH_TOKEN": "dummy",
    "ANTHROPIC_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "gpt-5.2",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "gpt-5-mini",
    "CLAUDE_CODE_SUBAGENT_MODEL": "gpt-5-mini",
    "DISABLE_NON_ESSENTIAL_MODEL_CALLS": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "BASH_MAX_TIMEOUT_MS": "600000",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "SHELLOPTS": "braceexpand",
    "CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION": "false"

@wonderyl
Copy link
Author

I don't want to use gpt models.
I have the following envs, but Claude still uses dated model sometimes.

    "ANTHROPIC_MODEL": "claude-sonnet-4.5",
    "ANTHRIPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.5",
    "ANTHROPIC_SMALL_FAST_MODEL": "claude-haiku-4.5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5",

@caozhiyuan
Copy link
Contributor

caozhiyuan commented Jan 26, 2026

@wonderyl You can additionally add ANTHROPIC_DEFAULT_OPUS_MODEL and CLAUDE_CODE_SUBAGENT_MODEL.

Claude Code will aggressively use HAIKU_MODEL and CLAUDE_CODE_SUBAGENT_MODEL in the background, causing your quota to deplete quickly.

Each time bash is called, HAIKU_MODEL is used to check whether the split script poses any risk. Complex scripts may be divided into many smaller scripts, resulting in multiple calls to HAIKU_MODEL. Some versions of claude code make two warmup calls each time they are opened. Additionally, certain tasks involving summarizing topics also use HAIKU_MODEL.

@wonderyl
Copy link
Author

Thanks for the advice @caozhiyuan. But I failed to understand how this is relevant to my PR.
My change was attempting to correct how model is parsed when it's in the format of claude-sonnet-4-5-20250929. Currently instead of using 4.5. it will use 4 instead.

@caozhiyuan
Copy link
Contributor

caozhiyuan commented Jan 27, 2026

@wonderyl Just suggest that you configure the model yourself. This way, you'll understand the role of each model.
That piece of code was previously only for compatibility with subagent model names, as the older version of Claude Code couldn't define the model name through environment variables. Now, that piece of code is actually unnecessary.

@caozhiyuan
Copy link
Contributor

@wonderyl You can use this branch: https://github.com/caozhiyuan/copilot-api/tree/feature/all, which contains many advanced features. The master branch hasn't been maintained for a long time.

@caozhiyuan
Copy link
Contributor

caozhiyuan commented Jan 27, 2026

Currently, for complex tasks: gpt-5.2 thinking high is stronger than opus 4.5.

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