opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: add options for bash timeout

Open radomirml opened this issue 1 month ago • 1 comments

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)

radomirml avatar Dec 06 '25 22:12 radomirml

I removed timeout_max in the update as maximum was removed in upstream.

radomirml avatar Dec 07 '25 08:12 radomirml

No longer necessary with addition of OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS

radomirml avatar Dec 13 '25 08:12 radomirml