Summary
Deploy a standalone, externally-hosted OCT server, authenticate it against Coder's (experimental) OAuth2 provider using OCT's generic-OAuth env vars, and figure out how to auto-start/join a session per-workspace.
Part 1: Deploy OCT server (outside Coder)
Run the official oct-server-dev container as its own long-lived service — not spun up per workspace, since it's single-instance/in-memory.
Part 2: Coder OAuth setup
- Enable Coder's OAuth2 provider:
coder server --experiments oauth2 (or CODER_EXPERIMENTS=oauth2). Note: experimental/unstable per Coder's own docs — fine for a dev-rel internal tool, not something to depend on for anything critical yet.
- Register OCT as an app:
POST $CODER_URL/api/v2/oauth2-provider/apps with a name + callback URL, then generate a client secret via POST .../apps/$APP_ID/secrets.
- Configure the OCT server with generic-OAuth env vars:
OCT_OAUTH_CLIENTID / OCT_OAUTH_CLIENTSECRET — from step 2
OCT_OAUTH_URL — your Coder base URL
OCT_OAUTH_TOKEN_URL — $CODER_URL/oauth2/tokens
OCT_OAUTH_USERINFO_URL — $CODER_URL/api/v2/users/me
OCT_OAUTH_USERNAMECLAIM / OCT_OAUTH_EMAILCLAIM — map to whatever fields Coder's /users/me response actually returns (needs checking against the real payload)
OCT_OAUTH_CLIENTLABEL — e.g. "Coder"
- Spike before committing: confirm OCT's code-flow client actually sends
code_challenge/PKCE — Coder will hard-reject the authorization request otherwise. If it doesn't, this may need a small patch upstream to OCT or a wrapper proxy in front of Coder's OAuth endpoint.
Part 3: Auto-starting a session — still open
No documented headless/CLI session API. Before building a Coder module around this, check whether the extension exposes scriptable VS Code commands, or whether there's a lower-level session API in the client packages. If neither exists, may be worth a feature request upstream.
Known non-goals (confirmed limitations)
- No terminal/port sharing — blocked by a still-proposed VS Code API, no OCT workaround exists.
- No plan to reverse-engineer Live Share — its relay protocol is proprietary and closed-source; not a realistic path.
References
Summary
Deploy a standalone, externally-hosted OCT server, authenticate it against Coder's (experimental) OAuth2 provider using OCT's generic-OAuth env vars, and figure out how to auto-start/join a session per-workspace.
Part 1: Deploy OCT server (outside Coder)
Run the official
oct-server-devcontainer as its own long-lived service — not spun up per workspace, since it's single-instance/in-memory.Part 2: Coder OAuth setup
coder server --experiments oauth2(orCODER_EXPERIMENTS=oauth2). Note: experimental/unstable per Coder's own docs — fine for a dev-rel internal tool, not something to depend on for anything critical yet.POST $CODER_URL/api/v2/oauth2-provider/appswith a name + callback URL, then generate a client secret viaPOST .../apps/$APP_ID/secrets.OCT_OAUTH_CLIENTID/OCT_OAUTH_CLIENTSECRET— from step 2OCT_OAUTH_URL— your Coder base URLOCT_OAUTH_TOKEN_URL—$CODER_URL/oauth2/tokensOCT_OAUTH_USERINFO_URL—$CODER_URL/api/v2/users/meOCT_OAUTH_USERNAMECLAIM/OCT_OAUTH_EMAILCLAIM— map to whatever fields Coder's/users/meresponse actually returns (needs checking against the real payload)OCT_OAUTH_CLIENTLABEL— e.g. "Coder"code_challenge/PKCE — Coder will hard-reject the authorization request otherwise. If it doesn't, this may need a small patch upstream to OCT or a wrapper proxy in front of Coder's OAuth endpoint.Part 3: Auto-starting a session — still open
No documented headless/CLI session API. Before building a Coder module around this, check whether the extension exposes scriptable VS Code commands, or whether there's a lower-level session API in the client packages. If neither exists, may be worth a feature request upstream.
Known non-goals (confirmed limitations)
References