Spec clarification: when does body.state reflect the latest STATE_SNAPSHOT, and is forwardedProps the recommended per-turn channel? #1893
Unanswered
sunholo-voight-kampff
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
The AG-UI spec describes shared state via
STATE_SNAPSHOT/STATE_DELTAevents that the client mirrors intoagent.state. We've found in practice that thebody.statefield arriving on turn N mirrors theSTATE_SNAPSHOTemitted at the end of turn N-1, not anything emitted during turn N itself.This makes
stateuseful for cross-turn persistence but unsuitable as a channel for per-turn ephemeral signals (e.g. "the user attached these documents to this message", "here's the current state of the UI surface as the user just interacted with it").We've routed around this by using
forwardedPropsas a sibling channel for turn-scoped data:forwardedProps.document_ids— files the user attached to this turnforwardedProps.a2ui_surface_state— current snapshot of mounted A2UI surfacesforwardedProps.resumed_session— resume signalBackend then reads
forwardedPropsfirst and falls back tobody.statefor genuine cross-turn data.What we'd like to clarify
body.stateintentional and spec-blessed, or an artefact of common implementations (ag_ui_adketc.)?forwardedPropsthe recommended channel for per-turn ephemeral signals, or is there a different recommended pattern?Related discussions / issues
Happy to contribute a docs PR if there's consensus on the answer.
cc @MarkEdmondson1234
Beta Was this translation helpful? Give feedback.
All reactions