Python: fix(ag-ui): persist workflow HITL user text in thread snapshots - #8273
Python: fix(ag-ui): persist workflow HITL user text in thread snapshots#8273LI (ktz03) wants to merge 2 commits into
Conversation
When resume carries user replies only in interrupt.value with messages:[], seed the snapshot builder with those turns so hydrate keeps them (microsoft#8160).
There was a problem hiding this comment.
🟡 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.
|
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.
|
Follow-up for Copilot review: skip bare approval/rejection resume strings as user turns, and dedupe resume-synthesized snapshot messages against incoming |
|
Checks look good. Persisting the HITL user text from If anything is still blocking review on #8160, happy to dig in. |
Description
Fixes #8160. Workflow AG-UI resumes often send
messages: []and put the user reply inresume.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