opencode icon indicating copy to clipboard operation
opencode copied to clipboard

question: bash tool timed out after 60 seconds?

Open aptdnfapt opened this issue 1 month ago • 6 comments

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

aptdnfapt avatar Nov 26 '25 17:11 aptdnfapt

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] avatar Nov 26 '25 18:11 github-actions[bot]

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

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

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 avatar Nov 26 '25 18:11 aptdnfapt

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 avatar Nov 26 '25 18:11 rekram1-node

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 avatar Dec 04 '25 13:12 heimoshuiyu

truly the most annoying thing of opencode is damn timeout

Kreijstal avatar Dec 09 '25 12:12 Kreijstal

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 avatar Dec 09 '25 16:12 rekram1-node

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 avatar Dec 09 '25 16:12 Kreijstal

itll be configurable in next release

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

added OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS env var, it will be in next release

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

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 avatar Dec 15 '25 12:12 Kreijstal