-
Notifications
You must be signed in to change notification settings - Fork 46
🤖 feat: devcontainer runtime support #1809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 688aafa92d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e88dfdc5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a591cf6bd9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa425bb021
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f2ed693f8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f678d76e24
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Addressed both review items:
Static-check + unit test: bun test src/node/runtime/DevcontainerRuntime.test.ts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e35a2c39a9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review Addressed both P2 issues from last review:
Also removed the "do not visit other worktrees" warning from devcontainer system prompt (container only has single workspace mounted). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cbb5cab43
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c008436068
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b2382878f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f3719c161
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4a62e7faf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Add devcontainer runtime mode that uses the devcontainer CLI to build and run workspaces from project devcontainer.json configurations. Key changes: - DevcontainerRuntime: new runtime that wraps devcontainer CLI - devcontainerCli.ts: CLI wrapper for up/exec/down with JSON log parsing - devcontainerConfigs.ts: scan and select devcontainer.json configs - credentialForwarding.ts: shared credential mount logic (Docker/devcontainer) - UI: runtime selector with config dropdown, "Dev container" label - Treat all devcontainer up failures as runtime_not_ready (delete/recreate) - Parse JSON logs from both stdout and stderr (CLI emits on stderr) - Override resolvePath to expand ~ inside container, not host - Cross-platform process cleanup using killProcessTree
- Remove unused import DevcontainerConfigInfoSchema - Change type to interface in DevcontainerRuntime.test.ts - Prefix unused interface with underscore (_DevcontainerLogLine) - Fix redundant unknown type in parseJsonLine - Use nullish coalescing assignment (??=) - Hoist abortHandler to const and restructure - Wrap DevcontainerUnavailable assertion in waitFor
- Use Config.srcDir for devcontainer worktrees (honors MUX_ROOT/dev mode) - Normalize Windows paths in mapHostPathToContainer (cross-platform cwd) - Add unit tests for Windows path normalization - Hide Dev container in NonGitRepository stories (no config found)
- Shell-quote workspace and config paths in terminal command (P2) - Disable Dev container button until availability loads (P3)
- Add resolveContainerCwd() to filter unmappable host paths (P2) - Reject Windows drive letters and backslash paths in container cwd - Fall back to remoteWorkspaceFolder when cwd cannot be mapped - Add unit tests for container cwd resolution
Fixes P2: DevcontainerRuntime.exec throws when currentWorkspacePath is unset, breaking agent discovery and other pre-ensureReady file reads. - Add createRuntimeForWorkspace helper (src/node/runtime/runtimeHelpers.ts) that ensures workspaceName is always passed to createRuntime - Update call sites: resolveAgentDiscoveryContext, getPlanContent, getTrackedFiles, deletePlanFilesForWorkspace Now DevcontainerRuntime can map container paths to host worktree paths, avoiding the exec fallback for file reads before the container is ready.
Fixes two P2 issues from Codex review:
1. Require workspaceName when creating devcontainer runtimes
- exec() throws if currentWorkspacePath unset, but several call sites
built runtimes with only projectPath (post-compaction attachments,
file @mentions, MCP overrides)
- Updated agentSession.ts (3 sites) and workspaceMcpOverridesService.ts
to use createRuntimeForWorkspace helper
2. Expand ~ before devcontainer file ops
- statViaExec/readFileViaExec/writeFileViaExec used shell quoting that
prevented tilde expansion, so ~/.mux/... paths failed
- Added expandTildeForContainer() helper, called by *ViaExec methods
and resolvePath() to avoid logic duplication
Fix two issues identified by Codex review: 1. resolvePath() now probes $HOME via exec when tilde expansion is needed but container user is unknown, instead of returning raw '~' which breaks shell quoting in callers like movePlanFile(). 2. When runtime availability fails to load, show a text input fallback for devcontainer config path with default .devcontainer/devcontainer.json, so first-time users can still create workspaces during transient failures. Also removes the 'do not visit other worktrees' warning from devcontainer system prompt since the container only has access to a single workspace. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high` • Cost: `$5.52`_
Add devcontainerSelection.ts resolver to unify config selection rules: - P2 fix: no implicit default while availability is loading - Failed state: safe default to .devcontainer/devcontainer.json - Loaded state: dropdown with first config or preserve valid selection - No configs: input mode requiring explicit path Refactored CreationControls and useCreationWorkspace to use the centralized resolver, eliminating ad-hoc branching and ensuring UI + creation logic stay in sync. Includes 11 unit tests covering all edge cases. --- _Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high` • Cost: `$13.50`_
- Remove unused ParsedRuntime import from devcontainerSelection.test.ts - Fix type assertion style (as unknown as never instead of as never) - Add eslint-disable for await-thenable in DevcontainerRuntime.test.ts (bun:test expect().rejects requires await)
Normalize separator handling in resolveHostPathForMounted so Windows backslash paths match the workspace prefix check and avoid falling back to container mapping. Add a focused unit test to cover the Windows path case. --- _Generated with `mux` • Model: `openai:gpt-5.2-codex` • Thinking: `high` • Cost: `$15.15`_
Restore original behavior: hide devcontainer option when no config found.
- TaskService.create: use createRuntimeForWorkspace so devcontainer stat/readFile work during agent definition discovery - TaskService.maybeStartQueuedTasks: use createRuntimeForWorkspace so runtime.stat(workspacePath) works for devcontainer tasks - WorkspaceService.getFileCompletions: use createRuntimeForWorkspace so execBuffered (git ls-files) works for devcontainer workspaces - devcontainerSelection: hide devcontainer option entirely when no configs found (removes unreachable manual path input flow) - hooks.test.ts: tolerate wc -c whitespace padding in stderr output
7143e30 to
60246cc
Compare
Devcontainer CLI outputs progress messages to stderr (reserving stdout for JSON results). These parsed log lines are informational, not errors, so send them to logStdout() so they render as normal text in InitMessage.
Add devcontainer runtime mode that uses the devcontainer CLI to build and run workspaces from project devcontainer.json configurations.
Key changes
Technical details
devcontainer upfailures asruntime_not_ready(delete/recreate)resolvePathto expand~inside container, not hostkillProcessTreeGenerated with
mux• Model:anthropic:claude-opus-4-5• Thinking:high• Cost:$99.54