Skip to content

fix(runners): save input blobs as artifacts for LlmAgent roots - #8400

Open
sumedh-aerram wants to merge 1 commit into
google:mainfrom
sumedh-aerram:fix/save-input-blobs-llm-root
Open

sumedh-aerram wants to merge 1 commit into
google:mainfrom
sumedh-aerram:fix/save-input-blobs-llm-root

Conversation

@sumedh-aerram

Copy link
Copy Markdown

Please ensure you have read the contribution guide before creating a pull request.

Link to Issue or Description of Change

Fixes #8399

Problem: A direct LlmAgent root ignores an explicitly enabled RunConfig.save_input_blobs_as_artifacts flag. The same upload is saved when the root is a SequentialAgent.

Solution: Reuse the legacy blob-saving helper before appending node-path user messages. Preserve artifact names, placeholder text, and artifact-service versioning.

Testing Plan

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

python -m pytest tests/unittests/test_runners.py tests/unittests/runners tests/unittests/workflow/test_node_runner_utils.py -q: 382 passed, 1 skipped, 3 xfailed.

Regression tests against upstream before the fix: 36 cases; upstream: 2 failed and 34 passed. Failures are the direct LlmAgent and Workflow roots with saving enabled, an artifact service, and no plugin.

Direct LlmAgent, Workflow, and SequentialAgent roots; true, false, and unset configuration; artifact service present/absent; SaveFilesAsArtifactsPlugin with and without the flag; two turns, exact saved Parts, names, placeholders, version lists, persisted user input, and model input.

Pre-commit passed on both changed files. Mypy passed on the changed source file with no errors; tests are excluded by the repository mypy configuration.

Manual End-to-End (E2E) Tests:

Run the offline issue reproduction. LlmAgent and SequentialAgent each print saved artifacts: 1. This was executed with a scripted model or mocked storage client; no live model or GCS service was called.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

Additional context

This restores existing behavior without changing public signatures or schemas. There are no dependent changes. Live service E2E testing was not performed.

Reuse the legacy upload handling in the node runner message path so explicitly enabled saving preserves artifact names, placeholder parts, and service versioning.

Fixes google#8399
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.

Direct LlmAgent roots ignore save_input_blobs_as_artifacts=True

1 participant