Skip to content

feat(server): PR monitor ownership and review-thread handoff - #183

Merged
ronak-guliani merged 3 commits into
base/pr-monitor-v2from
feat/pr-monitor-c-ownership-handoff
Aug 12, 2026
Merged

feat(server): PR monitor ownership and review-thread handoff#183
ronak-guliani merged 3 commits into
base/pr-monitor-v2from
feat/pr-monitor-c-ownership-handoff

Conversation

@ronak-guliani

Copy link
Copy Markdown
Owner

Summary

Phase 5-6 of the PR monitor stack (stacked on B / #182).

  • Automatic ownership: when a thread creates a PR and autoMonitorPullRequestsOnCreate is enabled, associate ownerThreadId and start server-owned monitoring.
  • Single modifying owner: transferOwnership replaces the owner (never concurrent modifiers) and writes durable ownership audit events (migration 052).
  • Review handoff: submitFindings RPC + MCP t3_pr_monitor_submit_findings links linkedReviewThreadId to the owner monitor without dual ownership.
  • Settings + UI: settings toggle, monitor strip shows owner/review thread chips, stacked git actions pass projectId/threadId.

Stack

PR Base to Head
A #181 base/pr-monitor-v2 to feat/pr-monitor-a-contracts-observe
B #182 A to feat/pr-monitor-b-feedback-reporting
C (this) B to feat/pr-monitor-c-ownership-handoff
D (next) C to fallback maintenance threads

Migrations

  • 052_PullRequestMonitorOwnership: linked_review_thread_id, pull_request_monitor_ownership_events

Tests

  • vp test run src/pullRequestMonitor (8 tests): start/status, transfer ownership, submitFindings handoff

Notes

  • Merge stays human-controlled.
  • Review threads are linked, not concurrent modifying owners.
  • Provider gap unchanged: only GitHub implements monitorSnapshot.

Model: Grok 4.5 via GitHub Copilot CLI

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Aug 11, 2026
@ronak-guliani
ronak-guliani force-pushed the feat/pr-monitor-c-ownership-handoff branch from c6fd1de to ad2a2b4 Compare August 11, 2026 19:37
@ronak-guliani
ronak-guliani requested a balanced review from Copilot August 11, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds durable PR-monitor ownership, automatic monitoring after PR creation, ownership transfer, and review-thread handoff across contracts, server, MCP, and web UI.

Changes:

  • Adds ownership/review-thread contracts, RPCs, persistence, and auditing.
  • Automatically associates PRs with threads and exposes handoff tools.
  • Adds settings and monitor ownership indicators.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
packages/contracts/src/settings.ts Adds the auto-monitor setting.
packages/contracts/src/rpc.ts Defines transfer and handoff RPCs.
packages/contracts/src/pullRequestMonitor.ts Extends monitor ownership contracts.
packages/contracts/src/git.ts Adds project/thread context to Git actions.
packages/client-runtime/src/state/vcsAction.ts Forwards ownership context.
packages/client-runtime/src/state/pullRequests.ts Adds monitor mutation commands.
apps/web/src/state/sourceControlActions.ts Supplies web thread context.
apps/web/src/components/settings/SettingsPanels.tsx Adds the auto-monitor toggle.
apps/web/src/components/pullRequest/PullRequestMonitorStrip.tsx Displays owner and reviewer IDs.
apps/web/src/components/GitActionsControl.tsx Scopes Git actions to the active thread.
apps/server/src/ws.ts Handles RPCs and automatic monitoring.
apps/server/src/pullRequestMonitor/PullRequestMonitorStore.ts Persists ownership metadata and events.
apps/server/src/pullRequestMonitor/PullRequestMonitorService.ts Implements transfer and handoff logic.
apps/server/src/pullRequestMonitor/PullRequestMonitorService.test.ts Tests transfer and handoff behavior.
apps/server/src/persistence/Migrations/052_PullRequestMonitorOwnership.ts Adds ownership persistence schema.
apps/server/src/persistence/Migrations.ts Registers migration 052.
apps/server/src/mcp/toolkits/orchestrator/tools.ts Exposes the handoff MCP tool.
apps/server/src/mcp/toolkits/orchestrator/handlers.ts Handles MCP handoff requests.
apps/server/src/auth/RpcAuthorization.ts Assigns authorization scopes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/contracts/src/pullRequestMonitor.ts Outdated
Comment thread packages/contracts/src/git.ts
Comment thread apps/server/src/ws.ts
Comment thread apps/server/src/pullRequestMonitor/PullRequestMonitorStore.ts
Comment thread apps/server/src/pullRequestMonitor/PullRequestMonitorService.ts Outdated
Comment thread apps/server/src/pullRequestMonitor/PullRequestMonitorService.ts Outdated
Comment thread apps/server/src/mcp/toolkits/orchestrator/tools.ts
Comment thread apps/web/src/components/settings/SettingsPanels.tsx
Comment thread apps/server/src/pullRequestMonitor/PullRequestMonitorService.ts
@ronak-guliani

Copy link
Copy Markdown
Owner Author

Review follow-up

Addressed on tip branch feat/pr-monitor-d-fallback-maintenance:

  • linkedReviewThreadId has decoding default for version skew
  • Mobile create-PR path now sends projectId/threadId on stacked actions
  • Auto-monitor only on created (not opened_existing); settings load fail-closed
  • Poll updates no longer rewrite ownership; ownership transfer is transactional with audit event
  • submitFindings starts without owner mutation, then atomic handoff with true previous owner
  • MCP submit_findings always uses invoker thread (no required reviewThreadId param)
  • Transfer validates target thread exists in monitor project
  • Auto-monitor/fallback settings are searchable

Stack tip: #184

@ronak-guliani
ronak-guliani force-pushed the feat/pr-monitor-c-ownership-handoff branch from 1f8f0b0 to db62918 Compare August 12, 2026 05:46
Base automatically changed from feat/pr-monitor-b-feedback-reporting to base/pr-monitor-v2 August 12, 2026 05:49
ronak-guliani and others added 2 commits August 11, 2026 22:49
Associate created PRs with owning threads when enabled, support single-owner transfer with audit events, and link review threads via submitFindings RPC/MCP without concurrent modifying owners.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ronak-guliani
ronak-guliani force-pushed the feat/pr-monitor-c-ownership-handoff branch from db62918 to 068d6b2 Compare August 12, 2026 05:49
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added size:XL and removed size:L labels Aug 12, 2026
@ronak-guliani
ronak-guliani merged commit 0e1ddf1 into base/pr-monitor-v2 Aug 12, 2026
7 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants