[codex] Isolate local Claude config per agent - #798
Draft
bradbrok wants to merge 3 commits into
Draft
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.
What
Refs #797 / task #221.
This adds a flag-gated per-agent
CLAUDE_CONFIG_DIRfor local Claude agents so one corrupt Claude config can wedge one agent instead of the whole local fleet.pinky_daemon.claude_confighelpers forresolve_agent_claude_config_dir(agent), Claude project slugs, trust/settings seeds, and one-time transcript migration._project_dir()/_has_prior_transcript(), SDK streamingoptions.env, tmux dream seeding/env, and SessionStart transcript-path validation.~/.claude/projects/<slug>to<agent>/.claude-config/projects/<slug>before tmux decides whether--continueis safe..claude.jsonwithhasCompletedOnboardingplus trust/bypass flags, and seededsettings.jsonwithskipDangerousModePermissionPromptfor fresh per-agent dirs.Guardrails
PINKY_PER_AGENT_CLAUDE_CONFIG.isolation_mode in ("", "local"); container and unix_user modes keep their provisioned config dirs.CLAUDE_CODE_OAUTH_TOKENat resolve time. If the static token is absent, the resolver skips the per-agent dir instead of silently booting into a login wall.CLAUDE_CONFIG_DIR.Evidence
Smoke screenshot showing the per-agent dir appears under
data/agents/smoke, transcript history migrates, onboarding/settings are seeded, and non-local modes are skipped:Terminal smoke text:
Validation
ruff check .pytest tests/test_claude_config.py tests/test_tmux_trust_seed.py tests/test_tmux_container_isolation.py tests/test_streaming_claude_config.py tests/test_tmux_dream_runner.py tests/test_api.py -q— 454 passedpytest tests/test_tmux_session.py tests/test_tmux_container_isolation.py tests/test_tmux_trust_seed.py tests/test_claude_config.py tests/test_streaming_claude_config.py tests/test_tmux_dream_runner.py -q— 384 passedpytest tests/test_claude_config.py tests/test_tmux_trust_seed.py tests/test_tmux_container_isolation.py tests/test_streaming_claude_config.py tests/test_tmux_dream_runner.py -q— 102 passedpytest tests/test_api.py::TestAPI::test_transcript_path_allows_flagged_per_agent_config_root tests/test_api.py::TestAPI::test_manual_dream_uses_full_persisted_conversation_history -q— 2 passedruff check src/pinky_daemon/claude_config.py tests/test_claude_config.pyandpytest tests/test_claude_config.py tests/test_tmux_container_isolation.py::TestProjectDir::test_local_agent_uses_per_agent_config_when_flagged -q— 8 passedNote: local API runs still emit existing FastAPI deprecation warnings and shared-MCP port-binding thread warnings on this workstation; the tests pass.