Skip to content

fix(a2a_client): surface error returns as tool errors through @tool decorator - #607

Open
alisknox wants to merge 1 commit into
strands-agents:mainfrom
alisknox:fix/a2a-send-message-error-status
Open

alisknox wants to merge 1 commit into
strands-agents:mainfrom
alisknox:fix/a2a-send-message-error-status

Conversation

@alisknox

Copy link
Copy Markdown

Description

Error returns from a2a_send_message (and other A2AClientToolProvider methods) included status='error' but no content key. The @tool decorator's _wrap_tool_result only preserves error status when both status and content keys are present. Without content, the error dict was wrapped as status='success' text content, preventing downstream hooks and middleware from detecting tool failures.

Add content key to all error returns while preserving existing keys for backward compatibility.

Related Issues

Fixes #606

Documentation PR

None

Type of Change

Bug fix

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ecorator

Error returns from a2a_send_message (and other A2AClientToolProvider
methods) included status='error' but no 'content' key. The @tool
decorator's _wrap_tool_result only preserves error status when both
'status' and 'content' keys are present. Without 'content', the error
dict was wrapped as status='success' text content, preventing downstream
hooks and middleware from detecting tool failures.

Add 'content' key to all error returns while preserving existing keys
for backward compatibility.

Fixes strands-agents#606
@alisknox
alisknox requested a review from a team as a code owner September 15, 2026 23:45
@alisknox
alisknox requested a review from mkmeral September 15, 2026 23:45

This branch is waiting to be deployed

1 waiting deployment
manual-approval 23d00a14 Waiting Sep 15, 2026 by alisknox via check-access-and-checkout #608
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.

[BUG] A2AClientToolProvider errors not surfaced as tool errors through @tool decorator

1 participant