[Bug]: watch_pull_request ends silently, so the thread never hears of the author's push or reply #22183
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
Seen once, on a GitHub PR review thread (times UTC, 2026-10-20):
- 05:52:53: the thread calls
watch_pull_requeston an open PR. It returnswatching:true, wasWatching:false. - 05:53:25 and 05:54:22: the thread wakes twice and ends each turn "waiting on the author".
- 05:55:39: the thread is settled.
- 05:59:07: the author pushes a commit. 05:59:27: the author replies in a review thread. About 06:04: CI goes green on the new head.
- 06:58:11: the thread calls
unwatch_pull_request. It returnswatching:false, wasWatching:false.
Nothing in step 4 woke the thread, and no "stopped watching" notice reached it. The thread's timeline has no item at all between 05:54:37 and the user's next message at 06:57:42.
My guess is that settling the thread (or the end of its turn) dropped the watch, because the watch ended between 05:53 and 05:59 and the settle is the only thing that happened then. I have not confirmed this. Unlike #18894, no notice was sent.
Expected behavior#
- A watch lasts until
unwatch_pull_request, a merge or a close. Settling a thread or ending its turn doesn't end it. - If anything else ends a watch, the thread gets a notice saying why, as in #18894.
Actual behavior#
The watch ended silently. The thread said "Still watching" while nothing was watching, and the author's push and reply waited about an hour, until the user noticed on GitHub.
Impact#
Major degradation or frequent failure
Version or commit#
T3 Code (Alpha) 0.0.68
Environment#
macOS 27.0 (Apple Silicon), T3 Code desktop (Alpha), Claude Code provider, GitHub PR on github.com
Workaround#
Our review automation now runs its own 5-minute poll for pushes and replies, and the agent calls watch_pull_request again at the end of every turn that waits on the author.
emanuel-mrkr(GitHub profile, opens in a new tab) changed the title
tanstack-source added labelsbug
@emanuel-mrkr In the second case, between 07:42:56 and 07:54:33, does the thread's timeline (or the agent's tool calls) show a wake followed by an unwatch_pull_request call, a settle request (t3_thread_organize), or a Stop?
@juliusmarminge No to all three. Between 07:42:56 and 07:54:33, the thread's timeline, its runs and the agent's tool calls show no wake, no
unwatch_pull_request, not3_thread_organizeand no Stop or interrupt. Times UTC, 2026-10-20:- 07:42:53.659:
watch_pull_requestreturnswatching:true, wasWatching:true. The turn ends at 07:42:56.680, status completed. The last wake was at 07:41:07 ("Checks failed"), before this re-arm. - 07:42:56 to 07:53:26: nothing. No timeline items, no tool calls, no runs, no wakes.
- 07:53:26.933: the user's pasted link starts the next turn. 07:53:34.699: a second user message is queued as its own run. It is cancelled at 07:53:39.527 without starting, and the record doesn't say why.
- In that turn the agent runs only
ghandgitcommands, plus one local check of howsort -Vorders versions. It makes no T3 calls until 07:54:33.779:watch_pull_requestreturnswatching:true, wasWatching:false.
Over the whole thread the agent called
watch_pull_request3 times andunwatch_pull_request3 times (07:57:11 returnedwasWatching:true, then 07:57:23 and 08:00:35). It also called ToolSearch,delegate_tasktwice andorchestrator_capabilities, all before the window. It never calledt3_thread_organize. The thread was settled at 08:00:40, after the window.Outside the agent, our review automation read the thread through T3's API at 07:44:09 and 07:49:09. Both were reads only; nothing was written.
One thing that may matter: the only provider session in the thread's snapshot was created at 07:53:26.958, as the 07:53:26 turn started. The snapshot keeps no record of the session that ran the earlier turns, or of when it stopped. Could that session ending have taken the watch with it?
What I can't see: the server logs from that day have rotated out, so I can't tell when the watch was removed, whether the earlier session stopped inside the window, or why the queued message was cancelled.
- 07:42:53.659:
I tried to reproduce this on the current build and could not.
Commit b68aedfdb7 (origin/main). Started
T3CODE_DEV_SEED=0 vp run devin a fresh worktree, enabled the OpenCode provider in its dev settings, added a scratch git project whose origin is github.com/pingdotgg/t3code, and rant3 thread start <project> --provider opencode --model opencode/deepseek-v4.1-flash-free --waitasking the agent to call watch_pull_request on open PR #34972 and end its turn. Result: watching:true, wasWatching:false. Sent a follow-up turn that called watch_pull_request again (the reporter's case 2 re-arm): watching:true, wasWatching:true; turn ended. Read the thread's projected pull request link (read-only sqlite on the worktree's own dev database) about once a minute for 12 minutes: the watch kept its original startedAt and the reactor had recorded the PR's head SHA and checks. Then restarted the dev server (stopped by captured PIDs, started again) and checked for 3 more minutes: the watch survived the restart and the following sweeps, still active at the last check 16 minutes after it started. No settle, archive, Stop or unwatch was issued. I could not push to or comment on the PR, so a wake on a push or reply was not exercised; the watch itself did not end silently. On main the only notice-less ends are merge, Stop, settle/archive, unlink and subagent threads (PullRequestWatchReactor.endsWithoutRead and the merged branch of readGroup; Orchestrator thread.settle/thread.archive/holdStoppedThread); the provider session idle release (ProviderSessionManager, 30 min) never touches pull request links.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.
juliusmarminge closed this
Sign in to join this conversation.
Second case, and this one rules out settling as the trigger. The thread was never settled.
Review thread on a GitHub PR, 2026-10-20 UTC:
watch_pull_request. It returnswatching:true, wasWatching:true. The turn ends at 07:42:56.watch_pull_requestagain. It returnswasWatching:false.So the watch ended silently sometime between 07:42:56 and 07:54:33, with no notice and no settle. In the first case, the watch did deliver one wake ("checks passed") after its turn ended, so a turn ending doesn't always drop it.