Skip to content

Keep a quiet Slack bot reply quiet when Orca restarts mid-upgrade - #48164

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-17795-quiet-reply-upgrade
Nov 24, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/sta-17795-quiet-reply-upgrade

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

A recent change (#47896) made a Slack bot post the words it writes before a trailing NO_REPLY, instead of staying silent. A reply that was already waiting when someone upgraded Orca could then be posted under that new rule, although it was admitted under the old one (stay silent, except in the bot owner's own DM). Now each waiting reply remembers the rule from when its request was admitted, and the restart path follows it. New requests keep #47896's behavior.

What Changed

  • Before: a bot turn in a Slack thread (or a member's DM) that began on the older build and ended with Checked it. NO_REPLY stayed silent if it finished live. If Orca restarted to upgrade before the reply was filled, the new build's recovery applied the new rule and posted "Checked it." to Slack.
  • After: each pending Slack reply records the quiet-marker rule in effect when it was admitted (quiet_rule, a column added the same way as the table's earlier additions; older builds ignore it). Recovery and the live fill honor it. A row with no record keeps the older rule: the marker silences the whole reply, except to the bot's owner in their own DM (read from the admitting message, as before fix(connectors): a bot's words before a trailing NO_REPLY post in every Slack conversation #47896). New turns keep fix(connectors): a bot's words before a trailing NO_REPLY post in every Slack conversation #47896's behavior. All pending replies to one conversation in a turn share one answer, so they follow the rule of the turn's earliest reply there.

Why

The rule should be the one in effect when the request was admitted, not whichever build happens to finish it. Recording it on the pending row is the only place both the live fill and post-restart recovery read.

Linked Issue

N/A (maintainer).

Visual Proof

N/A: no UI change. The change decides whether a Slack reply is sent; it is covered by the restart test below with simulated messages.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

Added an upgrade-restart case to connector-reply-restart-matrix.test.ts on a real journal file: a reply admitted under the older rule, a restart, then recovery. Without the fix it fills answered with "Checked it."; with it, quiet. A row admitted by this build still posts the words.

Performance

None, because the only added work is one owner lookup per older-build DM row, and only when a bot's turn ends with the quiet marker.

Risk

Saved data: one nullable column on the reply table; older builds never read it. Worst case if wrong: a reply from the older build stays quiet when its words would now be posted. Known trade-off: hourly team builds cut from main after #47896 and before this fix also leave the rule unrecorded. On upgrade from one of those builds, a pending "words + NO_REPLY" reply stays quiet instead of posting its words. It fails toward the older silent behavior, never toward posting. Back out with a plain revert (the column stays, unused).

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan (head 29c852853559): clean, no findings.

  • Trigger: a Slack bot turn's end (live fill) or boot recovery, once per ended turn, not per keystroke, status update or poll.
  • Added work: one nullable column written with each Slack admission and read with each row (no extra query). One owner lookup (a journal submission-body read) per older-build DM row, only when a bot turn ends with the quiet marker. That set is fixed at upgrade time: new rows never reach it, so it goes to zero as older rows drain.
  • Schema: one more pragma_table_info check at journal open (constant, boot only).
  • Regression classes: none of the classes match (no store writes, selectors, timers, subprocesses, renderer code or fan-out). Idle wakeups: 0 before and after.
  • Six questions: 1, 2, 4 and 6 do not apply (no producer/subscriber, owner, growth or lifetime change). 3: the work runs on the existing journal writer/reader, same as before. 5: no host-specific code.
  • perf-surface-detect: [].

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Connector reply rows now record whether they use the trailing quiet-marker rule. Recovery uses this value to distinguish current rows from legacy rows when processing bot replies. For legacy rows, owner-authored Slack direct messages are exempt from whole-reply silencing. The installation provides an owner-attribution lookup, and restart tests cover legacy and current rows.

Merge Risk: Minimal · up to a456f

Quiet Slack replies now record their rule at admission, so restart recovery follows the rule in effect when each reply was admitted. The one remaining trade-off is that replies from a narrow window of intermediate builds stay silent rather than posting their words, and this was accepted. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a quiet Slack bot reply stays quiet when Orca restarts during an upgrade. The changeset records a quiet-marker rule on pending reply rows so that live fill and restart…
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 follows the repository template and covers ELI5, What Changed, Why, Linked Issue (N/A for maintainer), Visual Proof (N/A with reason), Testing, Performance, Risk with level and rollbac…
Full details: Title check

Explanation

The title names the main change: a quiet Slack bot reply stays quiet when Orca restarts during an upgrade. The changeset records a quiet-marker rule on pending reply rows so that live fill and restart recovery apply the rule in effect when the reply was admitted. The title is specific and matches the summarized changes and the stated objectives.

Full details: Description check

Explanation

The description follows the repository template and covers ELI5, What Changed, Why, Linked Issue (N/A for maintainer), Visual Proof (N/A with reason), Testing, Performance, Risk with level and rollback, and the checklists. It explains the mechanism (a quiet_rule column recorded on pending rows) and the trade-off for builds cut between #47896 and this fix. The Testing section names the restart matrix test and its expected outcomes. The AI Disclosure section is left empty, but the template says maintainers may skip it, and the author is a maintainer per the Linked Issue note. The Performance section is a one-line answer with a reason. Only minor gaps remain.

  • 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: 0e9ee984-9f38-4daa-bc7b-e306975d2860
Commits

Reviewing files that changed from the base of the PR and between 45c95d8 and a456fa6.

Files selected for processing: 3

  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies-schema.test.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; 1 remain after this review.

@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: 8776ab10-dfbd-4d87-b230-0ed0ef3c77a8
Commits

Reviewing files that changed from the base of the PR and between 75d8321 and 29c8528.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 8

  • src/main/external-conversations/connector-reply-restart-matrix.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/connector-replies/journal-connector-replies-read.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies-schema.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies.ts
  • src/shared/agent-session/journal/journal-connector-reply-turn.ts
  • src/shared/agent-session/journal/journal-connector-reply.ts

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

@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: 461aca13-e81f-4e5b-8636-542b68816c52
Commits

Reviewing files that changed from the base of the PR and between 29c8528 and ef3f90b.

Files selected for processing: 1

  • src/main/external-conversations/external-conversation-reply-fill.ts

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan (head ef3f90b8f2f9): clean, no findings.

  • Trigger: a Slack bot turn's end (live fill) or boot recovery, once per ended turn, not per keystroke, status update or poll.
  • Added work: one nullable column written with each Slack admission and read with each row (no extra query). At most one owner lookup (a journal submission-body read) per conversation, for older-build DM rows,, only when a bot turn ends with the quiet marker. That set is fixed at upgrade time: new rows never reach it, so it goes to zero as older rows drain.
  • Schema: one more pragma_table_info check at journal open (constant, boot only).
  • Regression classes: none of the classes match (no store writes, selectors, timers, subprocesses, renderer code or fan-out). Idle wakeups: 0 before and after.
  • Six questions: 1, 2, 4 and 6 do not apply (no producer/subscriber, owner, growth or lifetime change). 3: the work runs on the existing journal writer/reader, same as before. 5: no host-specific code.
  • perf-surface-detect: [].

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Regression audit (fresh, blinded) on head ef3f90b8f2f9: SAFE, no must-fix issues. It agrees the unrecorded-rule trade-off above is acceptable because it fails toward silence.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan (head 45c95d8e0d4b): clean, no findings.

  • Trigger: a Slack bot turn's end (live fill) or boot recovery, once per ended turn, not per keystroke, status update or poll.
  • Added work: one nullable column written with each Slack admission and read with each row (no extra query). At most one owner lookup (a journal submission-body read) per conversation, for older-build DM rows, only when a bot turn ends with the quiet marker. That set is fixed at upgrade time: new rows never reach it, so it goes to zero as older rows drain.
  • Schema: one more pragma_table_info check at journal open (constant, boot only).
  • Regression classes: none of the classes match (no store writes, selectors, timers, subprocesses, renderer code or fan-out). Idle wakeups: 0 before and after.
  • Six questions: 1, 2, 4 and 6 do not apply (no producer/subscriber, owner, growth or lifetime change). 3: the work runs on the existing journal writer/reader, same as before. 5: no host-specific code.
  • perf-surface-detect: [].

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Regression audit (fresh, blinded) on head 45c95d8e0d4: SAFE, no must-fix issues. It agrees the trade-off in the description is acceptable because it fails toward silence.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan (head a456fa601144): clean, no findings.

  • Trigger: a Slack bot turn's end (live fill) or boot recovery, once per ended turn, not per keystroke, status update or poll.
  • Added work: one nullable column written with each Slack admission and read with each row (no extra query). At most one owner lookup (a journal submission-body read) per conversation, for older-build DM rows, only when a bot turn ends with the quiet marker. That set is fixed at upgrade time: new rows never reach it, so it goes to zero as older rows drain.
  • Schema: one more pragma_table_info check at journal open (constant, boot only).
  • Regression classes: none of the classes match (no store writes, selectors, timers, subprocesses, renderer code or fan-out). Idle wakeups: 0 before and after.
  • Six questions: 1, 2, 4 and 6 do not apply (no producer/subscriber, owner, growth or lifetime change). 3: the work runs on the existing journal writer/reader, same as before. 5: no host-specific code.
  • perf-surface-detect: []. The conversation rule is read from the turn's own rows, already loaded, with at most one owner lookup per conversation.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status for a456fa601144

Problem: after #47896, a Slack bot's words before a trailing NO_REPLY get posted. A reply that was still waiting when Orca restarted for an upgrade could be posted by recovery under that new rule, although it was admitted under the older one (silent, except in the owner's own DM).

User-facing change: waiting replies keep the rule from when their request was admitted. New requests keep #47896's behavior.

Fixed during review:

  • All pending replies in one conversation share one rule, taken from the conversation's head row.
  • At most one owner lookup per conversation.
  • The PR description wording now says "admitted" and mentions the owner's-DM exception.

Accepted limit: hourly team builds cut from main between #47896 and this fix record no rule, so their waiting replies are filled quiet after upgrading, or after a downgrade-then-upgrade. Nothing on the row separates them from released builds. #47896 is in no release tag. The blinded audit flagged this. A fresh confirm reviewer, given the facts, agreed it is a bounded, dev-build-only limit, not a regression for released users, and that it fails toward the older quiet behavior.

Verified:

  • Restart test on a real journal file: fails without the fix (posts "Checked it."), passes with it.
  • Schema upgrade test: older rows read as the older rule, new rows record trailing.
  • Rule test for the reply outcome.
  • Remote check passes; CI is green.
  • Claude reviewer: no P0 or P1.
  • Codex: blinded audit plus confirm, as above.
  • Perf-scan: clean.
  • References: t3code and bb have no bot quiet marker or persisted reply outbox. The closest is CowAgent's [SILENT] verdict, which strips the token per run and has no stored state that crosses upgrades. No counterpart to adopt.

QA: tests only. No screen changes, and the restart and upgrade path runs end to end in the restart test over the real journal, recovery and fill.

Deferred: a code comment in the reply fill still says "turn began"; it should say "admitted". It's left as is because changing it would make the audit stale.

@brennanb2025
brennanb2025 merged commit f1abeca into main Nov 24, 2026
58 checks passed
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