{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:pi:pi-subagent:config",
  "title": "pi-subagent v2 configuration",
  "description": "One asynchronous agent tree. Old scheduling and mailbox-protocol settings are not supported.",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "$schema": { "type": "string" },
    "agentScope": {
      "type": "string",
      "enum": ["user", "project", "both"],
      "default": "user",
      "description": "Definition catalog scope. Project definitions require project trust."
    },
    "maxDepth": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991,
      "default": 3,
      "description": "Absolute delegation depth. Root is depth zero."
    },
    "maxConcurrentAgents": {
      "type": "integer",
      "minimum": 1,
      "maximum": 9007199254740991,
      "default": 4,
      "description": "Maximum active child runs across the entire root tree. Admission fails immediately at capacity; root does not count."
    },
    "inheritExtensions": {
      "type": "boolean",
      "default": false,
      "description": "Load other Pi extensions in children, subject to project trust and tool ceilings. pi-subagent itself is excluded."
    },
    "openAIIdentity": {
      "type": "boolean",
      "default": false,
      "description": "Inject the optional Codex identity lifecycle in OpenAI Responses and virtual children."
    },
    "maxOutputBytes": {
      "type": "integer",
      "minimum": 1024,
      "maximum": 1048576,
      "default": 51200,
      "description": "Maximum completion body size in UTF-8 bytes, additionally bounded to 128 KiB for mailbox delivery. Full output stays in the child session."
    }
  }
}
