Skip to content

Chore/include action metadata from API responses#6204

Merged
HenryHengZJ merged 1 commit intomainfrom
chore/Return-Action-From-Prediction
Apr 13, 2026
Merged

Chore/include action metadata from API responses#6204
HenryHengZJ merged 1 commit intomainfrom
chore/Return-Action-From-Prediction

Conversation

@HenryHengZJ
Copy link
Copy Markdown
Contributor

Issue

When an agentflow hits a human-in-the-loop node (human input or agent tool approval), an action object is created containing approve/reject buttons and context data. This action is stored in the database and streamed via SSE to the UI — but it is not returned in the non-streaming prediction API response for agentflows. Developers building on the prediction API cannot detect when human input is needed without parsing SSE streams.

Fix

Add action to agentflow non-streaming response

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the handling of an 'action' field across several server-side components, including event publishers and flow builders, to ensure consistent metadata propagation. A review comment suggests an optimization in 'buildAgentflow.ts' to use an existing object directly instead of performing a redundant JSON parse.

@HenryHengZJ HenryHengZJ merged commit 6ba035c into main Apr 13, 2026
7 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.

2 participants