mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-10-17 05:35:31 +02:00
Found while testing per-call human-in-the-loop (langchain-ai/langchain#41062). The code depends only on #9232, which is already on `main`. When one answer in a multi-answer resume fails `response_schema` validation, the runner cancelled the other tasks in the step, so in async runs a task cut off after its side effect kept its saved answer and ran again on the next resume. Invalid resume values (already tagged by `is_invalid_resume` from #9232) no longer stop the other tasks: the error is raised once they finish, so their results are saved. Hit by per-call human-in-the-loop: approving one tool call while giving another an invalid edit, in one resume, sent the approved call's email twice once the second answer was fixed. ## How to verify - `test_invalid_resume_lets_other_answered_tasks_finish` fails on `main` (the approved task is still pending after its side effect) and passes with this change. Like the other async interrupt tests, it is skipped before Python 3.11, where async nodes can't call `interrupt()`. - The per-call HITL reproduction against this branch: the approved async tool runs once (twice on `main` whenever it awaits after its side effect). - `make lint` passes. With `NO_DOCKER=true`, the full `libs/langgraph` suite has the same failures as `main` locally (`test_prebuilt_tool_chat` and `test_stream_mode_messages_command`, sync and async), and nothing new.