anthropics / anthropics/claude-agent-sdk-typescript

Support outputFormat for Task tool / subagents

Aperta
#104 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
Shell
Stelle
1.8k
Fork
226
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Problem**

When using the Task tool to spawn subagents, the full subagent response is returned to the main agent's context. This causes context bloat and defeats the purpose of using subagents for context isolation.

Currently, outputFormat with json_schema only works for the top-level query(), not for subagent results.

**Use Case**

Building agents that spawn multiple parallel workers to process documents. Each worker reads sources, writes analysis to disk, and should return only a compact JSON summary to the main agent.

Without schema enforcement on subagent output, 10 workers returning 5000 tokens each = 50000 tokens of context bloat. With enforcement, 10 workers × 150 tokens = 1500 tokens.

This pattern is essential for scalable multi-agent workflows

**Proposed Solution**

Add outputFormat support to either:
- Task tool parameters, or
- Programmatic agent definitions via the agents option

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.