fix: Pre-seed Claude Code config to fix silent auth failure in sandbox#1
Open
fix: Pre-seed Claude Code config to fix silent auth failure in sandbox#1
Conversation
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.
Problem
When running Claude Code 2.1.37 (current stable) in
--printmode via the sandbox agent bridge, Claude Code exits withrc=0and empty stdout/stderr — no API calls are made through the bridge. Withattemptsset to unlimited, the retry loop spins for dozens of iterations.What was observed
curl POST /v1/messagesfrom inside the container returns a valid Anthropic API response.claude --versionandclaude --helpboth succeed.claude --print -- "Say hello"exits in <1 second withrc=0and zero output, despiteANTHROPIC_AUTH_TOKENbeing set in the environment.~/.claude/debug/latest) shows:Change
Before running Claude Code, write
~/.claude/settings.jsonwith anapiKeyHelperthat echoes the dummy API key fromANTHROPIC_AUTH_TOKEN. Claude Code then authenticates and makes API calls through the bridge on the first attempt.Tested with Claude Code 2.1.37 on K8s sandbox (non-centaur path).