Skip to content

Conversation

@poshinchen
Copy link
Contributor

Description

Setting the invoke_agent span to INTERNAL spanKind to follow the semantic convention.

It is arguable that invoke_agent can be CLIENT in an A2A scenario. However, since invoke_agent is an internal process most of the time, we decided to set the spanKind to INTERNAL.

Related Issues

#1044

Follow up Task

As mentioned, in the A2A world, invoke_agent could be CLIENT spanKind. We will decide whether to allow customer to pass the spanKind for strands agent to set directly, or to have a separate opinionated A2A invoke_agent with CLIENT spanKind.

Documentation PR

N/A

Type of Change

Bug fix
Breaking change

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, or no new docs are needed
  • 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.

@poshinchen poshinchen requested a review from a team October 20, 2025 21:06
mehtarac
mehtarac previously approved these changes Oct 20, 2025
@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

@liustve liustve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we also need to set chat as INTERNAL as well. The chat span itself is still part of the Agent while the client that's actually sending the request to the model boto3 :

span = self._start_span("chat", parent_span, attributes=attributes, span_kind=trace_api.SpanKind.CLIENT)

@poshinchen poshinchen marked this pull request as ready for review October 21, 2025 15:32
@poshinchen poshinchen enabled auto-merge (squash) October 21, 2025 19:28
@poshinchen poshinchen merged commit 78c59b9 into strands-agents:main Oct 21, 2025
13 checks passed
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.

6 participants