Skip to content

fix(studio): keep ADK stream chunks that share event ids - #1193

Open
getSpidd wants to merge 1 commit into
volcengine:mainfrom
getSpidd:fix/studio-partial-event-dedup
Open

getSpidd wants to merge 1 commit into
volcengine:mainfrom
getSpidd:fix/studio-partial-event-dedup

Conversation

@getSpidd

Copy link
Copy Markdown

Summary

Fix Studio dropping streamed assistant replies from ADK 2 backends.

ADK 2.7 gives every partial chunk of one model response the same id as its
consolidated final event (google/adk/flows/llm_flows/base_llm_flow.py:
"Partial chunks of one streaming response share the base id"). Since #1156,
AssistantEventProjector.project() ignores any event whose id was already
seen, so with /run_sse streaming: true only the first chunk renders; the
remaining chunks and the final event are discarded and Studio reports no
displayable model reply.

Observed against an AgentKit Runtime (AgentkitAgentServerApp, veadk 1.1.17,
google-adk 2.7.1): HTTP 200, 55 SSE frames sharing one id with a complete
answer, while Studio kept only the first thinking chunk. Affects 1.1.15–1.1.20.

Changes

  • frontend/src/blocks.ts: skip id deduplication for partial events that
    carry content (streamed chunks). Complete events and content-free partials
    (e.g. A2A status) are still deduplicated, preserving the feat(studio): integrate managed MPA runtime lifecycle #1156 replay guard.
  • Added regression coverage: shared-id chunks aggregate, the final event
    replaces the preview, and a replayed final event is ignored.
  • Rebuilt and committed packaged WebUI assets under veadk/webui (Node 22.17.0).

Validation

  • node --test tests/parallelStreamAggregation.test.mjs (new case fails before the fix)
  • npm test
  • npm run build
  • npm run test:webui-assets

Risk

Low. Only the projector's dedup condition changes. A replayed partial content
chunk (e.g. after a reconnect) may briefly duplicate preview text until the
consolidated event replaces it.

ADK 2 streams every partial chunk of a model response under the id of
its consolidated final event. The assistant projector deduplicated all
events by id, so every chunk after the first and the final event were
dropped and Studio showed no reply.

Skip deduplication for partial events that carry content; complete
events and content-free partials (A2A status) still dedupe, keeping
the replay guard from volcengine#1156.

This branch has not been deployed

No deployments
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