Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): play completion sounds without delay #29146

MergedYash-Singh1(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/29146/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Completion alerts waited two seconds after the client received a completed thread state. Audio was also fetched and decoded only when an alert needed to play, adding a first-play delay.

Notify immediately when the thread shell reports completion, and preload both sounds when a user gesture unlocks audio. Keep completion deduplication and suppression for existing, archived, and stopped runs.

This intentionally removes the continuation grace for completion alerts. A completed run can now notify before an automatic continuation starts. The sidebar's two-second placement grace and server settlement behavior remain in place.

Validation: vp run check:changed passes after merging current main, including 40 affected tests, formatting, lint, unused-code checks, affected typechecks, and React compiler checks. Tests cover immediate completion, duplicate suppression across reconnects, preloaded audio reuse, and retrying failed loads on alerts without retrying on every gesture. Audible timing has not been verified in a live client.

Model: GPT 6.1 Sol. Harness: Codex through T3 Code.

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at c0ea965

      Macroscope's review found this PR approvable — Completion alerts now fire immediately, and notification sounds preload during interaction to reduce playback delay. Existing notification preferences and presentation safeguards remain, with effects confined to notification timing and audio loading.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      Recent review info
      Run configuration
      Commits

      Reviewing files that changed from the base of the PR and between a02dcd48dbde7aebb189b1c2dc3456ddab006c2c and c0ea965d09e421b40d8cc0b2bdc77efdbf5cdb22.

      Files selected for processing: 2
      • apps/web/src/threadNotifications.test.ts
      • apps/web/src/threadNotifications.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.

      Walkthrough

      The notification gate now sends eligible completion notifications immediately and tracks handled completions. Audio unlock preloads both notification sounds, which playback reuses.

      Changes: Thread notifications

      Layer / File(s)Summary
      Immediate completion notifications
      apps/web/src/components/ThreadNotificationCoordinator.logic.ts, apps/web/src/components/ThreadNotificationCoordinator.tsx, packages/client-runtime/src/state/threadInbox.ts, apps/web/src/components/ThreadNotificationCoordinator.logic.test.ts, apps/web/src/components/ThreadNotificationCoordinator.badge.browser.test.ts
      The notification gate removes its grace-period timer and handles eligible settled completions immediately. The coordinator no longer cancels pending notifications during reconnect. Tests cover immediate completion notices, reconnect behavior, attention, and gate resets. WORKING_EXIT_GRACE_MS remains at 2_000 but is no longer exported.
      Audio preload and reuse
      apps/web/src/threadNotifications.ts, apps/web/src/threadNotifications.test.ts
      Audio unlock starts loading both sound assets. Playback shares cached fetch-and-decode promises, and failed loads are evicted so a later attempt can retry.

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix

      Possibly related issues

      • pingdotgg/t3code#25585 — The change affects the completion-alert path, but does not change the completion-state classification described in the issue.
      • pingdotgg/t3code#26886 — The change removes the grace timer, but does not add the settled-thread check described in the issue.

      Suggested reviewers: maria-rcks, t3dotgg

      Merge Risk: Minimal · up to c0ea9

      The changed notification behavior is mergeable; no current actionable risk was established.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main change: removing the delay before completion sounds play.
      Description checkPassedThe description explains the problem, the implementation, the intentional behavior change, and focused verification results. It does not include a separate Scope and approval section or linked approva…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description explains the problem, the implementation, the intentional behavior change, and focused verification results. It does not include a separate Scope and approval section or linked approval evidence, but the remaining content is complete and on topic.

      Finishing Touches
      Generate docstrings
      • Commit to this branch
      • Create a new PR
      Generate unit tests (beta)
      • Commit to this branch
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      • Fix comments: Fix CodeRabbit comments on this PR

Sign in to join this conversation.