Fix notification regressions from #527 (bugfix) #544
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #544"
general
weight: 0.35
Giton22
Follow-up to #527, which merged without Reviewer's review fixes. This carries those fixes, rebased onto what merged in fac6d963 and on current master. Each commit is one regression or gap found in the review, with its test. Every new test fails without its fix (checked by reverting each fix locally) and passes with it.
Fixes
1. Notifications: a Bot Chat silence no longer re-sends the previous reply. On a legacy (tui_gateway) gateway, Bot Chat's
message.completeis{"text": ""}for a silence (tui_gateway/prompt_turn.py_bot_mode_delivery_text). The reducer drops the turn's empty bubble, so the old reply is last again and was notified a second time.Test:
ReplyActivityTest.aBotChatSilenceDoesNotBringBackThePreviousReply,aTurnsOwnReplyIsNew.2. Notifications: a watched turn that ended before the attach still says it finished.
SessionWatcherhas no reply text for such a turn. #527's early return inpostReplydropped that notification.WatchedTurnEnd.textis now nullable, where null means not known, and that case says "Finished.". An empty text that was at hand (a silence) still posts nothing.Tests:
SessionWatcherTest.aTurnThatEndedBeforeTheAttachStillSaysItFinished(updated),ChatNotificationsTest.aWatchedTurnWhoseReplyWasntAtHandSaysItFinished,aWatchedTurnThatEndedInSilenceStaysUntold.3. Notifications: a reply read back on a reconnect is still told. On a reconnect,
loadHistory()publishes the finished reply whilerunningis still true, so the check against the state just before the end suppressed a real reply. The check now compares with the chat as it was when the turn started, on Android (ChatNotifier) and desktop (DesktopNotifier).Tests:
ReplyActivityTest.aReplyReadBackOnAReconnectIsNewAgainstTheTurnsStart,DesktopNotifierTest.aReplyReadBackOnAReconnectBeforeTheTurnEndsIsStillTold.4. Notifications: a reply that is only a picture still notifies. A caption-less
reply has a blank preview, andpostReplyreturned early. It now says "Finished.". Other markup that renders as nothing, such as[](/document), still posts nothing, as master's test expects.Test:
ChatNotificationsTest.aReplyThatIsOnlyAPictureSaysItFinished.5. Bots: the unread check no longer brings back an older roster or reads past the last look. This was adapted to master's async unread worker, which already caps paging at 5 pages.
- Roster reads that overlap and answer out of order no longer let an older roster replace a newer one.
- The history scan stops at the first page that reaches the last look, since pages go back in time.
- A history that can't be read before the bot's badge was ever decided falls back to the roster activity. A scan that runs out of pages still leaves the badge as it was.
Tests (new
BotsViewModelunread tests,MockEnginefor REST and a fake JSON-RPC transport):BotsViewModelTakenTest.anOlderRosterReadThatAnswersLastIsDropped,aPageThatReachesTheLastLookEndsTheScan,aHistoryThatCantBeReadBeforeAnyBadgeGoesByTheActivity.6. Chat: the unread line's KDoc says a reply needs words to count. Docs only.
7. Notifications: a silence after a mid-turn history read doesn't re-send the old reply. A history read during the turn re-keys the old reply from
live-Nto its row id. A reply this turn didn't stream, under a key the turn start doesn't have, now counts as the old one when its content matches.Test:
ReplyActivityTest.aSilenceAfterAHistoryReadDoesNotBringBackThePreviousReplyUnderItsRowKey.Testing
:desktopApp:compileKotlinJvm :desktopApp:jvmTestpasses locally, with lint clean.message.completewith empty text) and fix 3 (reconnect) are proven by unit tests that drive the reducer and notifier with the gateway's payloads.Review follow-ups (rebased on master)
8. Bots: an older roster read changes nothing. It is dropped before it marks a bot's chat as known, its failure (or one from the gateway before a switch) shows no error, and a read asked before or during a pin, hide or delete can't undo it on screen. Tests:
anOlderRosterReadThatFailsLastShowsNoError,aRosterReadAskedBeforeAPinDoesNotUndoIt.9. Bots: the activity guess is only for a chat not read here. It compares the chat's id, so a failed read of a chat read before keeps its badge, and a fresh chat goes by the activity. Tests:
aFreshChatWhoseHistoryCantBeReadGoesByTheActivity,aChatReadBeforeKeepsItsBadgeWhenItsHistoryCantBeReadAgain.10. Notifications: a same-words reply read back on a reconnect is told. An unstreamed reply under a new key is new when the chat has more finished replies with those words than at the turn's start. Times can't decide it, because a history read dates the old reply by the turn's later steps. Test:
aReplyReadBackOnAReconnectWithTheSameWordsAsTheLastIsNew.11. Notifications: a Bot Chat message that is only a picture says "Finished.", as
postReplynow does. Two different pictures aren't deduped as one. Tests:aBotMessageThatIsOnlyAPictureStillPosts,twoPicturesFromTwoPathsAreTwoMessages.Each new test fails without its fix.
Emulator (hermes-agent v0.23.4, legacy dashboard path, fake model)
message.completetext is empty for a silence): a silent turn and a tool-only turn post nothing and the old reply isn't sent again; a picture-only message posts "Finished.".last_activesometimes lags behind the reply. That predates this PR.