Skip to content

fix(auto-reply): observe message-tool source replies outside message_tool_only - #305

Merged
convyusboy merged 2 commits into
boonfrom
ridho/eng-18262-widen-message-tool-reply-detection
Oct 22, 2026
Merged

convyusboy merged 2 commits into
boonfrom
ridho/eng-18262-widen-message-tool-reply-detection

Conversation

@convyusboy

@convyusboy convyusboy commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Related: https://linear.app/getboon/issue/ENG-18262

What Problem This Solves

Resolves a problem where, on any channel configured for normal (non-"message tool only") delivery, an agent that correctly followed the sanctioned convention of delivering its visible reply through the message tool and then closing the turn with the silent NO_REPLY token would have that turn misclassified as if nothing had been delivered. On Feishu this produced a contradictory "⚠️ This reply completed without visible content" fallback message on top of content the user already received. The same misclassification fed into WhatsApp's delivery status reaction and a shared "delivery failed" terminal-state signal.

Why This Change Was Made

The one signal that could have recognized this ("a message-tool send satisfied this turn's reply") was hard-gated to only fire in message_tool_only delivery mode, even though the system prompt sanctions the same message-tool-then-NO_REPLY pattern in every mode. This PR widens that signal: a message-tool send now counts as having delivered the turn's own reply on any channel, as long as it both carries visible text or media and resolves to this turn's own chat/thread (verified with the existing target-matching helper used elsewhere for source-delivery decisions, so an unrelated outbound side-effect send to a different chat is not mistaken for the reply). The check is gated on the resolved delivery mode directly rather than the broader delivery-suppression flag, since that flag also covers an unrelated sendPolicy: deny session state that doesn't block the message tool itself — an early version of this fix got that distinction wrong and is covered by a regression test.

No other files were changed. Feishu is the only repo-internal consumer of the specific fallback flag this fixes; Slack keeps its own independent delivery tracking and never reads it, and WhatsApp/Mattermost's existing reads of the shared signal become correct as a side effect rather than needing changes.

User Impact

Users on channels using normal (automatic) delivery mode who are replied to via the message tool will no longer see a confusing duplicate "no visible content" warning after already receiving their answer. This is a low-impact, Feishu-only user-facing fix per the originating ticket.

Evidence

  • pnpm tsgo:core and pnpm tsgo:core:test — clean (no type errors).
  • oxlint and oxfmt --check on both changed files — clean.
  • check:import-cycles — 0 cycles.
  • New tests added for the previously-uncovered gate (agent-runner.misc.runreplyagent.test.ts): 6 cases covering same-chat match, different-chat exclusion, account-id mismatch exclusion, no-visible-content exclusion, no-send-at-all, and the sendPolicy: deny regression. All pass: agent-runner.misc.runreplyagent.test.ts 55/55, dispatch-from-config*.test.ts 258/258, extensions/whatsapp inbound-dispatch 53/53, extensions/feishu full suite 970/970.
  • agent-runner.runreplyagent.e2e.test.ts: 59/61 pass; the 2 remaining failures are pre-existing on current main (an unrelated overflow-fallback message-text mismatch), confirmed by reverting this change locally and re-running before making any edits.
  • Gap: no live/Crabbox Feishu run was performed to visually confirm the fallback message no longer appears. Deferring this given the ticket's own stated priority (Low — Feishu-only, non-urgent); happy to run it if requested before merge.

🤖 Generated with Claude Code


Summary by cubic

Fixes a misclassification where, on channels not using message_tool_only delivery, a turn that delivered its visible reply via the message tool and closed with NO_REPLY was treated as having delivered nothing. On Feishu this caused a contradictory "⚠️ This reply completed without visible content" fallback to appear on top of content the user already received; the same misclassification fed WhatsApp's delivery status reaction and a shared delivery-failed signal.

A message-tool send now counts as this turn's delivered reply on any channel when it carries visible text or media and matches the turn's own chat/thread, verified with the existing sourceDeliveryTargetsMatch helper so an unrelated outbound send to a different chat isn't mistaken for the reply. The check is gated on resolved delivery mode rather than the broader delivery-suppression flag, since that flag also covers sendPolicy: deny sessions that don't block the message tool itself.

Adds regression tests covering same-chat and same-thread match, different-chat, thread, and account-id exclusion, media-only sends, no-visible-content exclusion, no send at all, and the sendPolicy: deny case.

Written for commit 1899c0b. Summary will update on new commits.

View guided diff Turn on auto-fix

…tool_only

