Skip to content

Seed CLAUDE_CODE_AUTO_MODE_SERVER=0 with claudeSetup - #165

Merged
D0n9X1n merged 1 commit into
mainfrom
feat/auto-mode-server-default
Oct 3, 2026
Merged

D0n9X1n merged 1 commit into
mainfrom
feat/auto-mode-server-default

Conversation

@D0n9X1n

@D0n9X1n D0n9X1n commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

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-completions or the 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 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 set CLAUDE_CODE_AUTO_MODE_SERVER=0.

With claudeSetup: true, applyClaudeConfig in src/lib/claude-settings.ts 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; 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: the claudeSetup comment names the variable.
  • Wiki:
    • wiki/EN-Configuration.md and wiki/ZH-Configuration.md: the variable in the list claudeSetup writes, why it is there, and when to remove it.
    • wiki/EN-Logging-Troubleshooting.md and wiki/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 typecheck
  • tests/unit/claude-settings.test.ts, tests/unit/code-style.test.ts and tests/unit/wiki-docs.test.ts: 53 tests, 52 pass, 1 skipped, 0 fail
  • npm run test:unit: 970 tests, 940 pass, 30 skipped, 0 fail
  • npm run test:integration: 401 tests, 401 pass, 0 fail
  • npm run build
  • Live: copilot-relay start built from this branch, with an isolated home and claudeSetup: true, logged claude settings created and wrote CLAUDE_CODE_AUTO_MODE_SERVER=0 into that home's .claude/settings.json, next to ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, CLAUDE_CODE_MAX_CONTEXT_TOKENS and CLAUDE_CODE_MAX_OUTPUT_TOKENS. The real ~/.claude/settings.json kept its modification time.
  • For [Feature]: Seed CLAUDE_CODE_AUTO_MODE_SERVER=0 with claudeSetup to stop the auto-mode notice through the relay #162, through a test relay: claude -p printed the notice by default and did not with CLAUDE_CODE_AUTO_MODE_SERVER=0; both runs gave the same answer.

Notes

  • Existing installs: the next copilot-relay start with claudeSetup: true adds the key, so ~/.claude/settings.json changes once.
  • Billing: for the tested sessions, which already fell back to client-side classification, the variable keeps that fallback and removes the notice. It does not enable no-charge server-side classification.
  • Temporary variable: Claude Code documents CLAUDE_CODE_AUTO_MODE_SERVER as temporary.
  • Overlap: [Feature]: Optional inbound API key (apiKey) for a relay bound beyond loopback #159 (apiKey) also changes applyClaudeConfig and the same Configuration section. Whichever merges second rebases.

Checklist

  • Public API remains Claude Code-only unless intentionally changed.
  • Config changes are reflected in config.default.yaml, README, and wiki/ (EN and ZH). No config key changes; config.default.yaml and the EN and ZH wiki pages describe the new seed. The README's line about ~/.claude/settings.json stays accurate.
  • Logs do not expose tokens.
  • Integration tests mock upstream Copilot; they do not call real Copilot services.

After merge

  • Remove inactive local/remote feature branches and temporary worktrees, prune stale refs, and report preserved work; follow the Development Wiki cleanup rules.
  • Confirm the publish-wiki.yml run succeeded and the new sections render on the live English and 中文 tabs.

🤖 Generated with Claude Code

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>
@D0n9X1n D0n9X1n added this to the v0.4.6 milestone Oct 3, 2026
@D0n9X1n D0n9X1n added enhancement New feature or request dev:windows Taken by the Windows development session labels Oct 3, 2026
@D0n9X1n
D0n9X1n merged commit fa7ffb8 into main Oct 3, 2026
6 checks passed
@D0n9X1n
D0n9X1n deleted the feat/auto-mode-server-default branch October 3, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev:windows Taken by the Windows development session enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Seed CLAUDE_CODE_AUTO_MODE_SERVER=0 with claudeSetup to stop the auto-mode notice through the relay

1 participant