Skip to content

fix(analytics): log error-bearing tool results as TOOL_ERROR - #7114

Open
Zsanz3 wants to merge 1 commit into
google:mainfrom
Zsanz3:cursor/bqaa-tool-error-result-241d
Open

Zsanz3 wants to merge 1 commit into
google:mainfrom
Zsanz3:cursor/bqaa-tool-error-result-241d

Conversation

@Zsanz3

@Zsanz3 Zsanz3 commented Sep 14, 2026

Copy link
Copy Markdown

Fixes #7112

Summary

BigQueryAgentAnalyticsPlugin.after_tool_callback was logging error-bearing tool results as TOOL_COMPLETED / OK. It now classifies results with isError / error_details as TOOL_ERROR (aligned with on_tool_error_callback).

Changes

  • Detect error_details, isError / is_error; prefer MCP content[0].text for error_message when present
  • Focused unit test with mocked _log_event covering MCP isError and error_details
  • Diff kept tiny; no ReflectAndRetry changes

Tests

pytest tests/unittests/plugins/test_bigquery_agent_analytics_plugin.py -q

@google-cla

google-cla Bot commented Sep 14, 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.

@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Sep 15, 2026
after_tool_callback logged every tool result as TOOL_COMPLETED with
status OK, including MCP CallToolResult isError payloads and results
that carry error_details. Classify those as TOOL_ERROR so status and
error_message match on_tool_error_callback.

Fixes google#7112

Co-authored-by: Zsanz3 <Zsanz3@users.noreply.github.com>
@cursor
cursor Bot force-pushed the cursor/bqaa-tool-error-result-241d branch from 4713972 to dd3206b Compare September 15, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

request clarification [Status] The maintainer need clarification or more information from the author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BigQueryAgentAnalyticsPlugin records error-bearing tool results as TOOL_COMPLETED with status OK

4 participants