CodeNomad/packages
Pascal André ff4446a367
feat(server): expose opencode server proxy url env (#351)
Fixes #321

## Summary
- expose OPENCODE_SERVER_BASE_URL in the spawned OpenCode workspace
environment
- point it at the current workspace's stable CodeNomad proxy URL
- propagate the new variable through WSL launches alongside the existing
auth env vars

## Why
Tools and plugins already receive the auth credentials needed to call
the current workspace instance, but they still need an extra lookup to
discover the correct URL.

The proxy URL is already known before runtime startup, so exposing it
directly removes that lookup without changing OpenCode's port selection
flow.

## What Changed
- packages/server/src/workspaces/opencode-auth.ts: added the
OPENCODE_SERVER_BASE_URL env var constant
- packages/server/src/workspaces/manager.ts: injects
OPENCODE_SERVER_BASE_URL into the workspace runtime environment using
CODENOMAD_BASE_URL + proxyPath
- packages/server/src/workspaces/__tests__/spawn.test.ts: updates WSL
env propagation coverage for the new variable

## Validation
- npx tsx --test
"packages/server/src/workspaces/__tests__/spawn.test.ts"
2026-05-01 21:46:34 +02:00
..
cloudflare Minimum version to 0.14.0 2026-04-16 08:43:16 +01:00
electron-app fix(desktop): restore managed Node server startup (#348) 2026-04-26 13:20:47 +01:00
opencode-config fix(desktop): restore managed Node server startup (#348) 2026-04-26 13:20:47 +01:00
server feat(server): expose opencode server proxy url env (#351) 2026-05-01 21:46:34 +02:00
tauri-app fix(desktop): restore managed Node server startup (#348) 2026-04-26 13:20:47 +01:00
ui feat(ui): add markdown preview to file viewer (#352) 2026-04-26 21:24:19 +01:00