Problem
Currently, all workstreams in a project share the same environment variables (the global FF_* vars plus whatever's in the symlinked .env). There's no way to set workstream-specific overrides — for example, a different DATABASE_URL per branch, or a custom port override.
FF_PORT already provides a unique deterministic port per worktree (range 40001-49999), which solves port conflicts for run scripts. But users may need other per-workstream differences (database URLs, API keys for staging environments, feature flags, etc.).
Proposal
Add a key-value editor in the workstream or project settings where users can define environment variable overrides per workstream. These overrides would be:
- Injected into all terminal sessions for that workstream (agent, setup, run, regular terminals)
- Available alongside the existing
FF_* variables
- Higher priority than
.env symlinked values
Use cases
- Different
DATABASE_URL per branch
- Custom feature flags per workstream
- API endpoint overrides for staging/preview environments
Context
Raised in #329 — the setup/run scripts and port detection parts of that request are already implemented via .factoryfloor.json and FF_PORT.
Problem
Currently, all workstreams in a project share the same environment variables (the global
FF_*vars plus whatever's in the symlinked.env). There's no way to set workstream-specific overrides — for example, a differentDATABASE_URLper branch, or a custom port override.FF_PORTalready provides a unique deterministic port per worktree (range 40001-49999), which solves port conflicts for run scripts. But users may need other per-workstream differences (database URLs, API keys for staging environments, feature flags, etc.).Proposal
Add a key-value editor in the workstream or project settings where users can define environment variable overrides per workstream. These overrides would be:
FF_*variables.envsymlinked valuesUse cases
DATABASE_URLper branchContext
Raised in #329 — the setup/run scripts and port detection parts of that request are already implemented via
.factoryfloor.jsonandFF_PORT.