fix: add error handling for thrown errors - #6
Open
bettercallzaal wants to merge 1 commit into
Open
Conversation
Add catch block to orchestrate() to properly handle and record errors that occur during task processing. Previously uncaught errors would bypass the failed event recording. Add error handling to router defaultClassifier to gracefully handle pattern.matches() throwing an error instead of crashing the entire classification process. Fixes: - Errors from pattern matching, task preparation, or other ops now recorded as failed events instead of propagating uncaught - Router continues to next pattern if one throws, fail-safe behavior
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.
Summary
Added two error-handling fixes to prevent silent failures:
Why it matters
Agent orchestrators must be defensive - errors should be recorded, not swallowed. These fixes ensure the orchestrator remains resilient when patterns or other components fail.
Test status
All 23 tests pass. No security issues detected.