Repository navigation
Conversation
…10 and 0.0.16 Synthetic fixtures of a user action: a list surface whose refresh button's context reads local state, then a run with no user message that carries the action in forwardedProps.a2uiAction.userAction and an update to /items/2. 0.0.10 echoes the synthetic log_a2ui_event pair; 0.0.16 hides its action message from the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A surface's actions now reach the agent the way the runtime's A2UI middleware reads them. - A2uiUserAction maps a2ui_core's A2uiRendererAction (the same in v0.9 and v1.0) to the middleware's userAction, and puts itself in the run's forwardedProps as a2uiAction.userAction. - A2uiActionDispatcher calls runAgent with no message and those run-scoped props, and reads the end of the turn: no status when it ended well, A2uiActionFailed on an error, A2uiActionDropped when runAgent returned false because the agent was busy (nothing sent, nothing queued). - A2uiSurfaceRegistry listens to its processor's actions and keeps actionStatuses / actionStatusChanges per surface; a surface ignores its actions while one is pending. A2uiSurfaceView shows an `action` row under the painted surface, with a builder on the view, A2uiActivityRenderer and CopilotA2ui. The renderer builds the dispatcher from the nearest CopilotKit client. - reportErrorsToAgent (off by default) sends the surfaces' errors as one a2ui_error action per turn, once it ends; history errors are not reported, and nothing more is reported until the user acts again. - A wire contract test taps the fixture surface and checks the forwarded props against both middleware generations' round-trip fixtures. - ADR 0022, README "Actions" section, ARCHITECTURE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Status
READY
Description
Closes #96. Part of the A2UI stack (#71). It builds on #255 (surface lifecycle, #246) and uses #250's run-scoped
forwardedProps(#243).Actions on a surface, like a button tap, now go back to the agent the way the runtime's A2UI middleware reads them.
A2uiActionDispatchercallsclient.runAgent(agentId, forwardedProps: {a2uiAction: {userAction}})with no user message.A2uiUserActionmapsa2ui_core'sA2uiRendererActionto theuserActionbody:name,surfaceId,sourceComponentId,timestamp,context, plususerMessage,catalogIdandmetadatawhen the action has them. The action is the same in v0.9 and v1.0. Only the binding syntax differs (pathvs@path), and thecontextis already resolved. I checked this against@ag-ui/a2ui-middleware0.0.10 (log_a2ui_event) and 0.0.16 (hidden user message nameda2ui_action_context_<43 chars>, sohiddenChatRowsalready matches), and against React 1.79'srunA2UIAction.A2uiSurfaceRegistry.actionStatuses/actionStatusChangeshold one status per surface, alongside the lifecycle statuses:A2uiActionPending,A2uiActionFailed(the turn ended with an error) andA2uiActionDropped(runAgentreturnedfalse, so nothing was sent and nothing is queued). A surface ignores its own actions while one is pending.A2uiSurfaceViewshows anactionrow under the painted surface. The builder is also onA2uiActivityRendererandCopilotA2ui, the same way asbuilding,failedandrejected.reportErrorsToAgent(off by default, onCopilotA2uiandA2uiActivityRenderer) sends the errors as onea2ui_erroraction per turn once the turn ends. Errors from history are not reported. After a report, nothing more is sent until the user acts again, which prevents a loop.a2ui_action_round_trip_0_0_10/_0_0_16hold the outgoing forwardedProps and then the in-place/items/2update. The action context carries{itemIndex, pinnedIds, filterMax}. A widget contract test taps the fixture surface and compares the props it sends with both fixtures, and it also covers a v1.0 surface. test(a2ui): recorded runtime wire fixtures for runtime 1.79 and 1.91 #247 will replace these fixtures with recorded ones.Type of Change
🤖 Generated with Claude Code