Skip to content

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

@ESRE-dev

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.

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
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions