question: bash tool timed out after 60 seconds? #3138

Closed
opened 2026-02-16 17:38:48 -05:00 by yindo · 13 comments
Owner

Originally created by @aptdnfapt on GitHub (Nov 26, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

hey so seems like when llm runs some long running cli process such as docker builds via the bash tool . it seems to timeout the process after 60s ?or such so . even tho the process had flowing output on the tui . timeout is a parameter for llm to choose or its just default hardcoded ?

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @aptdnfapt on GitHub (Nov 26, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description hey so seems like when llm runs some long running cli process such as docker builds via the bash tool . it seems to timeout the process after 60s ?or such so . even tho the process had flowing output on the tui . timeout is a parameter for llm to choose or its just default hardcoded ? ### OpenCode version _No response_ ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo closed this issue 2026-02-16 17:38:48 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 26, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #1721: bash tool often times out - same issue with bash commands timing out, mentions default timeout behavior
  • #4197: Set timout for long running commands - user encountering 120000ms timeout with test suite
  • #3950: [FEATURE]: Configurable command timeout in config.json - feature request for configurable timeout for long-running operations
  • #2985: Bash tool does not show time out to model or user - related issue about timeout handling and model notification

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 26, 2025): This issue might be a duplicate of existing issues. Please check: - #1721: bash tool often times out - same issue with bash commands timing out, mentions default timeout behavior - #4197: Set timout for long running commands - user encountering 120000ms timeout with test suite - #3950: [FEATURE]: Configurable command timeout in config.json - feature request for configurable timeout for long-running operations - #2985: Bash tool does not show time out to model or user - related issue about timeout handling and model notification Feel free to ignore if none of these address your specific case.
Author
Owner

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

it defaults to 60 seconds but the llm can choose a value, we cap it at 10min rn

@rekram1-node commented on GitHub (Nov 26, 2025): it defaults to 60 seconds but the llm can choose a value, we cap it at 10min rn
Author
Owner

@aptdnfapt commented on GitHub (Nov 26, 2025):

could make it reset its timer if the terminal output is flowing ?
or yeah 10 min also works but a dynamic logic is better ig

@aptdnfapt commented on GitHub (Nov 26, 2025): could make it reset its timer if the terminal output is flowing ? or yeah 10 min also works but a dynamic logic is better ig
Author
Owner

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

the main idea here is to prevent someone from starting a task and letting the llm work and then wondering why it never stops, like a dev server, some servers have background jobs that could still be logging things.

But i see what u want. Other people have asked for it to be configurable and stuff

@rekram1-node commented on GitHub (Nov 26, 2025): the main idea here is to prevent someone from starting a task and letting the llm work and then wondering why it never stops, like a dev server, some servers have background jobs that could still be logging things. But i see what u want. Other people have asked for it to be configurable and stuff
Author
Owner

@heimoshuiyu commented on GitHub (Dec 4, 2025):

I suggest that after a 60-second timeout, the task should be run in the background, and the LLM should be returned the logs already output along with a PID. The LLM should be instructed that it can use the job_output(pid, max_wait_time) tool to retrieve and wait for more output, or use job_kill(pid) to terminate the process.

If the process has not finished by the time job_output(pid, max_wait_time) exceeds the wait time, the LLM should be returned the output up to that point, and then prompted that it can wait for a longer duration.

This way, the LLM can keep development servers running continuously in the background, check outputs, or execute long-running tasks like pytest without interruption.

This idea comes from the crush project, and I think it's a great design. I submitted a PR, but they seem too busy to handle it... https://github.com/charmbracelet/crush/pull/1496

@heimoshuiyu commented on GitHub (Dec 4, 2025): I suggest that after a 60-second timeout, the task should be run in the background, and the LLM should be returned the logs already output along with a PID. The LLM should be instructed that it can use the `job_output(pid, max_wait_time)` tool to retrieve and wait for more output, or use `job_kill(pid)` to terminate the process. If the process has not finished by the time `job_output(pid, max_wait_time)` exceeds the wait time, the LLM should be returned the output up to that point, and then prompted that it can wait for a longer duration. This way, the LLM can keep development servers running continuously in the background, check outputs, or execute long-running tasks like `pytest` without interruption. This idea comes from the `crush` project, and I think it's a great design. I submitted a PR, but they seem too busy to handle it... https://github.com/charmbracelet/crush/pull/1496
Author
Owner

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

truly the most annoying thing of opencode is damn timeout

@Kreijstal commented on GitHub (Dec 9, 2025): truly the most annoying thing of opencode is damn timeout
Author
Owner

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

the default timeout is 2min now ig we could make it configured, keep in mind tho the agent can set it to any time it wants or you can instruct it to

@rekram1-node commented on GitHub (Dec 9, 2025): the default timeout is 2min now ig we could make it configured, keep in mind tho the agent can set it to any time it wants or you can instruct it to
Author
Owner

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

the default timeout is 2min now ig we could make it configured, keep in mind tho the agent can set it to any time it wants or you can instruct it to

pls make it configurable, I cannot keep telling the agent or the agent keeps forgetting

@Kreijstal commented on GitHub (Dec 9, 2025): > the default timeout is 2min now ig we could make it configured, keep in mind tho the agent can set it to any time it wants or you can instruct it to pls make it configurable, I cannot keep telling the agent or the agent keeps forgetting
Author
Owner

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

itll be configurable in next release

@rekram1-node commented on GitHub (Dec 9, 2025): itll be configurable in next release
Author
Owner

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

added OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS env var, it will be in next release

@rekram1-node commented on GitHub (Dec 9, 2025): added OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS env var, it will be in next release
Author
Owner

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

you forgot to say that OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS only accepts a 32bit integer and 999999999999 ms is not allowed and it will default to 1 ms instead

@Kreijstal commented on GitHub (Dec 15, 2025): you forgot to say that OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS only accepts a 32bit integer and 999999999999 ms is not allowed and it will default to 1 ms instead
Author
Owner

@abda11ah commented on GitHub (Jan 17, 2026):

hi, pls fix the feature, it won't work

my .bashrc file

# opencode
export PATH=/root/.opencode/bin:/usr/bin/site_perl:$PATH
export OPENCODE_EXPERIMENTAL=1
export OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=94748364
export OPENCODE_EXPERIMENTAL_BASH_MAX_OUTPUT_LENGTH=94748364
export OPENCODE_ENABLE_EXPERIMENTAL_MODELS=1

then imported it

# source .bashrc
# echo $OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS
94748364

but i still get

<bash_metadata>
bash tool terminated command after exceeding timeout 30000 ms
</bash_metadata>
@abda11ah commented on GitHub (Jan 17, 2026): hi, pls fix the feature, it won't work my .bashrc file ``` # opencode export PATH=/root/.opencode/bin:/usr/bin/site_perl:$PATH export OPENCODE_EXPERIMENTAL=1 export OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS=94748364 export OPENCODE_EXPERIMENTAL_BASH_MAX_OUTPUT_LENGTH=94748364 export OPENCODE_ENABLE_EXPERIMENTAL_MODELS=1 ``` then imported it ``` # source .bashrc # echo $OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS 94748364 ``` but i still get ``` <bash_metadata> bash tool terminated command after exceeding timeout 30000 ms </bash_metadata> ```
Author
Owner

@rekram1-node commented on GitHub (Jan 17, 2026):

@abda11ah the llm can pass a custom timeout when it invokes the tool, in this example that's what it did

@rekram1-node commented on GitHub (Jan 17, 2026): @abda11ah the llm can pass a custom timeout when it invokes the tool, in this example that's what it did
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3138