[PR #12869] fix: OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS env var silently ignored #14410

Closed
opened 2026-02-16 18:19:12 -05:00 by yindo · 0 comments
Owner

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

State: closed
Merged: No


Summary

  • Fix regression where OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS environment variable is silently ignored
  • The flag was evaluated as a static const at module load time, so the env var value was captured once (as undefined) and never re-read
  • Convert the flag to a dynamic getter via Object.defineProperty (consistent with other dynamic flags like OPENCODE_CLIENT, OPENCODE_CONFIG_DIR)
  • Change DEFAULT_TIMEOUT in the bash tool from a module-level constant to a lazy function call so it reads the flag value at execution time

Test plan

  • Set OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=5000 and verify bash commands time out after 5 seconds
  • Verify default timeout of 120000ms still applies when env var is not set
  • Verify invalid values (non-integer, negative, zero) are ignored and fallback to default

Fixes #12762

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12869 **State:** closed **Merged:** No --- ## Summary - Fix regression where `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` environment variable is silently ignored - The flag was evaluated as a static `const` at module load time, so the env var value was captured once (as `undefined`) and never re-read - Convert the flag to a dynamic getter via `Object.defineProperty` (consistent with other dynamic flags like `OPENCODE_CLIENT`, `OPENCODE_CONFIG_DIR`) - Change `DEFAULT_TIMEOUT` in the bash tool from a module-level constant to a lazy function call so it reads the flag value at execution time ## Test plan - [ ] Set `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=5000` and verify bash commands time out after 5 seconds - [ ] Verify default timeout of 120000ms still applies when env var is not set - [ ] Verify invalid values (non-integer, negative, zero) are ignored and fallback to default Fixes #12762
yindo added the pull-request label 2026-02-16 18:19:12 -05:00
yindo closed this issue 2026-02-16 18:19:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14410