opencode icon indicating copy to clipboard operation
opencode copied to clipboard

bash tool often times out

Open xhuw opened this issue 4 months ago • 13 comments

Hey, loving opencode.

A clean build + test in my repo takes more than 2 minutes, and I could easily see it growing to more than 10 minutes for some tasks. I am seeing timeouts in the bash tool command often. Even with hints, it is often forgetting to set the timeout parameter (as far as I can tell)

My preferred fix:

  • default timeout is no timeout (runs forever)
  • max timeout is very long (1 day? infinite?)

Happy to submit a PR if this would be welcome.

xhuw avatar Aug 08 '25 16:08 xhuw

been using #1811 for a while now and its definitely better. Meanwhile I am working on a bash MCP to try and give the LLM full control over long running commands https://github.com/xhuw/async-bash-mcp

xhuw avatar Aug 18 '25 09:08 xhuw

hi @thdxr @xhuw

Could you fix this issue?

default timeout is no timeout (runs forever) max timeout is very long (1 day? infinite?)

junmediatek avatar Nov 17 '25 08:11 junmediatek

We could prolly change it hmm

rekram1-node avatar Nov 18 '25 06:11 rekram1-node

I think normally the concern tho is an agent will start a server or something itself and when it is looping itself it gets stuck, and a lot of people dont want that

rekram1-node avatar Nov 18 '25 06:11 rekram1-node

We could prolly change it hmm

hi @rekram1-node
Is there anything for this issue?

junmediatek avatar Dec 09 '25 02:12 junmediatek

I actually merged something for this @junmediatek it will be in next release:

default timeout will be 2 min, max timeout is gone (no cap)

rekram1-node avatar Dec 09 '25 02:12 rekram1-node

I actually merged something for this @junmediatek it will be in next release:

default timeout will be 2 min, max timeout is gone (no cap)

Hi @rekram1-node I find the source code, however, how to set the bash tool timeout by opencode.json?

junmediatek avatar Dec 09 '25 03:12 junmediatek

which timeout are u wanting to set? The default?

rekram1-node avatar Dec 09 '25 03:12 rekram1-node

which timeout are u wanting to set? The default? @rekram1-node Yes, I want to re-set the default bash tool for my building task that lasts up to one hour or more

junmediatek avatar Dec 09 '25 03:12 junmediatek

I actually merged something for this @junmediatek it will be in next release:

default timeout will be 2 min, max timeout is gone (no cap)

how to increase timeout I want to have 20 hour timeout

Kreijstal avatar Dec 09 '25 12:12 Kreijstal

opencode timeouts are incredibly obnoxious

Kreijstal avatar Dec 09 '25 12:12 Kreijstal

hi @Kreijstal

I think you can refer to claude code which has BASH_DEFAULT_TIMEOUT_MS & BASH_MAX_TIMEOUT_MS environment variables, they are can be set in the setting.json file.

junmediatek avatar Dec 09 '25 23:12 junmediatek

in next release we will have OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS

rekram1-node avatar Dec 09 '25 23:12 rekram1-node