You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(web): settled threads no longer offer a PR watch the server refuses - #29867
On web, the "…" menu on a linked pull request in a thread's Pull requests panel offers Watch for changes on settled, archived, and subagent threads. The server always refuses to start a watch on those threads (Orchestrator.ts: "is settled or archived and cannot watch pull requests", "is a subagent; its parent thread watches pull requests", and the read-only error for provider-native subagents). So the menu offers something that can only fail, and the user gets an error toast. Settled threads with open PRs are common, so this is easy to hit.
Mobile already hides the item in these states.
Change
Move mobile's inline check into canStartThreadPullRequestWatch in packages/client-runtime/src/threadPullRequestCompatibility.ts, beside the existing PR-mutation planning.
Mobile now calls the helper. Its behavior does not change.
Web shows the menu item only when the link is already watched (so Stop watching stays available) or when a new watch can start.
Scope and approval
Very small, focused fix for an obvious bug, so no prior issue: a client offers an action that the server always rejects in that state, and the sibling mobile client already handles it correctly. This change brings web in line with mobile and adds no new behavior.
Overlap search: no open PR touches this menu or this guard. The closest is #17224 (watch from the PR detail menu, which edits PullRequestThreadLinks.tsx, a different entry point). #20394 added the mobile guard this change reuses.
Verification
Red on main: vp test run src/threadPullRequestCompatibility.test.ts (packages/client-runtime) → TypeError: canStartThreadPullRequestWatch is not a function, 1 failed | 4 passed. The web panel had no state check before this change; its only condition was onSetWatching !== null && open.
Green: same command, 5 passed.
vp run check:changed: all passed (format, lint, knip, typecheck for 7 packages, tests, React Compiler).
Not checked: no run in a real client. The UI change only hides one menu item.
Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.
Created with Claude Opus 5.5 in Claude Code (T3 Code).
Macroscope's review found this PR approvable — Web PR rows now hide watch-start actions for ineligible threads, using the same eligibility helper as mobile. Existing watch-stop controls remain available, with no change to server behavior or watch defaults.
No code changes detected at 1e26691. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 860c8cd and 1e26691.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
Walkthrough
A shared thread eligibility check now governs starting pull request watches in mobile and web interfaces. Tests cover active, settled, archived, and subagent thread cases.
Changes: Pull request watch eligibility
Layer / File(s)
Summary
Define and test watch eligibility packages/client-runtime/src/threadPullRequestCompatibility.ts, packages/client-runtime/src/threadPullRequestCompatibility.test.ts
Adds canStartThreadPullRequestWatch. It returns false for archived, settled, and subagent threads, and true for active threads, including those with an "active" settled override.
Gate mobile watch actions apps/mobile/src/features/threads/useLinkedPullRequestActions.ts
The mobile hook uses the shared eligibility check alongside its existing permission and watch-capability checks.
Gate the web watch menu apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx
The panel computes eligibility from the current thread. It shows the watch menu item for an open pull request if it is already watched or the thread can start watching.
Issue 25764 — The change excludes subagent threads from starting watches, but does not implement the requested policy for delegated child threads.
Issue 25620 — The change prevents new watches after settlement, but does not resolve the pending-settle race.
Issue 22183 — The change updates watch eligibility for settled threads, but does not address silent watch termination.
Suggested labels:bugfix
Suggested reviewers:t3dotgg
Merge Risk: Low · previous review 860c8
The menu change lacks a regression test that exercises the affected web behavior. Add that coverage to prevent the rejected action from returning.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly identifies the web fix: settled threads no longer offer a pull request watch action that the server rejects.
Description check
The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the affected states, implementation, approval rationale, test results, and unverified real…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the affected states, implementation, approval rationale, test results, and unverified real-client behavior. It does not include the before-and-after screenshots requested for UI changes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
verified unchanged head 860c8cd7dd4fd6576d65676c1e7ae629e8c3d99c on linux, using the actual dev web app, repo Playwright, and /usr/bin/google-chrome. no mocks, fixtures, or demo data. added the real repository through the app and completed Codex gpt-6.1-sol turns on both main and the pr head. ran one dev server at a time.
before, on github/main at 61c3794c32: settled the thread, opened its linked pr menu, and clicked "watch for changes". the client sent the request and the server rejected it.
after, with the same app-created thread and pr links: the settled thread's menu contains copy, open, and unlink, with no watch action.
neighboring behavior: un-settling restores "watch for changes"; starting it produces the watching indicator and "stop watching"; stopping removes the indicator. settling hides the action again, and un-settling restores it. the recording is played at 1.67x.
Blacksmith: all five compatibility tests passed. vp run check:changed c0ec87a55bbffa437673f037d7b4ca68c6a300f1 passed format, lint, knip, affected typechecks, and focused tests. all 32 reported ci checks passed. no source changes were needed.
server transcript from the before run:
client: environment-data:commands:thread:watch-pull-request failed
OrchestrationV2DispatchCommandError:
Thread 5af1695c-c738-4d81-8a07-a4c7e9509b7b is settled or archived and cannot watch pull requests.
Not verified
native ios/android and the electron shell were not run on this linux vm. archived and subagent thread menus, an already-watched settled thread, and notifications from later external pr changes were not exercised. the focused shared-helper tests cover archived and subagent eligibility. this verification covers the linked-pr menu, not the separate pr-detail entry point.
Real web app, Chromium, 1280×800, light theme, fresh isolated database and synthetic replay thread on each commit. Link #29867, open its linked-PR menu, settle the thread using the sidebar, reopen it, and open the same menu again.
Proven: scenarios:prove exited 0. The base offers Watch for changes on the settled thread; the head omits it. Both offer it while the thread is active.
Archived and subagent threads were not exercised; this scenario covers the reported settled-thread case.
Preservation of Stop watching for an existing watch and starting a watch after Un-settle were not exercised; the scenario stops at the settled-menu assertion.
The rejected watch click and its console warning were not replayed; the proof demonstrates the invalid action being offered on base and absent on head.
…es (pingdotgg#29867)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c342f3d)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On web, the "…" menu on a linked pull request in a thread's Pull requests panel offers Watch for changes on settled, archived, and subagent threads. The server always refuses to start a watch on those threads (
Orchestrator.ts: "is settled or archived and cannot watch pull requests", "is a subagent; its parent thread watches pull requests", and the read-only error for provider-native subagents). So the menu offers something that can only fail, and the user gets an error toast. Settled threads with open PRs are common, so this is easy to hit.Mobile already hides the item in these states.
Change
canStartThreadPullRequestWatchinpackages/client-runtime/src/threadPullRequestCompatibility.ts, beside the existing PR-mutation planning.Scope and approval
Very small, focused fix for an obvious bug, so no prior issue: a client offers an action that the server always rejects in that state, and the sibling mobile client already handles it correctly. This change brings web in line with mobile and adds no new behavior.
Overlap search: no open PR touches this menu or this guard. The closest is #17224 (watch from the PR detail menu, which edits
PullRequestThreadLinks.tsx, a different entry point). #20394 added the mobile guard this change reuses.Verification
main:vp test run src/threadPullRequestCompatibility.test.ts(packages/client-runtime) →TypeError: canStartThreadPullRequestWatch is not a function, 1 failed | 4 passed. The web panel had no state check before this change; its only condition wasonSetWatching !== null && open.vp run check:changed: all passed (format, lint, knip, typecheck for 7 packages, tests, React Compiler).Reviewed with sol-loop: 1 round with GPT-6.1 Sol on high. Sol verdict: approved.
Created with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code