fix: filter non-handler packets before fan-out#956
Merged
Conversation
…hildren When the AI step calls both a handler tool (upsert_event) and a non-handler tool (daily_memory), it produces 2+ DataPackets. The engine fanned ALL of them into child jobs, but only the ai_handler_complete packet carries data the UpdateStep needs. Non-handler packets (tool_result, ai_response) created child jobs guaranteed to fail with 'required_handler_tool_not_called'. Fix: before fan-out, filter to only ai_handler_complete packets. If filtering reduces to ≤1 packet, use inline continuation instead of fan-out. The UpdateStep bandaid (PR #954) is kept as a safety net but should no longer trigger. Result: eliminates ~1,300 dead grandchild jobs/day at the source instead of silencing them downstream.
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
Filter DataPackets before fan-out to only include
ai_handler_completepackets. Non-handler packets (tool_result,ai_response) are dropped before child job creation since no downstream step can use them.Root Cause
When the AI step calls both a handler tool (
upsert_event) AND a non-handler tool (daily_memory), it produces 2+ DataPackets. The engine fanned ALL packets into child jobs, but only theai_handler_completepacket carries data the UpdateStep needs. Thetool_resultpacket created a child job guaranteed to fail.Changes
In
ExecuteStepAbility::routeAfterExecution(), before thefanOut()call:ai_handler_completesource typeImpact