Built-in bounded auto-retry with schema degradation for structured-output subagents
Type: enhancement · Area: multi-agent workflows / structured output
Problem
The dominant cause of structured-output subagent failures is output shape, not the task: a schema that is too large/strict for a high-surface item, or output that runs out of room mid-JSON and fails validation repeatedly. Today the only recovery is manual — the author notices the failure, hand-edits the schema to be leaner, and relaunches. That is exactly the kind of mechanical recovery the harness should own. (Companion to the silent-drop bug filed separately.)
Proposed feature
An opt-in (ideally default) bounded auto-retry for agent({schema}) that, on retry-cap exhaustion, retries once with a degraded shape rather than the identical failing call:
- relax
requiredto the minimal essential set, - drop
additionalProperties:false, - apply/keep
maxItemsand string-length caps, - optionally split the request.
Constraints:
- Bounded — at most one automatic degraded retry per item, so a genuinely broken task can't loop and burn tokens.
- Transparent — if the degraded retry succeeds, include it (optionally tagged "recovered"); if it still fails, surface it loudly. Auto-retry must reduce interruptions on the recoverable case without ever becoming a silent drop on the unrecoverable one.
Why it helps everyone
Structured fan-out over uneven work is a common workflow shape. A built-in degrade-and-retry turns the single most common failure mode from "silent partial result" into "self-healed," and removes a class of manual babysitting that every author currently reinvents.
Filed from real multi-agent workflow usage.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