Skip to content

Python: fix(ag-ui): persist workflow HITL user text in thread snapshots - #8273

Open
LI (ktz03) wants to merge 2 commits into
microsoft:mainfrom
ktz03:fix/ag-ui-workflow-hitl-snapshot
Open

Python: fix(ag-ui): persist workflow HITL user text in thread snapshots#8273
LI (ktz03) wants to merge 2 commits into
microsoft:mainfrom
ktz03:fix/ag-ui-workflow-hitl-snapshot

Conversation

@ktz03

Copy link
Copy Markdown

Description

Fixes #8160. Workflow AG-UI resumes often send messages: [] and put the user reply in resume.interrupts[].value. Execution continued, but the Thread Snapshot never recorded that turn, so hydrate skipped the user text.

After resume_seeded_messages, fold user-visible resume values (message lists / plain text) into the snapshot builder seed. Approval-style payloads (approved/accepted/functionCall) are skipped.

Validation

  • test_workflow_hitl_resume_persists_user_text_in_thread_snapshot

When resume carries user replies only in interrupt.value with messages:[], seed the snapshot builder with those turns so hydrate keeps them (microsoft#8160).

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.

🟡 Changes recommended

Resume synthesis can persist approval strings and duplicate user turns.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Persists workflow HITL resume text in AG-UI thread snapshots for correct hydration.

Changes:

  • Converts conversational resume values into snapshot messages.
  • Adds regression coverage for message-list resumes.
File summaries
File Description
_workflow.py Adds resume-value snapshot synthesis.
test_workflow_agent.py Tests HITL text persistence.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/ag-ui/agent_framework_ag_ui/_workflow.py Outdated
Comment thread python/packages/ag-ui/agent_framework_ag_ui/_workflow.py Outdated
@ktz03

Copy link
Copy Markdown
Author

Fork CI for this PR may need a maintainer to Approve workflows before Python tests run (same as other community PRs). Happy to address review feedback once checks appear.

Address Copilot review on microsoft#8273: do not hydrate bare approved/rejected resume strings as user messages, and avoid duplicating turns already present in request messages.
@ktz03
LI (ktz03) deployed to github-app-auth September 11, 2026 05:10 — with GitHub Actions Active
@ktz03

Copy link
Copy Markdown
Author

Follow-up for Copilot review: skip bare approval/rejection resume strings as user turns, and dedupe resume-synthesized snapshot messages against incoming messages. See b04c2ea.

@FOWEPJF255

Copy link
Copy Markdown
Contributor

Checks look good. Persisting the HITL user text from resume.interrupts[].value into the Thread Snapshot closes a real hydrate gap for workflow AG-UI resumes with empty messages.

If anything is still blocking review on #8160, happy to dig in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Bug]: AG-UI workflow resume does not persist user HITL text into Thread Snapshot

3 participants