Skip to content

Conversation

@cparnell-scope3
Copy link
Collaborator

@cparnell-scope3 cparnell-scope3 commented Jan 26, 2026

Summary

Bug: When using AgentCollection methods (e.g., allAgents().getProducts()) across multiple agents, if any single agent threw an exception, Promise.all would reject immediately and discard all results—even from agents that succeeded.

Fix: Replace Promise.all with Promise.allSettled so that:

  • All agent calls complete independently (success or failure)
  • Successful agents return their results normally
  • Failed agents return a TaskResult with success: false, the error message, and agent metadata

Changes:

  • Add executeAllSettled private method for consistent partial failure handling
  • Update all AgentCollection task methods to use executeAllSettled
  • Update execute() to return PromiseSettledResult[] for custom executors
  • Add unit tests covering partial failure scenarios

Test plan

  • Build passes (npm run build)
  • New unit tests pass for partial failure scenarios
  • Verify successful agents return results when one agent fails
  • Verify failed agent results contain error message and metadata
  • Verify execute() returns PromiseSettledResult array

AgentCollection methods now use Promise.allSettled instead of Promise.all,
allowing successful agent results to be returned even when some agents fail.
Failed agents return a TaskResult with success=false and error details.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Jan 26, 2026

All contributors have agreed to the IPR Policy. Thank you!
Posted by the CLA Assistant Lite bot.

@cparnell-scope3
Copy link
Collaborator Author

I have read the IPR Policy

@cparnell-scope3 cparnell-scope3 marked this pull request as ready for review January 26, 2026 17:18
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.

2 participants