Relationships
#4843 swamp serve host: give each hosted workspace its own environment variables
Opened by zack · 11/17/2026
Follow-up to swamp-club#4835.
Problem
Each workspace's serve inherits the host's environment, as plain serve inherits its operator's. Only SWAMP_REPO_DIR and SWAMP_DATASTORE are dropped, and SWAMP_HOME and SWAMP_CONFIG_DIR are pinned (src/serve/host/child_env.ts). So every workspace on a host shares one environment. Two teams on the same host cannot hold different cloud credentials, a different KUBECONFIG or a different TZ. The runs a workspace hands to workers carry that same shared environment.
Change
Let a workspace add to or override the inherited environment with a file of its own, for example under the workspace repo's .swamp/, read by the host when it starts that workspace's serve. Decide where the file lives, how it is protected (it will hold credentials), whether a change needs a restart of that workspace, and how it interacts with the workspace lifecycle (issues 8 to 12 of design/surfaces/serve-workspaces.md).
Done when
- Two workspaces on one host run a model that prints the same variable, and each sees its own value.
- The host's own environment still reaches a workspace that sets nothing.
- The design doc's Children paragraph describes the per-workspace file.
Open
No activity in this phase yet.
Sign in to post a ripple.