Skip to content

fix(web): avoid eval history crash when toolUses is null#4660

Open
pandego wants to merge 1 commit intogoogle:mainfrom
pandego:fix/4657-eval-history-tooluses-null-guard
Open

fix(web): avoid eval history crash when toolUses is null#4660
pandego wants to merge 1 commit intogoogle:mainfrom
pandego:fix/4657-eval-history-tooluses-null-guard

Conversation

@pandego
Copy link

@pandego pandego commented Feb 28, 2026

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

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

2. Or, if no issue exists, describe the change:

Problem:
Failed eval history entries can crash the web UI when intermediateData.toolUses is missing/null. formatToolUses currently iterates directly over that value and throws TypeError: e is not iterable.

Solution:
Add a null guard in formatToolUses so missing toolUses is treated as an empty list.

Testing Plan

Unit Tests:

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

Passed locally:

  • .venv/bin/pytest tests/unittests/evaluation/test_eval_config.py
  • Result: 7 passed

Manual End-to-End (E2E) Tests:

Not run in this environment. This patch is a minimal defensive guard on the affected formatter path.

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 is intentionally minimal (1-line behavior change) to reduce risk and keep review focused.

@gemini-code-assist
Copy link
Contributor

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

@adk-bot adk-bot added the web [Component] This issue will be transferred to adk-web label Feb 28, 2026
@rohityan rohityan self-assigned this Mar 3, 2026
@rohityan rohityan added the needs review [Status] The PR/issue is awaiting review from the maintainer label Mar 3, 2026
@rohityan
Copy link
Collaborator

rohityan commented Mar 3, 2026

Hi @pandego ,Thank you for your contribution! We appreciate you taking the time to submit this pull request. Your PR has been received by the team and is currently under review. We will provide feedback as soon as we have an update to share.

@rohityan
Copy link
Collaborator

rohityan commented Mar 3, 2026

Hi @wyf7107 , can you please review this.

@pandego pandego force-pushed the fix/4657-eval-history-tooluses-null-guard branch 2 times, most recently from 67459c2 to d1241b4 Compare March 5, 2026 15:59
@pandego pandego force-pushed the fix/4657-eval-history-tooluses-null-guard branch from d1241b4 to 00d791d Compare March 16, 2026 00:34
@pandego
Copy link
Author

pandego commented Mar 16, 2026

Refreshed this branch onto current main and force-pushed.

The original change was targeting an older generated browser bundle file. I ported the null guard to the active bundle referenced by src/google/adk/cli/browser/index.html so the eval history path no longer crashes when toolUses is missing.

Validation run:

  • uv run pytest tests/unittests/cli/utils/test_cli_eval.py tests/unittests/cli/utils/test_evals.py -q

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review [Status] The PR/issue is awaiting review from the maintainer web [Component] This issue will be transferred to adk-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Playground eval history: clicking failed eval result crashes with 'e is not iterable' in formatToolUses

3 participants