Skip to content

fix(web): only top-level chats notify - #243

Merged
jayleaton merged 1 commit into
mainfrom
fix/notify-root-threads-only-20261114
Nov 14, 2026
Merged

jayleaton merged 1 commit into
mainfrom
fix/notify-root-threads-only-20261114

Conversation

@jayleaton

Copy link
Copy Markdown
Owner

Problem

Desktop and web notifications (sound, OS notification, in-app toast, badge) fired for listed child chats, such as t3_thread_launch / create_threads children, named-agent delegate_task children, and tasks delegated in from linked environments. A captain running a fleet beeped on every child that finished or asked something.

Fix

Thread Before After
Top-level (no parent; forks count) notifies notifies
Listed child chat notifies silent
Task delegated in from a linked env notifies unless its parent is listed here silent
Side chat / subagent silent silent
  • New hasParentThread in packages/client-runtime/src/state/threadShell.ts. It is true for a child, a subagent, a side chat, or any thread with delegatedFrom.
  • ThreadNotificationCoordinator.observeThreads now skips on hasParentThread in place of isShownUnderParent. The coordinator no longer needs delegatedUnderParentAtom or its subscription.
  • The badge counts the coordinator's tracked desktop notifications, so it follows the same filter with no separate change.

Nothing is lost. The server's DelegatedTaskQuestionReactor wakes a local child's direct parent for both questions and approvals, so the parent asks the user when it needs them, and the root then notifies. Subagent and side-chat requests still roll up to the parent through pendingSubagentRequests.

Proof

New case in ThreadNotificationCoordinator.badge.browser.test.ts: a root, a listed child and a delegated-in task each ask for input, then each complete.

  • On main: 6 notifications, including Child and Delegated.
  • On this branch: only Input needed: Root and Thread completed: Root, with a badge of 1.

vp run check:changed passes.

No visual change, so there are no captures.

Merge risk

Low and client-only. If a delegated-in task's parent environment is not connected to this client, that task no longer notifies on its own. That was the intent.

Opus 5.5 · Claude Code

🤖 Generated with Claude Code

Child chats, delegated tasks, side chats and subagents no longer play sounds,
show OS notifications or toasts, or add to the badge. Only threads with no
parent of any kind notify; a child's question or approval already wakes its
parent, which asks the user when it needs them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:M labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Codex Live turn WebSocket decoded 21.5 KiB 21.5 KiB 0 B (0.0%) 24.4 KiB ✅
Codex Live turn messages 1 1 0 (0.0%) 8 ✅
Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅
Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅
Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅
Claude Live turn WebSocket decoded 21.9 KiB 21.9 KiB 0 B (0.0%) 24.4 KiB ✅
Claude Live turn messages 1 1 0 (0.0%) 8 ✅

Baseline: 6dec7c9 · PR result: fd5e477 · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@jayleaton
jayleaton marked this pull request as ready for review November 14, 2026 04:19
@jayleaton
jayleaton merged commit 101a31d into main Nov 14, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 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.

1 participant