Configurable App Server WebSocket port/endpoint to connect from VS Code to a Codex instance running inside a Dev Container (one container per worktree)
What variant of Codex are you using?
IDE Extension
What feature would you like to see?
Hi folks — I’m using Git worktrees heavily and I’m trying to set up a clean “one Dev Container per worktree” workflow.
What I want is to run codex app-server inside each Dev Container and have VS Code (ideally the Codex extension) connect to it over WebSocket using a configurable endpoint/port (via VS Code port forwarding). That way I can have multiple worktrees open at once without port collisions, and each worktree stays isolated (deps, sandbox, tooling).
I saw that the App Server supports WebSocket listening (e.g. --listen ws://0.0.0.0:PORT), but I couldn’t find a way to point the VS Code Codex client/extension at a custom App Server endpoint. It looks like it may assume a local/spawned server.
Questions:
- Is this already supported today? (Run App Server in a Dev Container and connect from the client/VS Code extension via a custom WS endpoint.)
- If it is: what’s the intended way to configure the endpoint (something like
ws://127.0.0.1:<forwarded-port>)? - If it isn’t: would you consider adding a setting to let the client/extension use a user-specified App Server endpoint (stdio vs ws, host/port)? That would make multi-worktree / multi-container setups much easier.
Example of what I’m aiming for:
- In each worktree container:
``bash``
codex app-server --listen ws://0.0.0.0:4500
- VS Code forwards that port to the host (and I can map 4500/4501/4502… per worktree).
- In the VS Code Codex settings, set something like:
codex.appServerEndpoint = ws://127.0.0.1:<forwarded-port>
Environment (if helpful):
- OS: Windows
Additional information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