Skip to content

feat(HITL): Emit UserConfirmResultEvent when resuming permission HITL - #2511

Open
jujn wants to merge 2 commits into
mainfrom
emit-user-confirm-result-event
Open

feat(HITL): Emit UserConfirmResultEvent when resuming permission HITL#2511
jujn wants to merge 2 commits into
mainfrom
emit-user-confirm-result-event

Conversation

@jujn

@jujn jujn commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Emit UserConfirmResultEvent when ReActAgent accepts ConfirmResult payloads while resuming permission HITL.
  • Persist the pending confirmation request replyId on the live assistant message so the result event can correlate with the earlier RequireUserConfirmEvent.
  • Validate that resume ConfirmResults fully cover all current ASKING tool calls before emitting the event or mutating context.
  • Update HITL tests and event docs for the new resume-event behavior.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copilot AI review requested due to automatic review settings July 31, 2026 12:36
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.84127% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...e/src/main/java/io/agentscope/core/ReActAgent.java 69.35% 9 Missing and 10 partials ⚠️

📢 Thoughts on this report? Let us know!

@jujn
jujn marked this pull request as draft July 31, 2026 14:22
@jujn
jujn force-pushed the emit-user-confirm-result-event branch from d41ced1 to ca2d354 Compare August 2, 2026 14:41
@jujn
jujn marked this pull request as ready for review August 2, 2026 14:41
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@zouyx zouyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Reviewed confirmation validation, replyId correlation, and partial-confirmation behavior. ReActAgentHitlTest passes locally; CI is green.

@zouyx zouyx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Documentation requirement: this PR changes the observable streamEvents contract by emitting UserConfirmResultEvent on resume and correlating it with the earlier RequireUserConfirmEvent replyId, but it contains no docs/ update. The current English and Chinese message-and-event docs still call UserConfirmResultEvent an input event and do not document getReplyId correlation. Please update both language versions, ideally alongside the HITL flow documentation, and add this behavior to the PR checklist before merging.

}
normalized.add(result);
}
return List.copyOf(normalized);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

这个有必要 copyOf 吗?

* correlation metadata there lets the next call recover it from session state.
*/
private void persistPendingConfirmRequest(String replyId) {
Msg lastAssistant = findLastAssistantMsg();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

我看这个动作和上面是一样,是否作为参数传进来就好了?

* HITL request.
*/
private void clearPendingConfirmRequest() {
Msg lastAssistant = findLastAssistantMsg();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

甚至我看不太懂,这个方法和上面方法的区别是什么?多了个 if?

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.

3 participants