Repository navigation
refactor(claude): write the session settings from Python instead of mkdir and tee - #1710
Merged
Merged
Conversation
…kdir and tee run_claude already runs as the sandbox user, so the subprocesses left over from the sudo era add nothing; the exclude write beside them was already plain Python. Also name the stderr log in the module docstring's account of what the supervisor copies back.
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.
run_claude.mainwrites.claude/settings.local.jsonby runningmkdir -pandteeas subprocesses. Its comments say the file is "written inside the sandbox so the agent can read it back" and that "teereceives the body through its own pipe". Both describe an earlier version that ran these commands assudo -u <sandbox>from the runner.run_claudenow runs inside the agent's systemd unit as the sandbox user, so the subprocesses do nothing a direct write doesn't. The.git/info/excludewrite next to them was already plain Python. This replaces them withPath.mkdirandPath.write_text, keeps the comment about why the exclude exists, and addstend-claude-stderr.logto the module docstring's account of what the outer supervisor copies back (launch_agent.export_resultscopies both files).There's no behavior change: same file, same contents, same user.
test_launch_writes_settings_inside_the_existing_sandboxnow reads the written file instead of checking theteeargv, so it checks the result rather than the mechanism. The full pytest run passes except the twotest_refresh_consumers.pytests, which need DNS the sandbox doesn't have (asAGENTS.mdnotes).