Skip to content

fix: preserve config-level use.env in loadConfig - #34

Merged
factory-davidgu merged 1 commit into
mainfrom
factory/preserve-use-env
Aug 22, 2026
Merged

factory-davidgu merged 1 commit into
mainfrom
factory/preserve-use-env

Conversation

@factory-davidgu

Copy link
Copy Markdown
Collaborator

Description

loadConfig() copied shell/rows/columns/program from the user config's use block but silently dropped env, so a top-level use.env in tui-test.config.ts never reached spawned programs for tests without a beforeSpawn fixture. The runner already consumes it (suite.ts spawns with project.env ?? config.use.env); only the loader dropped it.

Why

factory-mono pins config-level env defaults (mock API base/key, auto-update off) so fixture-less CLI e2e tests can never inherit ambient CI credentials (root cause of the shard-24 rollback poisoning). Today that requires a build-time string patch in apps/cli/scripts/prepare-tui-test.ts; this fixes it at the source so the patch can be deleted and TUI_TEST_REF repointed.

Testing

  • npm run build passes; compiled lib/config/config.js contains the fix
  • Functional check: wrote a config with use: { env: { FOO: 'bar' } } to a temp cache dir and confirmed loadConfig() returns it
  • npm run lint: eslint clean; pre-existing prettier warning in src/test/suite.ts (present on main, untouched here)

loadConfig() copied shell/rows/columns/program from the user config use
block but silently dropped env, so a top-level use.env in
tui-test.config.ts never reached spawned programs for tests without a
beforeSpawn fixture.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@factory-davidgu
factory-davidgu merged commit 70bf891 into main Aug 22, 2026
2 of 17 checks passed
@factory-davidgu
factory-davidgu deleted the factory/preserve-use-env branch August 22, 2026 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant