Files
cc-switch/tests/config/claudeKeyFields.json
Sailing Loong cf567ca648 fix(claude): project CLAUDE_CODE_AUTO_MODE_SERVER from provider env into settings.json (#7893)
Claude Code 2.1.281 added a server-side auto mode classifier that only
works on official endpoints. Sessions routed through a gateway (or the
built-in proxy) get a blocking notice unless CLAUDE_CODE_AUTO_MODE_SERVER
is set to 0 — the officially documented compatibility option for proxies
and gateways. Providers carry that key in their env row, but the live
projection only writes floor (connection/auth/model) and exclusive
(compat switch) keys, so it never reached settings.json and the notice
kept coming back after every switch.

Classify it as a provider-exclusive env key: it is written on switch-in
and removed on switch-out only when the value is unchanged, so users can
still set it globally on their own. The frontend preset-scan mirror
(tests/config/claudeKeyFields.json) is updated in lockstep; the mirror
test keeps both sides honest.

Fixes #7891
2026-10-06 09:06:09 +08:00

56 lines
1.6 KiB
JSON

{
"envPrefixes": ["ANTHROPIC_", "AWS_", "VERTEX_REGION_"],
"envKeys": [
"CLAUDE_CODE_SUBAGENT_MODEL",
"CLAUDE_CODE_SUBAGENT_MODEL_FORCE",
"CLOUD_ML_REGION",
"GOOGLE_APPLICATION_CREDENTIALS",
"CLAUDE_CODE_OAUTH_TOKEN",
"CLAUDE_CODE_OAUTH_REFRESH_TOKEN",
"CLAUDE_CODE_OAUTH_SCOPES",
"CLAUDE_CODE_API_KEY_HELPER_TTL_MS"
],
"envSkipAuth": { "prefix": "CLAUDE_CODE_SKIP_", "suffix": "_AUTH" },
"protocolSelectors": [
"CLAUDE_CODE_USE_BEDROCK",
"CLAUDE_CODE_USE_VERTEX",
"CLAUDE_CODE_USE_FOUNDRY",
"CLAUDE_CODE_USE_GATEWAY",
"CLAUDE_CODE_USE_MANTLE",
"CLAUDE_CODE_USE_ANTHROPIC_AWS",
"CLAUDE_CODE_USE_ANTHROPIC_GOOGLE_CLOUD"
],
"top": [
"apiKeyHelper",
"apiBaseUrl",
"primaryModel",
"smallFastModel",
"apiKey",
"model",
"fallbackModel",
"modelOverrides",
"modelPicker",
"advisorModel",
"awsAuthRefresh",
"awsCredentialExport",
"gcpAuthRefresh"
],
"exclusiveEnv": [
"CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS",
"CLAUDE_CODE_DISABLE_ARTIFACT",
"ENABLE_TOOL_SEARCH",
"CLAUDE_CODE_DISABLE_THINKING",
"DISABLE_INTERLEAVED_THINKING",
"CLAUDE_CODE_ALWAYS_ENABLE_EFFORT",
"CLAUDE_CODE_EXTRA_BODY",
"CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING",
"CLAUDE_CODE_AUTO_MODE_SERVER",
"CLAUDE_CODE_MAX_CONTEXT_TOKENS",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW",
"CLAUDE_CODE_MAX_OUTPUT_TOKENS",
"CLAUDE_CODE_DISABLE_1M_CONTEXT",
"CLAUDE_CODE_DISABLE_UNKNOWN_MODEL_WINDOW_ENFORCEMENT",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY"
]
}