Skip to content

Task tool needs configurable timeout to prevent indefinite hangs #15072

@jdocker8

Description

@jdocker8

Problem

When using the Task tool to launch subagents (explore, general), there is no way to set a timeout. Subagents frequently hang for 5-15+ minutes on tasks that should take 15-30 seconds, blocking the entire conversation.

Context

The host repo has AI rules (AI_RULES.md §16) that explicitly require:

  • "Set explicit timeout per request: 2 min (simple), 5 min (larger)"
  • "On timeout: cancel, then re-issue with smaller scope or do it directly"
  • "Never wait indefinitely"

But the Task tool schema has no timeout parameter, so these rules are unenforceable. The Bash tool has a timeout parameter — Task should too.

Expected behavior

  1. Task tool should accept an optional timeout parameter (milliseconds, like Bash tool)
  2. Reasonable default timeout (e.g., 120s) if none specified
  3. On timeout: return a timeout error so the caller can fall back to doing the work directly

Current workaround

None. The caller agent just waits indefinitely, and the user has to manually abort.

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