Skip to content

fix(workflow): restore node input after tool confirmation - #7738

Open
widechaos wants to merge 1 commit into
google:mainfrom
widechaos:fix/workflow-confirmation-node-input
Open

widechaos wants to merge 1 commit into
google:mainfrom
widechaos:fix/workflow-confirmation-node-input

Conversation

@widechaos

Copy link
Copy Markdown

Link to Issue or Description of Change

Closes #7650. Following the maintainer invitation.

After tool confirmation resumes a workflow, a single-turn LlmAgent loses its transient node input and its model request starts with the workflow message. Restore that input before the node run's earlier events, keeping the confirmation FunctionResponse at the tail. The existing cleanup removes the synthetic event; it is not persisted. Task mode and resumes without matching node history retain their existing behavior.

Testing Plan

  • Added eight public Runner cases covering approval, rejection, repeated confirmations, parallel nodes and default/none include_contents. Original implementation: eight failures; patch: eight passes, independently reproduced during review.
  • All unit tests pass locally.

Complete unit-suite results:

Python Passed Skipped Xfailed Xpassed Failed
3.11 21346 98 18 2 1
3.12 21337 99 18 2 1
3.13 21337 99 18 2 1
3.14 21339 97 18 2 1

Each failure is tests/unittests/integrations/vmaas/test_agent_engine_environment.py::test_reading_directory_raises (expected OSError was not raised). I also reproduced that individual failure on unmodified main in each matching environment; I have not attributed its root cause. Commands: tox -p 2; the completed Python 3.12 rerun used tox -e py312 -o -x 'testenv.commands=pytest tests/unittests -n 2', with no exclusions.

Full pre-commit checks pass. Focused mypy passes; full mypy comparisons in test-extra environments add no errors to main's existing errors, and are not a claim that global typing or remote CI is green.

Manual E2E: An offline public Runner with scripted BaseLlm, FunctionTool requiring confirmation and InMemorySessionService reproduces the issue with socket connections disabled. Run once, return the requested confirmation FunctionResponse, then inspect the resumed model request: the node input leads and the tool response remains last. The same reproduction passes from a built wheel in a fresh environment. No real model/provider validation was performed.

Checklist

  • I have read CONTRIBUTING.md.
  • I have performed a self-review.
  • I have commented the ordering constraint.
  • I have added regression tests.
  • New and existing unit tests all pass locally (baseline failure above).
  • I have manually tested the public Runner flow end-to-end.
  • No dependent downstream changes are required.

Additional context

This addresses confirmation resume only. Ordinary cancellation and multiple confirmations answered in one message are outside this fix.

@google-cla

google-cla Bot commented Oct 26, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

After a tool confirmation resumes a Workflow, an LlmAgent node's model receives the workflow's user message instead of the node's input

2 participants