[PR #12921] fix(opencode): support dynamic bash timeout via OPENCODE_BASH_TIMEOUT env var #14438

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

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

State: open
Merged: No


Summary

  • Change OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS from a static const (evaluated once at module load) to a dynamic getter via Object.defineProperty, so the env var is read at access time
  • Update bash.ts to use a getDefaultTimeout() function instead of the static DEFAULT_TIMEOUT constant

Closes #12762

Test plan

  • Set OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=5000 before launching opencode, verify bash commands time out after 5 seconds
  • Verify default 2-minute timeout still applies when the env var is unset
  • Verify invalid values (negative, non-integer, non-numeric) are ignored and the default timeout is used
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12921 **State:** open **Merged:** No --- ## Summary - Change `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` from a static `const` (evaluated once at module load) to a dynamic getter via `Object.defineProperty`, so the env var is read at access time - Update `bash.ts` to use a `getDefaultTimeout()` function instead of the static `DEFAULT_TIMEOUT` constant Closes #12762 ## Test plan - [ ] Set `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=5000` before launching opencode, verify bash commands time out after 5 seconds - [ ] Verify default 2-minute timeout still applies when the env var is unset - [ ] Verify invalid values (negative, non-integer, non-numeric) are ignored and the default timeout is used
yindo added the pull-request label 2026-02-16 18:19:14 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14438