🤖 fix: resolve Dev Container file-tool paths remotely - #3801
Open
alecsg77 wants to merge 1 commit into
Open
Conversation
Route tilde file-tool paths through the active runtime so Plan Mode uses the Dev Container user's home rather than the Mux host home. Validate that the remote Mux home is writable at runtime startup and cover the non-root user flow across reads and edits. --- _Generated with `mux` • Model: `openai:gpt-5.6-terra` • Thinking: `high` • Cost: `$0.29`_ <!-- mux-attribution: model=openai:gpt-5.6-terra thinking=high costs=0.29 -->
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.
Summary
Fixes Dev Container file tools expanding
~/.muxagainst the Mux host home before issuing container-side file I/O.Background
Plan Mode generated the expected tilde plan path, but the shared file-tool resolver normalized it synchronously through the host process. With a non-root Dev Container user, this could turn the path into the host user’s home and fail when the container attempted the write.
This follows the container-aware tilde-resolution intent established in #1809. The related workspace-mount report in #3709 is not an exact duplicate.
Implementation
Validation
bun test src/node/services/tools/fileCommon.test.ts src/node/services/tools/file_edit_insert.test.ts src/node/services/tools/file_edit_operation.test.ts src/node/services/tools/file_edit_replace.test.ts src/node/services/tools/file_read.test.ts src/node/runtime/DevcontainerRuntime.test.ts src/common/utils/planStorage.test.tsmake static-checknode:22-bookwormwithremoteUser: node, verifying read/write at/home/node/.mux/plans/e2e/remote-home.md.Risks
Low-to-moderate: the shared path helper is asynchronous for tilde paths, so each affected caller now awaits it. Regression coverage preserves local relative-path behavior and verifies that Dev Container tools do not leak the host home into remote file operations.
Generated with
mux• Model:openai:gpt-5.6-terra• Thinking:high• Cost:$0.31