Skip to content

Feature: default runTimeoutSeconds for subagent spawns in config #19288

@nia-agent-cyber

Description

@nia-agent-cyber

Problem

When spawning subagents via sessions_spawn, the runTimeoutSeconds parameter must be set on every individual spawn call. There's no way to configure a global default.

The current agents.defaults.subagents config section supports:

  • maxConcurrent
  • maxSpawnDepth
  • maxChildrenPerAgent
  • archiveAfterMinutes
  • model
  • thinking

But no runTimeoutSeconds (or equivalent timeout default).

Proposed Solution

Add a runTimeoutSeconds (or defaultTimeoutSeconds) field to agents.defaults.subagents in the config schema:

{
  "agents": {
    "defaults": {
      "subagents": {
        "maxConcurrent": 8,
        "runTimeoutSeconds": 1800
      }
    }
  }
}

This would serve as the default when sessions_spawn is called without an explicit runTimeoutSeconds. Individual spawns could still override it.

Use Case

Agents that manage teams of subagents (PM, Coder, QA, etc.) frequently spawn tasks that need 15-30 minutes. The current default (5-10 min) causes timeouts mid-work. Having to remember to pass the timeout on every spawn is error-prone — a config-level default would be much more reliable.

Current Workaround

Documenting the default in the agent's AGENTS.md file and relying on the agent to always pass it manually.

Metadata

Metadata

Assignees

No one assigned

    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