Skip to content

Conversation

@ethanndickson
Copy link
Member

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

Technical details

  • 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

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high • Cost: $99.54

@github-actions github-actions bot added the enhancement New feature or functionality label Jan 21, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Addressed both review items:

  • modeled runtime availability state and removed devcontainer-only disable; UI now treats unknown/failed availability as selectable
  • devcontainer tilde handling now uses $HOME expansion in exec paths; resolvePath leaves ~ unexpanded until home known; added tests

Static-check + unit test: bun test src/node/runtime/DevcontainerRuntime.test.ts

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Addressed both P2 issues from last review:

  1. resolvePath tilde probe: Now calls fetchRemoteHome() to probe $HOME via exec when tilde expansion is needed but container user is unknown. Throws RuntimeError if probe fails (aligns with resolvePath contract). This fixes movePlanFile and other callers that shell-quote the result.

  2. Config fallback for availability failure: When availability is loading/failed, shows a text input fallback with placeholder .devcontainer/devcontainer.json. resolveDevcontainerConfigPath() also defaults to this path when no selection exists and availability isn't loaded. Error message only appears when status === "failed".

Also removed the "do not visit other worktrees" warning from devcontainer system prompt (container only has single workspace mounted).

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

1 similar comment
@ethanndickson
Copy link
Member Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

@ethanndickson
Copy link
Member Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ 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".

Base automatically changed from devcontainer-runtime-wwwx to main January 23, 2026 01:15
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
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.
@ethanndickson ethanndickson added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit da15a66 Jan 23, 2026
22 checks passed
@ethanndickson ethanndickson deleted the devcontainer branch January 23, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant