Skip to content

fix(protocol,client): resolve subagent type mismatches#316

Closed
dimakis wants to merge 1 commit intomainfrom
fix/subagent-types
Closed

fix(protocol,client): resolve subagent type mismatches#316
dimakis wants to merge 1 commit intomainfrom
fix/subagent-types

Conversation

@dimakis
Copy link
Copy Markdown
Owner

@dimakis dimakis commented May 6, 2026

Summary

  • Export StreamingSubagentState, FinishedSubagentState, SubagentUsage, SubagentState from @mitzo/protocol
  • Change StreamingBlock.subagent from StreamingSubagentState to SubagentState — the SUBAGENT_END reducer transitions it to finished while the parent block is still streaming
  • Add finishSubagent() helper for proper Map→array block conversion
  • Narrow union types in all streaming subagent reducers with 'blockOrder' in guards
  • Use finishSubagent() in both finishCurrent() and SUBAGENT_END reducer

Test plan

  • npm run build:server — clean
  • npm run build (frontend) — clean
  • Full test suite — 2447 passed (2 pre-existing timeouts in getSessions)

🤖 Generated with Claude Code

StreamingBlock.subagent was typed as StreamingSubagentState but the
SUBAGENT_END reducer transitions it to FinishedSubagentState. Changed
to SubagentState union. Added finishSubagent() helper for proper
Map→array conversion. Exported subagent types from protocol index.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dimakis
Copy link
Copy Markdown
Owner Author

dimakis commented May 9, 2026

Superseded by #312 which was merged first.

@dimakis dimakis closed this May 9, 2026
@dimakis dimakis deleted the fix/subagent-types branch May 9, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant