Skip to content

feat: per-workstream environment variable overrides #337

@davidpoblador

Description

@davidpoblador

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions