release: subagent live progress + transcript (#594)

Merged
SW
5mo ago
+343-149

Summary

  • Converts taskTool.execute to async function* yielding open-agents' 4-stage progress sequence (initial โ†’ tool-call pending โ†’ finish-step usage โ†’ final transcript)
  • toModelOutput extracts last assistant text from output.final for parent agent context
  • New sumLanguageModelUsage helper (SRP)
  • Drive-by: fixes askUserQuestionTool.toModelOutput signature for the new SDK (was a latent bug from the older beta SDK)

Test plan

  • 25 new/updated unit tests; full suite 3114/3114 pass
  • E2E on preview: 6 tool-output-available chunks emitted in expected order
  • Cross-validated yield sequence against open-agents production โ€” byte-identical (same chunk count, same field sets on every yield)
  • toModelOutput confirmed end-to-end: parent agent correctly relayed subagent's summary

๐Ÿค– Generated with Claude Code


Summary by cubic

Adds live progress streaming for the task subagent by converting taskTool.execute to an async generator, so the UI can show pending tool-calls, running usage totals, and the final transcript. Also extracts the last assistant text for parent context and fixes askUserQuestionTool.toModelOutput to read the SDKโ€™s { output } shape.

  • New Features

    • taskTool.execute now yields: initial { startedAt, modelId, toolCallCount: 0 }, a pending { name, input } on each tool-call, accumulated usage on each finish-step, and a final { final: ModelMessage[] } transcript.
    • taskTool.toModelOutput returns the last assistant text from output.final.
    • Added sumLanguageModelUsage to safely accumulate per-step usage.
  • Bug Fixes

    • askUserQuestionTool.toModelOutput now uses ({ output }) so user answers are correctly surfaced.