[PR #11068] feat(bash): add env parameter for setting environment variables #13645

Open
opened 2026-02-16 18:18:29 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/11068

State: open
Merged: No


Fixes #11065

Adds optional env parameter to the bash tool that allows plugins to inject environment variables into spawned processes.

Changes:

  • Added env: z.record(z.string(), z.string()).optional() to bash tool schema
  • Merged env vars with process.env in spawn call
  • Added tests for single and multiple environment variables

Verified:

  • All tests pass including new env tests
  • Tested with a plugin using tool.execute.before hook to set env vars
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/11068 **State:** open **Merged:** No --- Fixes #11065 Adds optional `env` parameter to the bash tool that allows plugins to inject environment variables into spawned processes. **Changes:** - Added `env: z.record(z.string(), z.string()).optional()` to bash tool schema - Merged env vars with `process.env` in spawn call - Added tests for single and multiple environment variables **Verified:** - All tests pass including new env tests - Tested with a plugin using `tool.execute.before` hook to set env vars
yindo added the pull-request label 2026-02-16 18:18:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13645