Skip to content

fix(ag-ui): graceful ACTIVITY_DELTA applyPatch + enforce assistant-role in subagent projection#694

Merged
blove merged 1 commit into
mainfrom
fix/ag-ui-activity-hardening
Jun 18, 2026
Merged

fix(ag-ui): graceful ACTIVITY_DELTA applyPatch + enforce assistant-role in subagent projection#694
blove merged 1 commit into
mainfrom
fix/ag-ui-activity-hardening

Conversation

@blove

@blove blove commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Two robustness hardening items flagged in the multi-message subagent-cards review (#692). The new structured JSON-Patch wire shape leans on index-correctness, so degrade gracefully.

  1. reducer.ts ACTIVITY_DELTA: wrap applyPatch in try/catch — a malformed or out-of-order DELTA (e.g. a replace /messages/N/content whose index doesn't exist yet) now logs + drops the patch instead of throwing into the onEvent subscriber and breaking the stream.
  2. to-agent.ts subagent projection: hard-code projected transcript messages to role:'assistant' — the subagent transcript is exclusively assistant turns (tool calls live in toolCalls[]); this enforces the invariant the card relies on, so a buggy emitter putting role:'tool' in messages[] can't double-render.

Both TDD'd (confirmed fail→pass). ag-ui + chat lint/test green (859 tests).

…le in subagent projection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@blove blove enabled auto-merge (squash) June 18, 2026 23:47
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
threadplane Ready Ready Preview, Comment Jun 18, 2026 11:49pm

Request Review

@blove blove merged commit 558bac9 into main Jun 18, 2026
21 of 22 checks passed
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