Skip to content

fix(web): settled threads no longer offer a PR watch the server refuses - #29867

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:fix/web-pr-watch-settled-threads
Nov 14, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:fix/web-pr-watch-settled-threads

Conversation

@saphid

@saphid saphid commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

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

  • 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).

🤖 Generated with Claude Code

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 30-99 changed lines (additions + deletions). labels Nov 3, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 860c8cd

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.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

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.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • 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: Passed 4

Check name Status Explanation
Title check Passed The title clearly identifies the web fix: settled threads no longer offer a pull request watch action that the server rejects.
Description check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c0ec87a and 860c8cd.

Files selected for processing: 4

  • apps/mobile/src/features/threads/useLinkedPullRequestActions.ts
  • apps/web/src/components/pullRequest/ThreadPullRequestsPanel.tsx
  • packages/client-runtime/src/threadPullRequestCompatibility.test.ts
  • packages/client-runtime/src/threadPullRequestCompatibility.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

@maria-rcks

maria-rcks commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Verified in a real dev environment

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.

before: main offers a watch on a settled thread

after: pr hides the watch on the same settled thread

pr: start watch, stop watch, settle, and un-settle

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.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 14, 2026
…led-threads

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@juliusmarminge
juliusmarminge force-pushed the fix/web-pr-watch-settled-threads branch from b7e2bfc to 1e26691 Compare November 14, 2026 14:55
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

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.

Before — c0ee5a1f5f After — 1e26691109
Active menu Before: active thread offers Watch for changes After: active thread still offers Watch for changes
Settled menu Before: settled thread incorrectly offers Watch for changes After: settled thread omits Watch for changes
Recording Before interaction After interaction

Scenario source

Not shown:

  • 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.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 14, 2026
@juliusmarminge
juliusmarminge merged commit c342f3d into pingdotgg:main Nov 14, 2026
54 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 14, 2026
Pipyakas pushed a commit to Pipyakas/t3code that referenced this pull request Nov 15, 2026
…es (pingdotgg#29867)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
(cherry picked from commit c342f3d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). 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.

3 participants