You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agentflow): prevent ConditionAgent silent failure when no scenario matches (#5760)
* fix(agentflow): prevent ConditionAgent from silently dropping when no scenario matches
the ConditionAgent was doing strict exact string matching against
scenario descriptions, but LLMs often return abbreviated or slightly
different versions of the scenario text. when nothing matched, all
branches got marked as unfulfilled and the flow silently terminated
with no response.
added fallback matching (startsWith, includes) so partial matches
still route correctly, plus a last-resort else branch so the flow
never just dies silently. also added a safety net in the execution
engine to catch the case where all conditions are unfulfilled.
fixes#5620
* refactor: normalize output once and drop unnecessary any casts
- normalize calledOutputName once before all matching steps instead of
calling toLowerCase().trim() repeatedly
- remove explicit any types where inference handles it
* test(agentflow): cover ConditionAgent scenario matching fallbacks
* Update matchScenario.test.ts
* Update matchScenario.ts
---------
Co-authored-by: Henry Heng <henryheng@flowiseai.com>
0 commit comments