fix(core): fix two broken reaction sequences (closes #614)#692
Open
marcpineault wants to merge 2 commits intoComposioHQ:mainfrom
Open
fix(core): fix two broken reaction sequences (closes #614)#692marcpineault wants to merge 2 commits intoComposioHQ:mainfrom
marcpineault wants to merge 2 commits intoComposioHQ:mainfrom
Conversation
Two bugs in the lifecycle reaction engine caused silent failures: 1. send-to-agent silently no-ops when message field is missing When a reaction config omits the message field (as in the documented auto-merge.yaml example), the send-to-agent case skipped the send entirely and returned success:false with no log, no notification, and no indication anything was wrong. Added a static fallback message map for the five built-in send-to-agent reaction keys so agents always receive actionable guidance. Added observability traces for failed sends and the no-message/no-fallback edge case. 2. reactionHandledNotify suppressed human fallback even on failure reactionHandledNotify was set to true unconditionally after executing any reaction, even when the reaction returned success:false (e.g. agent unreachable). This silently dropped the event — no agent message, no human notification. Changed to reactionHandledNotify = result.success so a failed reaction still allows the human notification fallback. Both issues together produced the double-failure described in ComposioHQ#614: agent never gets the CI error AND human never gets notified. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Addresses Cursor Bugbot review: SEND_TO_AGENT_FALLBACKS in lifecycle-manager.ts duplicated the default messages from applyDefaultReactions in config.ts, risking silent drift if one is updated without the other. Extract the five default send-to-agent messages into DEFAULT_SEND_TO_AGENT_MESSAGES exported from config.ts. Both applyDefaultReactions and the fallback lookup in executeReaction now reference the same constant, so a single edit keeps both in sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Audit of the reaction engine found two bugs that together produce the double-failure described in #614: the agent never gets the CI error AND the human never gets notified.
send-to-agentsilent no-op whenmessageis missing — When a reaction config omits themessagefield (as in the documentedexamples/auto-merge.yaml), thesend-to-agentcase skipped the send entirely and returnedsuccess: falsewith no log, no notification, and no indication anything went wrong. Added a static fallback message map for the five built-insend-to-agentreaction keys so agents always receive actionable guidance. Addedreaction.executeobservability traces for failed sends and the no-message/no-fallback edge case.reactionHandledNotifysuppressed human fallback even on failure —reactionHandledNotifywas set totrueunconditionally after executing any reaction, even when the reaction returnedsuccess: false(e.g. agent unreachable, send threw). This silently dropped the event with no fallback. Changed toreactionHandledNotify = result.successso a failed reaction still triggers the human notification path.Test plan
send-to-agentwithoutmessageuses fallback (verifies exact "CI is failing" string)send-to-agent(throws) still fires human notificationpnpm buildcleanpnpm typecheckclean🤖 Generated with Claude Code