Repository navigation
Sandboxed Claude keeps its login in a relay-owned config folder (#181) - #503
Merged
Merged
Conversation
…older Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Owner
Author
|
Verified: 80db98c · repo-suite: ok relaye2e/features 490.389s · devboxverify: SUMMARY pass=5 fail=0 blocked=0 notrun=2 (stack r181, --phase api) · real-app: PASS (relay sandbox claude-code; real Claude wrote into the new folder, links seeded, no credentials file) · log: devbox:/tmp/r181-stack.log |
Owner
Author
|
Merged under merge-check: approved, target, verified, contract, evidence, owner and weakening PASS; ci NA. |
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.
Closes #181
Sandboxed Claude launches (a
claudesession and a sandboxedclaude-codeterminal) now run withCLAUDE_CONFIG_DIRset to a relay-owned folder,<user config dir>/relay/sandbox-claude. The profile grants that folder read-write, so Claude Code keeps and refreshes its login there instead of hitting the keychain write the sandbox refuses. Unsandboxed and SSH-host launches are unchanged. A key the template'senvsets still wins.Relay creates the folder at launch, mode 0700, and seeds it with links to
~/.claude'ssettings.json,CLAUDE.md,skills,agents,commands,projectsandsessions. It never links.credentials.jsonor.claude.json, and never overwrites an entry that is already there. A path that isn't a real directory refuses the launch withsandbox_unavailable, and the message names the path. The keychain grants are unchanged.What you'll notice: every sandboxed Claude is logged out once. Run
/loginonce in any sandboxed Claude. The folder is shared, so that one login covers Relay.app, every verify stack and the nightly. The folder does not move with--config-dir. Until that login, the nightly's five sandboxed-Claude screen journeys (session-agent-state,session-drop-in,session-drop-in-tool-refused,chief-of-staff-send,cos-start) fail. That is a known limitation, not a regression in this code.Not proven here, by owner decision: a live
/loginin the sandbox and a refresh past the 8-hour token lifetime. The owner verifies those through daily use.Roll back: revert this PR's merge commit. Sandboxed Claude then reads the keychain login again. The folder can stay or be deleted by hand.
Docs:
docs/session-host.md(new subsection and grant row),docs/FEATURES.mdrowG1.44,docs/testing.md.Fix attempts: 1 (plus one comment-only round from review). Tokens: about 0.6M across subagents.
Review: no blocking findings (default model, round 1; two comment nits fixed in 80db98c; two theoretical items logged in the run report)
Red on main: TestBug181SandboxedClaudeSessionConfigDir fails on main 448d6e1 at bug181_sandboxed_claude_login_test.go:91 (CLAUDE_CONFIG_DIR = ""); TestBug181SandboxClaudeDirSeeded fails at :179 (folder missing)
Real-app check:
relay sandbox claude-codeon the head's bundle (stack r181) started a real sandboxed Claude, which wrote.claude.json, cache and backups into the new folder; links seeded, no credentials file; before (main): no such folder, CLAUDE_CONFIG_DIR unsetJourney: n/a: the change is reached only by a logged-in sandboxed Claude, which the nightly's existing screen journeys cover; the stack's api phase ran unchanged (pass=5 fail=0 blocked=0 notrun=2)
Break-and-restore: dropped the folder's read-write grant in sandboxSpecForLaunch; TestBug181SandboxClaudeDirWritable went red (write inside the folder exit 1); restored byte for byte
Run report: barelyworkingcode/claude-process#55
🤖 Generated with Claude Code