Skip to content

fix(web): Keep background announcements quiet for held or stopped runs - #40585

Merged
juliusmarminge merged 3 commits into
pingdotgg:mainfrom
mwolson:fix/quiet-announcer-monitor-and-stop
Nov 21, 2026
Merged

juliusmarminge merged 3 commits into
pingdotgg:mainfrom
mwolson:fix/quiet-announcer-monitor-and-stop

Conversation

@mwolson

@mwolson mwolson commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem

When a background thread finishes a turn while awaited background work is still running, finishes a background-wake turn while a monitor is still active, or settles as completed after the user requested Stop, the web and desktop notification coordinator stays quiet, but the screen-reader background announcer still speaks "Done: ".

This happened because the background announcer passed the latest run status straight through to the live-region helper instead of applying the same completion gates the desktop/web notification coordinator uses.

Change

Added a status-resolution step for the background thread announcer so a completed run is treated as not yet announced when stop was requested for the latest run, when pending background work still holds completion (such as a running subagent or awaited command), or when an active monitor holds a background-wake completion. Unawaited background commands, non-wake monitor runs, and non-completed outcomes (failed, interrupted, cancelled) keep their existing announcements.

Scope

Fixes #40586

Verification

Found while auditing background completion alerts across web notification surfaces: the desktop notification coordinator suppressed completion for awaited background work, monitor-held wakes, and stop-requested runs, while the background screen-reader announcer still read out "Done" on those same snapshots.

Verified with focused unit tests in apps/web/src/components/backgroundThreadAnnouncement.test.ts covering all three held/stopped completion cases plus unawaited and non-completed controls (confirmed the new regression test fails against upstream/main before the fix with expected 'completed' to be null and passes with the fix, 11/11 passing), and ran vp run check:changed upstream/main (format, lint, knip, typecheck, tests, React Compiler all passing). Also rebuilt and ran the desktop app with this change included; live screen-reader speech output (Orca / VoiceOver) was not manually audited. No screenshots are included because the announcer writes only to an sr-only aria-live="polite" region with no visual UI change.


Sent by Mike's agent (Gemini 4 Neon in T3 Code, Antigravity harness)

@mwolson
mwolson marked this pull request as ready for review November 21, 2026 22:16
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Nov 21, 2026
@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The background thread announcer now resolves run status before creating thread snapshots. It suppresses completed status when a stop was requested or pending background work holds completion. Tests cover these conditions and confirm other statuses remain unchanged.

Changes: Background thread announcements

Layer / File(s) Summary
Resolve completion status
apps/web/src/components/backgroundThreadAnnouncement.ts, apps/web/src/components/backgroundThreadAnnouncement.test.ts
resolveBackgroundThreadRunStatus returns null for completed runs when a stop was requested, pending background work holds completion, or a monitor wake holds completion. Tests also check unawaited work and unchanged failed or interrupted statuses.
Use resolved status in snapshots
apps/web/src/components/BackgroundThreadAnnouncer.tsx
Thread snapshots now use resolveBackgroundThreadRunStatus to set runStatus.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related issues

  • Issue 25585 describes intermediate completion signals while awaited background commands or monitors remain active. This PR suppresses the screen-reader completion announcement under related pending-work conditions.

Possibly related PRs

  • pingdotgg/t3code#32520: Holds completion alerts while a monitor remains pending for background wakes on desktop and push notification surfaces.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp, juliusmarminge

Merge Risk: Minimal · up to 4923f

