Repository navigation
fix(samples): use latest task in LangGraph HITL conversations - #1139
Open
JiahuiGu (Jiahui-Gu) wants to merge 8 commits into
Open
JiahuiGu (Jiahui-Gu) wants to merge 8 commits into
JiahuiGu (Jiahui-Gu) wants to merge 8 commits into
Conversation
JiahuiGu (Jiahui-Gu)
temporarily deployed
to
L4-validation
November 4, 2026 12:35 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the changes to latest-request handling and task-specific state resets.
No open issues 🎉
What changed in this PR
Fixes the LangGraph human-in-the-loop sample so subsequent tasks in the same conversation use the latest user request without carrying over earlier revision history.
Changes:
- Selects the latest
HumanMessagewhile preserving structured content. - Adds a
start_tasknode to reset task-specific state while retaining history during revisions and checkpoint resumes. - Updates the graph documentation and adds a shared two-turn behavior contract for sequential approved tasks.
| File | Description |
|---|---|
samples/python/hosted-agents/langgraph/responses/07-human-in-the-loop/src/langgraph-human-in-the-loop-responses/main.py |
Uses the latest user message and resets state for new tasks. |
samples/python/hosted-agents/langgraph/responses/07-human-in-the-loop/README.md |
Documents the entry node and task-versus-revision behavior. |
.azure-pipelines/hosted-agent-tests/python/langgraph/responses/07-human-in-the-loop/test-spec.yml |
Adds a two-turn contract checking that approved drafts follow the current task. |
Review effort: Balanced
JiahuiGu (Jiahui-Gu)
temporarily deployed
to
L4-validation
November 4, 2026 16:30 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unconditional runtime imports in the lifecycle test raise ModuleNotFoundError during test discovery because CI installs only policy/helper dependencies, breaking both offline checks and the cloud pipeline.
1 open issue
Review effort: Balanced
JiahuiGu (Jiahui-Gu)
temporarily deployed
to
L4-validation
November 4, 2026 17:03 — with
GitHub Actions
Inactive
Ying Hua (herohua)
previously approved these changes
Nov 5, 2026
Wenxing Zhu (Wixee)
previously approved these changes
Nov 9, 2026
JiahuiGu (Jiahui-Gu)
dismissed stale reviews from Ying Hua (herohua) and Wenxing Zhu (Wixee)
via
November 10, 2026 08:14
58042ae
Ying Hua (herohua)
previously approved these changes
Nov 13, 2026
JiahuiGu (Jiahui-Gu)
dismissed
Ying Hua (herohua)’s stale review
via
November 13, 2026 06:53
efb4ec2
Ying Hua (herohua)
previously approved these changes
Nov 13, 2026
JiahuiGu (Jiahui-Gu)
dismissed
Ying Hua (herohua)’s stale review
via
November 13, 2026 07:12
06f2a9c
This branch was successfully deployed
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.

Summary
Fix
07-human-in-the-looprepeatedly drafting from the first user message:HumanMessage, preserving structured content.Regression coverage
function_call_outputrevision → approve → new task in the same conversation. Exact model-input assertions prove that feedback is applied to the current draft and neither the old draft nor feedback reaches the next task.CI scope at 06f2a9c
The final PR changes only five files: sample implementation, user README, sample cloud contract, positive runtime test, and one narrowly triggered runtime workflow.
The runtime workflow triggers only on this sample's runtime source, its lifecycle regression, or its own workflow file. It installs pinned uv, runs
uv sync --frozen --python 3.13for the committed sample environment, then directly invokes the runtime regression withuv run --no-sync.There is no runner wrapper or separate wrapper test suite. The existing generic scripts self-test, ADO pipeline/discovery/deployment helpers, skiplists, dependency inputs and locks are unchanged. No failures are hidden through skips or relaxed assertions. Unrelated failing sample jobs are outside this bug-fix PR rather than being patched here.
Validation
git diff --checkpass.58042aeahad a successful frozen GitHub runtime test and ADO discovery explicitly reported only two HITL jobs. These are historical results, not current-head cloud claims.