[BUG] Advisor: a response that stops with pause_turn ends the turn with error_during_execution in -p / stream-json (2.1.326)

Aperta
#110,623 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start by tracing how non-interactive -p runs handle API responses with stop_reason: "pause_turn", including both JSON output and stream-json input/output paths. Reproduce with the advisor configured and 12 consecutive calls, then compare with a 9-call run. Done means the paused turn resumes and completes in both modes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:cli area:model bug has repro

Claude Code 2.1.326, non-interactive (-p, with --output-format json, and with --input-format stream-json --output-format stream-json).

After a run of about 10 advisor (server tool) calls with no client tool between them, the API stops the response with stop_reason: "pause_turn". Claude Code then ends the turn with error_during_execution instead of resuming it:

{"type":"result","subtype":"error_during_execution","is_error":true,"stop_reason":"pause_turn",
 "errors":["[ede_diagnostic] result_type=assistant last_content_type=server_tool_use stop_reason=pause_turn"]}

Repro (with advisorModel set, e.g. fable):

claude -p --model opus "Call your advisor tool exactly 12 times, one call after another. Between calls write only the line 'advisor call N done'. Use no other tools."

Expected: the paused turn is resumed and finishes.
Seen: exit 1 after 10 calls (-p, json) and after 11 calls (stream-json in and out). Runs asking for 9 calls succeed.

Lingua principale
TypeScript
Stelle
156k
Fork
25k
Merge medio
16h 19m
PR unite (30g)
5

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di anthropics/claude-code

Tutte le issue di anthropics/claude-code

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.