The background announcer now stays quiet when a run completes while awaited background work is pending, a monitor is active on a background wake, or Stop was requested. Failed, interrupted and cancelled outcomes still announce. The change is small, covered by unit tests and easy to revert, so merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (background announcements staying quiet for held or stopped runs) and the scope (web). It matches the main change: resolveBackgroundThreadRunStatus suppresses 'completed' for s…
Description check Passed The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem and Change sections explain the bug and th…
Linked Issues check Passed [#40586] requires the background announcer to stay quiet on a completed latest run when (a) awaited background work holds completion, (b) a background-wake run has an active monitor, or (c) latestRunS…
Out of Scope Changes check Passed The whole-PR diff at head touches backgroundThreadAnnouncement.ts (+25 lines: new resolver and its helper imports) and BackgroundThreadAnnouncer.tsx (+2/-1: one import and one call). Both serve object…
Full details: Title check

Explanation

The title names the fix (background announcements staying quiet for held or stopped runs) and the scope (web). It matches the main change: resolveBackgroundThreadRunStatus suppresses 'completed' for stop-requested runs, pending background work, and monitor-held wakes in the background announcer. It uses the conventional commit format from the repository template and is 70 characters, within typical length limits.

Full details: Description check

Explanation

The description follows the repository template. It has Problem, Change, Scope, and Verification sections, and each section has specific content. The Problem and Change sections explain the bug and the fix clearly. The Scope section links issue #40586. The Verification section names the focused unit tests, the failing-then-passing regression check, the repo check command, and the untested live screen-reader output. The description does not include a title-style sentence of its own, but the template only requires the title to use conventional commit form. Some template-required items are only partly met: the Verification section mentions the desktop app build and says no screenshots are included with a reason, which fits the UI-change guidance because the change has no visual effect. The trailing agent attribution line names the model and harness as the template asks. Overall the description is complete.

Full details: Linked Issues check

Explanation

[#40586] requires the background announcer to stay quiet on a completed latest run when (a) awaited background work holds completion, (b) a background-wake run has an active monitor, or (c) latestRunStopRequested is true. The whole-PR diff (merge base to head) for backgroundThreadAnnouncement.ts adds exported resolveBackgroundThreadRunStatus. For status 'completed' it returns null when source.latestRunStopRequested === true, backgroundWorkHoldsCompletion(pendingBackgroundTasks) is true, or monitorHoldsWakeCompletion(source) is true; other statuses pass through unchanged. The whole-PR diff for BackgroundThreadAnnouncer.tsx replaces the direct read of thread.latestRun?.status with this resolver. A null runStatus produces no 'Done' outcome. The gates come from @t3tools/shared/orchestrationV2PendingBackgroundWork, which the issue names as the coordinator's gates. The previous-head change set is not a separate concern here, because the whole-PR diff was re-read at the current head. The test file was not diffed in this pass; its coverage rests on the PR summary and the previous assessment. I did not read the notification coordinator itself, so parity rests on the issue text and the shared helper imports.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff at head touches backgroundThreadAnnouncement.ts (+25 lines: new resolver and its helper imports) and BackgroundThreadAnnouncer.tsx (+2/-1: one import and one call). Both serve objective #40586. The test file backgroundThreadAnnouncement.test.ts (per the PR summary) adds regression and control tests for the same resolver. No unrelated code, configuration, or dependency change appears in the reviewed evidence. The test file diff was not re-read in this pass.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 7cd30ac and 4923fc1.

Files selected for processing: 1

  • apps/web/src/components/backgroundThreadAnnouncement.test.ts

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

@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Linux Chromium web client, 1280×800, light theme, fresh synthetic data on both commits. Start an asynchronous subagent, open another thread, then complete the parent while its child remains running. The audit panel displays actual ARIA live-region writes; it is instrumentation, not product UI. Base writes “Done: Async review parent”; head stays quiet.

Before After
cbd1f04bca 4923fc14cc
Before: premature Done announcement After: held completion stays quiet
Before recording After recording

Scenario and embedded replay driver. scenarios:prove exited 0: failsOnBase=true, passesOnHead=true.

Scope: proves the asynchronous-subagent case through actual live-region writes. Spoken screen-reader audio, monitor wakes, awaited commands, and the Stop race were not captured.

Not shown:

  • Spoken screen-reader audio was not exercised; evidence records actual aria-live writes in the real Chromium client.
  • Awaited background commands and ordinary-monitor progress wakes were not separately reproduced; the scenario covers a completion held by an asynchronous subagent.
  • The Stop-request/completed-outcome race was not reproduced.
  • Ordinary completions, non-completed outcomes, and the Electron desktop shell were not separately exercised.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 21, 2026
@juliusmarminge
juliusmarminge merged commit 904e267 into pingdotgg:main Nov 21, 2026
61 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Background screen-reader announcer says "Done" for threads with awaited background work, monitor wakes, or stopped runs

2 participants