Outside message_tool_only, the system prompt still sanctions delivering
visible output via the message tool and closing with NO_REPLY, but no
mode-gated flag observed that delivery. A turn that correctly followed
this convention on any other channel was indistinguishable from a silent
or failed one, so dispatch-from-config.ts's shared observedReplyDelivery
signal never fired for it. This wrongly made Feishu post a contradictory
no-visible-reply fallback on top of content the user already received,
and misclassified the same turns as delivery_failed / undelivered
elsewhere (WhatsApp's status reaction).

Widen the signal: a message-tool send now counts as this turn's delivered
source reply on any channel when it both carries visible text/media and
matches the turn's own chat/thread, verified via the existing
sourceDeliveryTargetsMatch helper. Gate on the resolved delivery mode
directly rather than the broader suppressDelivery flag, since the latter
also covers sendPolicy denials that don't block the message tool itself.

Co-Authored-By: Claude Opus 5 <[email protected]>
@convyusboy
convyusboy requested a review from a team October 22, 2026 10:31

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

cubic analysis

All reported issues were addressed across 2 files

Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.

Linked issue analysis

Linked issue: ENG-18262: Widen message-tool source-reply delivery detection beyond message_tool_only (noVisibleReplyFallbackEligible false-positive)

Status Acceptance criteria Notes
✅ Count visible message-tool replies in any delivery mode Outside message_tool_only mode, the runner observes a send when it has visible content and matches this turn’s target.
✅ Do not count sends to unrelated chats as this turn’s reply The runner checks the send against the current delivery target, with tests excluding different chats and account IDs.
✅ Avoid no-visible-reply fallback after a message-tool delivery A verified delivery triggers the existing observed-delivery callback used to prevent the fallback eligibility signal.

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

@boon-hermes-bot boon-hermes-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Technical approval for head 2af08f8081970670a8a9cd1fa8b9b051d441f2d0.

I found no blocking correctness issue. The new path observes only visible, successfully delivered messaging-tool sends that match the active source channel/chat/thread; the explicit message_tool_only path remains intact, and sendPolicy: deny is handled separately as intended.

Non-blocking coverage notes (already present in the Cubic review threads): runner-level matching/mismatching thread cases would protect the wiring to the existing thread matcher, and a media-only send test would exercise the mediaUrls branch. The shared matcher already has direct thread-matching tests.

Validation: exact-head CI run 39763757161 succeeded; src/auto-reply/reply/agent-runner.misc.runreplyagent.test.ts ran 55 tests, all passed. The exact-head check inventory had 119 successes, 25 skips, 1 neutral result, and 2 cancelled dispatch attempts followed by a successful dispatch; none were failed or pending.

This is the GitHub App's technical approval only. The active ruleset also requires a team reviewer; this bot review does not satisfy that separate gate. Classic branch-protection status requirements are not readable by this integration, so this is not a merge-readiness claim. Auto-merge and the merge queue were disabled at review time.

…message-tool source replies

Addresses two cubic review findings on PR #305: the new observed-delivery
coverage never exercised thread matching/mismatching or a media-only send.

Co-Authored-By: Claude Opus 5 <[email protected]>

@boon-hermes-bot boon-hermes-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Technical approval for exact head 1899c0b.

Reviewed the two-file base-to-head change and its delivery-evidence and target-matching paths. Outside message_tool_only, the new observer requires visible text/media and a same-source chat/thread match; target evidence is recorded only after a successfully delivered messaging result. I found no blocking correctness issue. The earlier thread-isolation and media-only notes are covered by current-head regressions.

Validation: exact-head CI run 39798948170 succeeded. The changed test file ran 58 tests, all passed; its shard completed 17 files / 565 tests successfully. Exact-head check-runs: 118 success, 25 skipped, 1 neutral, 3 cancelled; none pending or failed. No live Feishu/Crabbox test was performed.

This is a technical approval, not merge authorization or a merge-readiness claim. The active ruleset requires a reviewer team (database ID 8602074; the current integration cannot resolve its slug or membership), and classic branch-protection details are inaccessible. Auto-merge and the merge queue were disabled at review time.

@convyusboy
convyusboy merged commit 80b665e into boon Oct 22, 2026
146 of 149 checks passed
@convyusboy
convyusboy deleted the ridho/eng-18262-widen-message-tool-reply-detection branch October 22, 2026 17:02
convyusboy added a commit that referenced this pull request Oct 26, 2026
* chore(release): bump version 2026.6.35-boon.1 -> 2026.6.35-boon.2

Cuts the fork release covering the 9 PRs merged to boon since v2026.6.35-boon.1:
#298 (ENG-21265) stuck-generation cut-off retry + sub-agent spawn backstop,
#299 workspaceDir threading through outbound channel media adapters,
#304 (ENG-19208) real inbound media path in the system prompt,
#301 (ENG-21585) forced sessions_yield on narrated sub-agent turns,
#305 message-tool source reply observed outside message_tool_only,
#306 (ENG-19103) reasoning-stream callbacks honor message_tool_only,
#303 sub-agent/completion-turn usage attribution,
#302 clears 7 high-severity pnpm-audit-prod advisories,
#300 (ENG-21588) boon-estimation trajectory label detail.

Bump root package.json/npm-shrinkwrap.json, all bundled plugin manifests, and
the version + openclaw peer floor in every extension npm-shrinkwrap.json. Add
the 2026.6.35-boon.2 CHANGELOG.md section. No additional dependency or source
changes beyond what already shipped in #299 and #302.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

* docs(changelog): fold PR #309's advisory fixes into the 2026.6.35-boon.2 entry

---------

Co-authored-by: Claude Sonnet 5 <[email protected]>
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.

2 participants