Skip to content

fix(core): fix two broken reaction sequences (closes #614)#692

Open
marcpineault wants to merge 2 commits intoComposioHQ:mainfrom
marcpineault:feat/audit-calm-money-bot-for-any-broken-sequences-or-bugs
Open

fix(core): fix two broken reaction sequences (closes #614)#692
marcpineault wants to merge 2 commits intoComposioHQ:mainfrom
marcpineault:feat/audit-calm-money-bot-for-any-broken-sequences-or-bugs

Conversation

@marcpineault
Copy link

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-agent silent no-op when message is missing — When a reaction config omits the message field (as in the documented examples/auto-merge.yaml), the send-to-agent case skipped the send entirely and returned success: false with no log, no notification, and no indication anything went wrong. Added a static fallback message map for the five built-in send-to-agent reaction keys so agents always receive actionable guidance. Added reaction.execute observability traces for failed sends and the no-message/no-fallback edge case.

  • reactionHandledNotify suppressed human fallback even on failurereactionHandledNotify was set to true unconditionally after executing any reaction, even when the reaction returned success: false (e.g. agent unreachable, send threw). This silently dropped the event with no fallback. Changed to reactionHandledNotify = result.success so a failed reaction still triggers the human notification path.

Test plan

  • New test: send-to-agent without message uses fallback (verifies exact "CI is failing" string)
  • New test: failed send-to-agent (throws) still fires human notification
  • Existing 30 lifecycle-manager tests still pass (32 total, no regressions)
  • pnpm build clean
  • pnpm typecheck clean
  • No lint errors in changed files

🤖 Generated with Claude Code

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>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant