-
Notifications
You must be signed in to change notification settings - Fork 45
🤖 feat: devcontainer deep link + terminal support #1871
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: 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.
271d917 to
15f2829
Compare
- 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)
|
@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: 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".
|
@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: 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".
|
@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: 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ 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". |
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:
dev-container+<hex_json>URI format with container name (not ID), host path, and container-relative target pathThe devcontainer CLI only returns container IDs, but VS Code deep links require container names—so we query Docker directly using the
devcontainer.local_folderlabel.Implementation
Backend:
getDevcontainerContainerName()indevcontainerCli.ts- queries Docker for container name by workspace folderworkspace.getDevcontainerInfoAPI endpoint - returns{ containerName, containerWorkspacePath, hostWorkspacePath }devcontainer exec --workspace-folder <path> -- /bin/shFrontend:
getDevcontainerDeepLink()ineditorDeepLinks.ts- builds hex-encoded JSON config URI with path normalizationmapHostPathToContainerPath()inopenInEditor.ts- converts host target paths to container pathsuseOpenTerminal.ts- routes devcontainer to web terminal (like SSH/Docker)Key decisions:
/bin/shfor PTY (not/bin/bash) - matches TerminalService and works with Alpine-based imagesDevcontainerRuntimecheck beforeLocalBaseRuntimein PTY service - devcontainer extends local, so order mattersRisks
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