Skip to content

Conversation

@ethanndickson
Copy link
Member

Summary

Add devcontainer support for "Open in Editor" (VS Code/Cursor deep links) and "Terminal" (web terminal via PTY service). Previously, both features operated on the host instead of inside the devcontainer.

Background

Devcontainer workspaces need special handling:

  • Editor deep links require the VS Code dev-container+<hex_json> URI format with container name (not ID), host path, and container-relative target path
  • Terminal must spawn inside the container, not on the host

The devcontainer CLI only returns container IDs, but VS Code deep links require container names—so we query Docker directly using the devcontainer.local_folder label.

Implementation

Backend:

  • getDevcontainerContainerName() in devcontainerCli.ts - queries Docker for container name by workspace folder
  • workspace.getDevcontainerInfo API endpoint - returns { containerName, containerWorkspacePath, hostWorkspacePath }
  • PTY service devcontainer branch - spawns devcontainer exec --workspace-folder <path> -- /bin/sh

Frontend:

  • getDevcontainerDeepLink() in editorDeepLinks.ts - builds hex-encoded JSON config URI with path normalization
  • mapHostPathToContainerPath() in openInEditor.ts - converts host target paths to container paths
  • useOpenTerminal.ts - routes devcontainer to web terminal (like SSH/Docker)

Key decisions:

  • Discover container name on-demand (no persistence) - follows codebase patterns and handles container rebuilds
  • Use /bin/sh for PTY (not /bin/bash) - matches TerminalService and works with Alpine-based images
  • Explicit DevcontainerRuntime check before LocalBaseRuntime in PTY service - devcontainer extends local, so order matters

Risks

Low - isolated to devcontainer runtime paths with explicit type guards. Docker/SSH/local workflows unchanged.


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

@github-actions github-actions bot added the enhancement New feature or functionality label Jan 23, 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: 271d91794c

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

Add devcontainer support for Open in Editor (VS Code/Cursor deep links)
and Terminal (web terminal via PTY). Key changes:

- Add getDevcontainerContainerName() to query Docker for container name
- Add workspace.getDevcontainerInfo API endpoint returning container info
- Add getDevcontainerDeepLink() helper with path normalization
- Map host paths to container paths for correct deep link targets
- Route devcontainer terminals through PTY service (web terminal)

Devcontainer deep links use the vscode://vscode-remote/dev-container+<hex>/<path>
format. The hex-encoded JSON contains containerName, hostPath, and optionally
configFile. Container names are discovered on-demand via Docker labels.

Terminal spawning uses 'devcontainer exec --workspace-folder <path> -- /bin/sh'
to match the TerminalService pattern for container compatibility.
- PTY service: include --config for non-default devcontainer.json paths
- openInEditor: normalize backslashes for Windows path compatibility
- Fix lint error in test mock (use Promise.resolve instead of async)
@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: 4d4532cc20

ℹ️ 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: e0a4a960f2

ℹ️ 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: 4ce842d41e

ℹ️ 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. More of your lovely PRs please.

ℹ️ 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 ethanndickson added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 2f90614 Jan 26, 2026
23 checks passed
@ethanndickson ethanndickson deleted the devcontainer-d3v6 branch January 26, 2026 11:10
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