Skip to content

bash tool often times out #1721

Closed
Closed

Description

@xhuw

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.

Activity

  1. self-assigned this
    on Aug 9, 2025
  2. xhuw commented on Aug 18, 2025

    @xhuw
    Author

    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

  3. junmediatek commented on Nov 17, 2025

    @junmediatek
    Contributor

    hi @thdxr @xhuw

    Could you fix this issue?

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

  4. rekram1-node commented on Nov 18, 2025

    @rekram1-node
    Contributor

    We could prolly change it hmm

  5. rekram1-node commented on Nov 18, 2025

    @rekram1-node
    Contributor

    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

  6. junmediatek commented on Dec 9, 2025

    @junmediatek
    Contributor

    We could prolly change it hmm

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

  7. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Contributor

    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)

  8. junmediatek commented on Dec 9, 2025

    @junmediatek
    Contributor

    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?

  9. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Contributor

    which timeout are u wanting to set? The default?

  10. junmediatek commented on Dec 9, 2025

    @junmediatek
    Contributor

    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

  11. Kreijstal commented on Dec 9, 2025

    @Kreijstal

    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

  12. Kreijstal commented on Dec 9, 2025

    @Kreijstal

    opencode timeouts are incredibly obnoxious

  13. junmediatek commented on Dec 9, 2025

    @junmediatek
    Contributor

    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.

  14. rekram1-node commented on Dec 9, 2025

    @rekram1-node
    Contributor

    in next release we will have OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS

  15. PSU3D0 commented on Dec 31, 2025

    @PSU3D0

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

  16. jverkoey commented on Jan 25, 2026

    @jverkoey

    Did OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS end up getting merged in to prod?

  17. jnd0 commented on Jan 27, 2026

    @jnd0

    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.

  18. github-actions commented on Mar 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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