opencode
opencode copied to clipboard
feat: add options for bash timeout
Summary
Added per-agent bash timeout configuration to support long-running builds and tests.
When working on large projects, the default bash timeout was insufficient for compilation and test suites. This change allows configuring minimum and maximum timeouts per agent:
{
"agent": {
"build": {
"bash": {
"timeout": 120000, // 2 min minimum (default: 60s)
"timeout_max": 600000, // 10 min maximum (default: 10min)
},
},
},
}
The timeout calculation ensures commands get at least the configured minimum while respecting the maximum cap: timeout = min(max(bash.timeout, params.timeout), bash.timeout_max)
I removed timeout_max in the update as maximum was removed in upstream.
No longer necessary with addition of OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS