bash tool often times out #1177

Open
opened 2026-02-16 17:29:53 -05:00 by yindo · 16 comments
Owner

Originally created by @xhuw on GitHub (Aug 8, 2025).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @xhuw on GitHub (Aug 8, 2025). Originally assigned to: @thdxr on GitHub. 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.
Author
Owner

@xhuw commented on GitHub (Aug 18, 2025):

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 commented on GitHub (Aug 18, 2025): 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
Author
Owner

@junmediatek commented on GitHub (Nov 17, 2025):

hi @thdxr @xhuw

Could you fix this issue?

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

@junmediatek commented on GitHub (Nov 17, 2025): hi @thdxr @xhuw Could you fix this issue? default timeout is no timeout (runs forever) max timeout is very long (1 day? infinite?)
Author
Owner

@rekram1-node commented on GitHub (Nov 18, 2025):

We could prolly change it hmm

@rekram1-node commented on GitHub (Nov 18, 2025): We could prolly change it hmm
Author
Owner

@rekram1-node commented on GitHub (Nov 18, 2025):

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 commented on GitHub (Nov 18, 2025): 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
Author
Owner

@junmediatek commented on GitHub (Dec 8, 2025):

We could prolly change it hmm

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

@junmediatek commented on GitHub (Dec 8, 2025): > We could prolly change it hmm hi @rekram1-node Is there anything for this issue?
Author
Owner

@rekram1-node commented on GitHub (Dec 8, 2025):

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 commented on GitHub (Dec 8, 2025): 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)
Author
Owner

@junmediatek commented on GitHub (Dec 8, 2025):

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 commented on GitHub (Dec 8, 2025): > I actually merged something for this [@junmediatek](https://github.com/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?
Author
Owner

@rekram1-node commented on GitHub (Dec 8, 2025):

which timeout are u wanting to set? The default?

@rekram1-node commented on GitHub (Dec 8, 2025): which timeout are u wanting to set? The default?
Author
Owner

@junmediatek commented on GitHub (Dec 8, 2025):

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 commented on GitHub (Dec 8, 2025): > 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
Author
Owner

@Kreijstal commented on GitHub (Dec 9, 2025):

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 commented on GitHub (Dec 9, 2025): > I actually merged something for this [@junmediatek](https://github.com/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
Author
Owner

@Kreijstal commented on GitHub (Dec 9, 2025):

opencode timeouts are incredibly obnoxious

@Kreijstal commented on GitHub (Dec 9, 2025): opencode timeouts are incredibly obnoxious
Author
Owner

@junmediatek commented on GitHub (Dec 9, 2025):

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 commented on GitHub (Dec 9, 2025): 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.
Author
Owner

@rekram1-node commented on GitHub (Dec 9, 2025):

in next release we will have OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS

@rekram1-node commented on GitHub (Dec 9, 2025): in next release we will have `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS`
Author
Owner

@PSU3D0 commented on GitHub (Dec 31, 2025):

@rekram1-node can you add per tool timeouts? Some HITL tools might take days to get an "approval"

@PSU3D0 commented on GitHub (Dec 31, 2025): @rekram1-node can you add per tool timeouts? Some HITL tools might take days to get an "approval"
Author
Owner

@jverkoey commented on GitHub (Jan 24, 2026):

Did OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS end up getting merged in to prod?

@jverkoey commented on GitHub (Jan 24, 2026): Did OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS end up getting merged in to prod?
Author
Owner

@jnd0 commented on GitHub (Jan 27, 2026):

I can see the OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS is defined in the CLI docs as experimental.

My default for running tasks was 2 mins.

If you have trouble with a specific command you can also ask the agent to pass a custom timeout for the bash tool call.

@jnd0 commented on GitHub (Jan 27, 2026): I can see the `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` is defined in the CLI docs as experimental. My default for running tasks was 2 mins. If you have trouble with a specific command you can also ask the agent to pass a custom timeout for the bash tool call.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1177