Skip to content

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

Closed

Description

@aptdnfapt

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

Activity

  1. github-actions commented on Nov 26, 2025

    @github-actions
    Contributor

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

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

  2. rekram1-node commented on Nov 26, 2025

    @rekram1-node
    Collaborator

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

  3. self-assigned this
    on Nov 26, 2025
  4. changed the title [-]even tho process was priniting stuff timeout kills the process[/-] [+]question: bash tool timed out after 60 seconds?[/+] on Nov 26, 2025
  5. aptdnfapt commented on Nov 26, 2025

    @aptdnfapt
    ContributorAuthor

    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

  6. rekram1-node commented on Nov 26, 2025

    @rekram1-node
    Collaborator

    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

  7. heimoshuiyu commented on Dec 4, 2025

    @heimoshuiyu
    Contributor

    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... charmbracelet/crush#1496

  8. Kreijstal commented on Dec 9, 2025

    @Kreijstal

    truly the most annoying thing of opencode is damn timeout

  9. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Collaborator

    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

  10. Kreijstal commented on Dec 9, 2025

    @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

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

  11. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Collaborator

    itll be configurable in next release

  12. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Collaborator

    added OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS env var, it will be in next release

  13. Kreijstal commented on Dec 15, 2025

    @Kreijstal

    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

  14. abda11ah commented on Jan 17, 2026

    @abda11ah

    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>
    
  15. rekram1-node commented on Jan 17, 2026

    @rekram1-node
    Collaborator

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

  16. anes1178 commented on Apr 15, 2026

    @anes1178

    Hello, I’m experiencing the same issue as well. In that case, how should I instruct the agent? Is there a guide I can follow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions