Skip to content

fix(connectors): NO_REPLY can't silence a bot's real answer to a Slack DM - #46182

Merged
AmethystLiang merged 6 commits into
mainfrom
AmethystLiang/slack-dm-no-reply
Nov 21, 2026
Merged

AmethystLiang merged 6 commits into
mainfrom
AmethystLiang/slack-dm-no-reply

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When you DM your bot in Slack and it writes you a real answer, that answer reaches you now, even when the bot ends it with its "nothing to say" marker (NO_REPLY). A reply that is only the marker stays silent, as before.

Files Added Deleted Net
Test 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​883 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​872
Prod 15 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​312 $\color{#cf222e}{\Huge{\mathbf{−}}}$​79 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​233

What Changed

  • Before: a bot reply whose last word was NO_REPLY was treated as silence, whatever came before it. Two real DM answers were dropped this way.
  • After: in the bot owner's own Slack DM, the words before the marker post with the marker stripped. A bare marker (however dressed: > NO_REPLY, - NO_REPLY) stays quiet, and a quoted mention ending a sentence (Use NO_REPLY) is kept as written. A member's DM, threads the bot only follows, mail, items and automations keep today's rule. The bot's preamble says so.
  • Mechanism:

Why

On 2026-11-20 a bot's two DM answers were silenced: 22:41Z (a DM steered into a turn worker mail had opened) and 23:55Z (a turn the DM opened). Both ended with NO_REPLY, a habit carried over from its mail turns. Checked against how comparable products handle this: a silence token silences only a reply that is nothing but the token.

Routing results of DM-started work back to the DM is a separate follow-up PR.

Linked Issue

N/A (internal).

Visual Proof

N/A: no UI change. This decides which Slack reply text is posted, and the tests below cover it.

Testing

  • Automated tests added/updated
  • Every added test fails without this change. 9 assertions were run against main and fail there, including both real cases with the bot's actual words.
  • Covered: per-row decision (DM answered, same-turn thread stays quiet), recovery agreeing with the live fill, the three-state turn end, legacy DM words, a fill that threw posting no words, and a merged-quiet DM posting once.
  • typecheck:node, pnpm lint, and the external-conversations / connector-cloud / shared journal and connectors suites pass locally (macOS).

Performance

None, because it adds no reads or writes: just one string parse of a conversation id per reply row at turn end.

Risk

An owner-DM answer the bot meant to keep quiet, but wrote words before the marker, now posts. That is intended, and the preamble now says so. A restart or usage-limit continuation's claimed row takes its owner proof from its own admitting message in the journal, so the owner's DM is answered on the resume leg too, queued DMs included (no schema change). A row boot recovery already answered for the same turn also counts, so no merged-quiet stand-in goes out beside the words. Known limits, accepted: a numbered-list marker (1. NO_REPLY, 1) NO_REPLY) posts 1. to the owner's DM, an unclosed code fence before the marker leaves the fence text posted, and a bare marker followed by a backtick-quoted one on the same line posts both. Thread, mail and automation behavior is unchanged. Back out with a plain revert.

Level: Low

Review

Agent skill upstream boundary

  • Not applicable.

@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds Slack direct-message classification and reply-word handling for trailing NO_REPLY markers. Reply fills determine outcomes and prose for each conversation row. Turn-ending logic returns told, not-covered, or unsafe, and ChatTurns uses the result to select legacy message words and failure data. Tests cover reply fills, recovery, Slack DM classification, and turn-ending statuses.

Merge Risk: Low · previous review 611a3

In the owner's Slack DM, the bot's real answer is now posted with a trailing NO_REPLY removed. Two minor edge cases remain. A repeated marker whose second marker is backtick-quoted can post the raw markers as an answer. After a pause and recovery, an owner's answer can possibly be accompanied by a quiet-turn notice. Both are narrow and have no data-loss impact, so the change is mergeable with owner awareness.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a NO_REPLY marker no longer silences a bot's real answer in a Slack DM. The changeset implements this, including the per-row decision, the DM detection, and the bot pr…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is detailed and covers the ELI5, what changed (before/after and mechanism), why, testing, performance, and risk with a level and backout plan. It is missing several template items: the…
Full details: Title check

Explanation

The title names the main change: a NO_REPLY marker no longer silences a bot's real answer in a Slack DM. The changeset implements this, including the per-row decision, the DM detection, and the bot preamble update. The title uses the conventional fix(connectors) prefix and is specific.

Full details: Description check

Explanation

The description is detailed and covers the ELI5, what changed (before/after and mechanism), why, testing, performance, and risk with a level and backout plan. It is missing several template items: the Linked Issue section says N/A (internal) rather than a linked issue, the Visual Proof section is N/A with a reason, the Review section is empty, the AI Disclosure section is absent, and the checklist and the 'Ensure no issues in' notes are not addressed. The 'Testing' checklist item for manual testing is not checked, and the template's 'Every added test fails without this change' item is claimed. Overall the description is mostly complete, so it passes, with minor gaps noted.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 24e06a8e-3c4f-410a-96b7-96bfd53d526b
Commits

Reviewing files that changed from the base of the PR and between 630f05f and 611a34f.

Files selected for processing: 10

  • src/main/external-conversations/connector-reply-restart-matrix.test.ts
  • src/main/external-conversations/external-conversation-reply-fill-dm.test.ts
  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/external-conversations/external-conversations-install.ts
  • src/main/native-chat/agent-session-journal/journal-domain-entity-read.ts
  • src/main/native-chat/agent-session-journal/journal-domain-submission-records.ts
  • src/main/native-chat/agent-session-journal/journal-reads.ts
  • src/main/native-chat/agent-session-journal/journal-sql-point-read-types.ts
  • src/main/native-chat/agent-session-journal/journal-sql-reads.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/slack-dm-no-reply branch from e3081cf to e487d17 Compare November 21, 2026 06:46

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 40e1774e-9577-48f5-8b9a-e2b193bdc2da
Commits

Reviewing files that changed from the base of the PR and between e3081cf and e487d17.

Files selected for processing: 10

  • src/main/bots/bot-preamble.ts
  • src/main/external-conversations/external-conversation-dm-turns.test.ts
  • src/main/external-conversations/external-conversation-ended-turn.ts
  • src/main/external-conversations/external-conversation-reply-fill-dm.test.ts
  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/external-conversations/external-conversation-reply-recovery.test.ts
  • src/main/external-conversations/external-conversation-turn-ends.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.test.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.ts
  • src/shared/bot-quiet-result.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment thread src/shared/bot-quiet-result.ts Resolved
…k DM

- A bot's reply to a Slack DM with words before NO_REPLY now posts those words, the trailing
  marker stripped; a reply that is only the marker stays quiet. Threads the bot follows, mail,
  items and automations keep today's rule. Decided per reply row (connectorReplyTurnOutcome),
  so the live outbox fill and boot recovery agree. A DM is read from the conversation id the
  cloud sets (Slack source only), never from message text.
- endRepliedTurn reports 'told' | 'not-covered' | 'unsafe'. The legacy turn end posts a DM's
  stripped words only when the journal stamps prove the turn answered that DM and no outbox
  row can also post them (mostly defensive since #46044 ends stamped Slack turns state-only).
- The merged-quiet fallback (#46062) no longer fires for a DM whose words now post, so the DM
  gets one post.
… and only the protocol marker goes

- C1-3: the marker loses its silence only for a delivery the bot's owner sent (the journal's asker
  role, marked on the turn's stamps); a member's DM, even one steered into item or worker mail,
  keeps today's rule. The preamble tells the bot the owner's DM posts the words before the marker.
- C1-1/C1-2: addressedBotWords strips every trailing marker but keeps a quoted mention ending a
  sentence (Use `NO_REPLY`), and a rest with no letter or digit (`> NO_REPLY`, `- NO_REPLY`) stays
  quiet.
- C1-4: the legacy DM-words branch is owner-gated too and documented as reachable only without a
  reply outbox; a test pins that with an outbox it never posts the words.
@AmethystLiang
AmethystLiang force-pushed the AmethystLiang/slack-dm-no-reply branch from e487d17 to 39ed368 Compare November 21, 2026 07:09
…r proof

A continuation (usage-limit pause, restart) answers rows its claim names, and those stamps carry no
asker, so the owner's DM answer ending in NO_REPLY was filled quiet again on the resume leg. The
fill now reads an unmarked DM row's admitting message (journalReads.submissionBody(row.messageId))
for its asker, with nothing new persisted, so live fill and boot recovery decide alike. A delivery
seen twice in a turn's stamps keeps the owner's mark (stamps are copies, never journal objects), and
rows that answered with words get no merged-quiet stand-in.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8e8cfb6c-75fa-45d5-8162-934ae9276058
Commits

Reviewing files that changed from the base of the PR and between 39ed368 and 630f05f.

Files selected for processing: 8

  • src/main/connector-cloud/connector-reply-outbox.test.ts
  • src/main/external-conversations/connector-reply-restart-matrix.test.ts
  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/external-conversations/external-conversation-turn-ends.test.ts
  • src/main/external-conversations/external-conversation-turn-ends.ts
  • src/main/external-conversations/external-conversations-install.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.test.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

…e, and askers are read only when needed

- A delivery to a busy chat is queued: its outbox row keeps the queue card's id, and the card is
  handed over as a new send. submissionBody gains an opt-in `family` read (the current send whose
  admission family is that card), used only by the fill's owner read, so a queued owner DM is
  answered after a pause and continue too; a member's queued DM stays quiet.
- journalAskedByOwner is the one production adapter (install and the restart matrix both use it).
- The fill reads askers only for a successful bot turn whose prose ends with the marker.
- Tests: queued owner/member through pause and continue on the real journal, the adapter, a
  member duplicate never marked owner, a quiet answer not counted as answered.
…t as answered

When boot recovery fills a turn's owner-DM row before its live end, the live fill skips that row,
so its conversation was missing from 'answered' and a merged-quiet stand-in could go out beside the
words. Rows whose stored fill is this turn's answered outcome now count too.
…row was sent

Boot recovery and the live end fill through the same function, and a sent row is deleted, so the
live end could miss an answer recovery already sent and post the merged-quiet stand-in beside it.
The fill keeps, in memory and bounded to recent turns, the conversations each turn answered with
words, and seeds 'answered' from it.
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