[Bug]: Replies from PR-watch wake runs give no notification, and the thread stays on the Working shelf #48195
Note
Posted by Claude Opus 5.5 on behalf of @petar-studocu.
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/web (sidebar Working shelf, ThreadNotificationCoordinator)
Steps to reproduce#
- In a long-lived Claude thread, have the agent open a PR and call
watch_pull_request. The watch stays on for days, waiting for review. - The thread now sits on the sidebar's Working shelf.
- A PR event arrives (for example "#123: merge conflict"). It wakes the agent. The agent works for a while and ends the run with a message for the user, such as "Resolved the conflict, pushed, CI green. Do you want X or Y?"
- The watch is still on, so the thread stays on the Working shelf.
Expected behavior#
When a wake run ends with an assistant message, the user is told. That means a desktop or in-app notification, an unread dot, or a move to the inbox, the same as when a turn the user started ends. The watch still running should not hide a finished reply.
Actual behavior#
- I get no notification for these replies. The client has
notificationMode: "notifications-and-sound"andinAppNotificationsEnabled: true. - The thread never leaves the Working shelf, so nothing in the sidebar shows that new output is waiting. A pulsing Working row looks the same whether the agent is busy or has stopped and is waiting for me.
- In practice I miss these replies, sometimes for hours. My example thread has had a PR watch on for days. It has more than 900 runs, many of them PR-watch wakes that end with a status update or a question for me.
Impact#
Major degradation or frequent failure
Version or commit#
0.1.14-nightly.20261203.5651
Environment#
macOS (arm64), desktop app, Claude provider
Related#
- #47837 covers the Working-shelf part for
t3_background_waitandt3_thread_wait. A thread that only waits stays on the Working shelf. This report is about PR-watch wakes and the missing notification for the reply. - #32497 / #32520 stopped the completion alert on every Monitor wake. The PR says threads with an awaited PR watch "alert as before". In my use they do not alert in a way I notice, or the row on the Working shelf hides it.
- #19508 asked for watch handoff when only reviewer approval remains. It was moved to Ideas.
Possible fix#
- When a run ends with an assistant message, and the thread only waits on a PR watch or background work, send a "Thread replied" notification and mark the thread unread. This should hold even while the watch keeps going.
- Or: show such threads as Waiting with an unread marker, not Working (see #47837), so they move back to the inbox.
- A setting such as "Notify on agent replies from background wakes" would also work.
tanstack-source added labelsbug
juliusmarminge closed this
Sign in to join this conversation.
I tried to reproduce this on the current build and could not.
Commit 7eba80e431 (origin/main). Web dev server with T3CODE_DEV_SEED=0 on a fresh database, opened in a browser. Thread notifications set to "Notifications only". The page's Notification constructor was replaced with a recorder that grants permission, and document.hasFocus was set to return false. Default Codex model through the hub.
Run 1: the agent called watch_pull_request on the real open PR pingdotgg/t3code#48216 with until "merged" and replied "Watching #48216.". The run completed at 11:54:55, but the thread stayed on the sidebar's Working shelf. After a server restart it still showed "Working 28m", with the watch stored as {until:"merged", checksPending:false}. Notifications were still off when run 1 ended, so this run says nothing about the notification.
Run 2: at 12:07 a real review comment woke the agent ("#48216: checks passed, new comments"). The model ignored the instruction to only reply and started working on the PR. It was still running when the dev server hit its 30-minute background limit, and the run was cancelled.
Run 3: a user follow-up. The agent called pull_request_respond, which failed with no GitHub credential so nothing was posted to the PR, and then unwatch_pull_request. With the watch gone, "Thread completed" fired and the thread left Working. That is the expected control behaviour.
Run 4: re-arming the watch failed. The VM's gh token became invalid ("GitHub has no working credential for this host"), and the hub answered "Selected model is at capacity". I stopped there.
So in the real app I saw the Working-shelf half (a finished reply with an until:"merged" watch stays on Working), but not the missing notification for a wake reply.
Code path: shellRuntime (packages/client-runtime/src/state/models.ts) parks a thread at runtime "idle" whenever backgroundWorkHoldsCompletion is true. pullRequestWatchTasks (packages/shared/src/orchestrationV2PendingBackgroundWork.ts) marks a PR watch awaited while checks are pending or while until is "merged". The sidebar status then becomes "waiting", and ThreadNotificationCoordinator.tsx computes
completed = status === "ready" && latestRun.status === "completed", so the completion is never notified. The pushed test (branch factory/repro-48195, commit 4d8a2b6f51, in ThreadNotificationCoordinator.badge.browser.test.ts) feeds the coordinator a run that completes with an awaited pull-request-watch task. It expects "Thread completed" and on main gets no notification.Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.