Repository navigation
[FIX][AuctionSwarm.run][Raise when every winning agent fails instead of returning the bid table] - #2493
Open
sakshamchitkara-dotcom wants to merge 2 commits into
Conversation
…of returning the bid table] With no successful winner, run() skipped the award and formatted the conversation, so output_type='final' returned the bid summary as the answer and fallback_swarms never saw a failure. It now raises a RuntimeError chained to the top winner's error; a run with at least one successful winner is unchanged. Fixes kyegomez#2492 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| @@ -0,0 +1,35 @@ | |||
| import pytest | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2492
Problem
If every winning agent fails,
AuctionSwarm.runstill returns normally.successfulstays empty, the award block is skipped, and the swarm formats what is left in the conversation, which is the task and the bid summary. Withoutput_type="final", a provider outage during the work phase comes back as a "successful" run whose answer is"Bids: A=0.9000, B=0.4000". No exception reaches the caller, soSwarmRouter'sfallback_swarmsnever fires. The only trace is a log warning.Change
When no winner produced an answer,
runraisesRuntimeError("[<name>] every winning agent failed"), chained to the top-scoring winner's exception, so the real error stays visible. A run where at least one winner succeeds is unchanged, and failed winners are still skipped with a warning. Therundocstring lists the newRaises. This follows the same direction as #2408, whereAgent.runnow raises after its retries run out instead of returning''.Verification
tests/structs/test_auction_swarm.py(the module had no test file). It stubs the auction and the winners' execution so both winners fail, then asserts theRuntimeErrorand itsprovider downcause. On master it fails withDID NOT RAISEand returns the bid table. It passes here.blackandruffare clean.🤖 Generated with Claude Code