fix(orchestrator): handle exceptions in _promise_action and flush_promises#2432
Open
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Open
fix(orchestrator): handle exceptions in _promise_action and flush_promises#2432Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Wanbogang wants to merge 1 commit intoOpenMind:mainfrom
Conversation
…h_promises - Wrap input_type() construction in try/except to handle invalid enum values or missing parameters from LLM output - Wrap connector.connect() in try/except to handle hardware/network failures - Retrieve and log exceptions from completed tasks in flush_promises() - Add TestActionOrchestratorExceptionHandling with 4 tests covering: connector crash, invalid enum value, partial failure, and missing required parameter scenarios
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
Two silent failure points existed in
ActionOrchestrator:_promise_action()had no exception handling aroundinput_type(**converted_params)andconnector.connect(). Any crash here — invalid enum value from LLM, missing required parameter, or hardware/network failure — would be swallowed silently byasyncio.wait()inflush_promises().flush_promises()never retrieved exceptions from completed tasks. Sinceasyncio.wait()does not re-raise task exceptions, failures disappeared entirely with no log output and no trace.Fix
input_type(**converted_params)in try/except withlogging.exception()— handles invalid LLM output such as unknown enum values or missing required fieldsconnector.connect()in try/except withlogging.exception()— handles hardware disconnect, network timeout, or any runtime failure in the connectorflush_promises()so failed tasks are logged before being discarded