Skip to content

Tool and task execution can hang indefinitely with no timeout #20096

Closed

Description

@ESRE-dev

Problem

Tool and task (subagent) execution has no timeout protection. If a tool call hangs — due to an unresponsive external service, a deadlocked shell command, or a stuck LLM provider — the session blocks indefinitely with no recovery path.

Tool execution

Non-task tools (bash, read, write, etc.) execute with no deadline. A stuck bash command that bypasses the shell hard-stop, or a hung MCP tool, will block the session forever.

Task execution

Subagent task tools have no top-level deadline. A child session that stalls — e.g., waiting on an unreachable provider, or caught in a retry loop — keeps the parent session blocked indefinitely with no structured error or recovery.

Expected behavior

  • Non-task tools should have a configurable timeout (suggested default: 15 minutes)
  • Task tools should have a configurable deadline (suggested default: 4 hours) with partial output recovery on timeout
  • Timeouts should cancel the tool/task cleanly and return a structured error that the LLM can act on
  • Configuration via experimental.tool_timeout and experimental.task_timeout

Environment

Most visible in subagent-heavy workflows where child sessions make external API calls or run long shell commands.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 30, 2026
  2. github-actions commented on Mar 30, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This appears to be a feature request (requesting configurable timeouts), but the title does not start with [FEATURE]: and the feature request template was not used. Please update the title to begin with [FEATURE]: and confirm using the feature request template (including the verification checkbox).

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. ESRE-dev commented on Mar 30, 2026

    @ESRE-dev
    Author

    Closing as duplicate / superseded by existing issue #15080 and related hang reports (#11865, #13841, #18378). I will link the PR to #15080 and reference the related issues for broader context.

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions