Skip to content

🤖 fix: resolve Dev Container file-tool paths remotely - #3801

Open
alecsg77 wants to merge 1 commit into
coder:mainfrom
alecsg77:fix/devcontainer-remote-home
Open

🤖 fix: resolve Dev Container file-tool paths remotely#3801
alecsg77 wants to merge 1 commit into
coder:mainfrom
alecsg77:fix/devcontainer-remote-home

Conversation

@alecsg77

@alecsg77 alecsg77 commented Aug 5, 2026

Copy link
Copy Markdown

Summary

Fixes Dev Container file tools expanding ~/.mux against 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

  • Resolve tilde file-tool paths through the active runtime asynchronously; ordinary relative and absolute paths retain the existing normalization behavior.
  • Apply the shared resolver to reads, inserts, replacements, and attachment path reads.
  • Check that the Dev Container Mux home is writable after startup/restart, with an actionable diagnostic that does not disclose the runtime username or absolute home path.
  • Add non-root remote-user regression coverage across plan reads and edits.
  • Use neutral test fixtures; no project or workspace identifiers from the original report are included.

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.ts
  • make static-check
  • Real Dev Container smoke test using node:22-bookworm with remoteUser: 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

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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant