Skip to content

Conversation

@shikha130vv
Copy link

@shikha130vv shikha130vv commented Oct 31, 2025

Fix task execution result handling when .get attribute or content key is missing

Description

Previously, the code assumed that the task result always had a .get method or a content key, which caused empty or missing outputs when the result object was a plain string or a non-dict type.
This update adds safer handling for different result formats — including plain strings, objects without .get(), and dict-like or strands-style objects — to ensure the output is always correctly normalized into text and metrics.

Related Issues

Documentation PR

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.

Handled diff scenarios in which results might be returned.
@shikha130vv shikha130vv requested a review from a team as a code owner October 31, 2025 08:22
@shikha130vv
Copy link
Author

@mkmeral could you help merge this PR?

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.

1 participant