Repository navigation
Seed CLAUDE_CODE_AUTO_MODE_SERVER=0 with claudeSetup - #165
Merged
Merged
Conversation
In auto mode Claude Code asks the server to check actions. Through the relay those checks did not reach it on the chat-completions or messages route, so it made its own classifier requests and printed a notice that the session isn't eligible for auto mode's no-charge classifier requests. An interactive session holds the first checked action until the notice is answered. applyClaudeConfig now seeds CLAUDE_CODE_AUTO_MODE_SERVER=0 when the key is absent from Claude Code's settings, as it does for the token budgets; a value already there is kept. With 0, Claude Code skips the server check and the notice, and its classifier requests stay as they were. The Configuration and troubleshooting pages say when to remove it. Closes #162 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #162.
In auto mode, Claude Code 2.1.288 asks the server to check actions such as shell commands. Through the relay those checks did not reach Claude Code on the
chat-completionsor themessagesroute, so it made its own classifier requests and printed a notice that the session isn't eligible for auto mode's no-charge classifier requests. An interactive session holds the first action it would check until the notice is answered. For a gateway that cannot provide the server's checks, Claude Code's documentation says to setCLAUDE_CODE_AUTO_MODE_SERVER=0.With
claudeSetup: true,applyClaudeConfiginsrc/lib/claude-settings.tsnow seedsCLAUDE_CODE_AUTO_MODE_SERVER=0when the key is absent from Claude Code's settings, as it does for the token budgets. A value already there is kept. With0, Claude Code skips the server check and the notice; its classifier requests stay as they were.Changes:
src/lib/claude-settings.ts: the seed.tests/unit/claude-settings.test.ts: the key is written when absent, and a second run changes nothing; an existing"0"or"1"is kept.config.default.yaml: theclaudeSetupcomment names the variable.wiki/EN-Configuration.mdandwiki/ZH-Configuration.md: the variable in the listclaudeSetupwrites, why it is there, and when to remove it.wiki/EN-Logging-Troubleshooting.mdandwiki/ZH-Logging-Troubleshooting.md: its expected value, and a section for the notice.Scope
The Claude Code settings written at startup. No route, request or log line changes.
Validation
At 00e2a27:
npm run typechecktests/unit/claude-settings.test.ts,tests/unit/code-style.test.tsandtests/unit/wiki-docs.test.ts: 53 tests, 52 pass, 1 skipped, 0 failnpm run test:unit: 970 tests, 940 pass, 30 skipped, 0 failnpm run test:integration: 401 tests, 401 pass, 0 failnpm run buildcopilot-relay startbuilt from this branch, with an isolated home andclaudeSetup: true, loggedclaude settings createdand wroteCLAUDE_CODE_AUTO_MODE_SERVER=0into that home's.claude/settings.json, next toANTHROPIC_BASE_URL,ANTHROPIC_AUTH_TOKEN,CLAUDE_CODE_MAX_CONTEXT_TOKENSandCLAUDE_CODE_MAX_OUTPUT_TOKENS. The real~/.claude/settings.jsonkept its modification time.claude -pprinted the notice by default and did not withCLAUDE_CODE_AUTO_MODE_SERVER=0; both runs gave the same answer.Notes
copilot-relay startwithclaudeSetup: trueadds the key, so~/.claude/settings.jsonchanges once.CLAUDE_CODE_AUTO_MODE_SERVERas temporary.apiKey) also changesapplyClaudeConfigand the same Configuration section. Whichever merges second rebases.Checklist
config.default.yaml, README, andwiki/(EN and ZH). No config key changes;config.default.yamland the EN and ZH wiki pages describe the new seed. The README's line about~/.claude/settings.jsonstays accurate.After merge
publish-wiki.ymlrun succeeded and the new sections render on the live English and 中文 tabs.🤖 Generated with Claude Code