Skip to content

fix(swarm): extract content from AgentResult.message instead of non-existent .content#511

Open
wangwangbobo wants to merge 1 commit into
strands-agents:mainfrom
wangwangbobo:fix/swarm-agent-result-content-extract
Open

fix(swarm): extract content from AgentResult.message instead of non-existent .content#511
wangwangbobo wants to merge 1 commit into
strands-agents:mainfrom
wangwangbobo:fix/swarm-agent-result-content-extract

Conversation

@wangwangbobo

Copy link
Copy Markdown
Contributor

Problem

The swarm tool silently drops ALL sub-agent output. The 'Individual Agent Contributions' section is always empty despite sub-agents producing output (visible in token counts).

Root Cause

The code checks hasattr(node_result.result, "content") but AgentResult has .message (a dict with a "content" key), not .content directly. The hasattr() check always returns False, so the entire extraction block is silently skipped.

Fix

  • Check for .message attribute instead of .content
  • Extract content blocks from .message.get("content", [])
  • Applied to both individual contributions and final team result sections

Fixes #437

Changes

  • 1 file changed, 4 insertions(+), 4 deletions(-)

…xistent .content

AgentResult has .message (a dict with 'content' key), not .content directly.
The hasattr check always returned False, silently dropping ALL sub-agent output.

Fixes strands-agents#437
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] Swarm tool silently drops all sub-agent output

1 participant