Skip to content

fix(tui): forward environment to worker#35925

Merged
rekram1-node merged 1 commit into
devfrom
worker-env
Jul 9, 2026
Merged

fix(tui): forward environment to worker#35925
rekram1-node merged 1 commit into
devfrom
worker-env

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • forward the CLI process environment into the TUI worker
  • restore OPENCODE=1 and AGENT=1 for commands launched by the worker-hosted server
  • add regression coverage for the worker environment option

Root cause

Bun workers do not inherit process.env mutations made after startup. The CLI sets its agent-detection variables in middleware, but the TUI worker was created without an explicit environment after the logging refactor in #31310.

Tests

  • bun test test/cli/tui/thread.test.ts
  • bun x prettier --check packages/opencode/src/cli/cmd/tui.ts packages/opencode/test/cli/tui/thread.test.ts
  • bun typecheck (timed out after 10 minutes)

@rekram1-node rekram1-node marked this pull request as ready for review July 9, 2026 23:13
@rekram1-node rekram1-node merged commit 251177d into dev Jul 9, 2026
11 checks passed
@rekram1-node rekram1-node deleted the worker-env branch July 9, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant