Repository navigation
fix(cli): restrict session PR linking to CLI backends - #14679
Conversation
The session PR link that link_pr stores is only read by CLI and remote sessions. VS Code, JetBrains, and other clients detect a worktree's PR from its branch and never read the stored link, so the tool had no effect there. Gate the tool to the cli client and cover the gating with tests.
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review of commit Files Reviewed (1 file)
Previous Review Summaries (2 snapshots, latest commit 154a842)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 154a842)Status: No Issues Found | Recommendation: Merge Files Reviewed (15 files)
Previous review (commit 9076f03)Status: No Issues Found | Recommendation: Merge Gate of Files Reviewed (5 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
What Problem This Solves
The backend session PR-link recorder and five-minute poller ran on IDE backends even though VS Code, Agent Manager, and JetBrains use their own worktree PR integrations. Hiding
link_pralone left automatic recording, storage migration, heartbeat ingestion, and remote link commands active.Why This Change Was Made
Use one live CLI-only condition for the entire backend mechanism: tool exposure and execution, automatic create/push evidence, stored-link operations, polling, migration and heartbeat enrichment, remote
set_pr_link, and the explicit link/status/unlink commands. Disable the feature by backend client, not session platform, because Agent Manager and mobile-controlled sessions share the hosting backend.User Impact
CLI backends retain session PR links, including remote/mobile control and hosted Cloud Agent backends using the default CLI client. VS Code, Agent Manager, JetBrains, ACP, and other non-CLI backends do not activate this mechanism, including when controlled from mobile. Their existing PR integrations and normal session sharing, ingestion, and remote commands remain unchanged. Existing PR-link records are preserved rather than deleted by disabled clients.
Evidence
Regression coverage verifies disabled clients with existing links and pending migration records, no PR polling or ingestion, unchanged ordinary heartbeats and part ingestion, and remote rejection before callbacks or extra heartbeats. All 329 tests across the 12 affected suites pass together, and package typecheck, lint, formatting, and annotation checks pass.
Isolated source backends confirm
link_prappears only for CLI, while CLI, VS Code, and JetBrains backends can still create sessions. The source CLI status command works and a non-CLI invocation returns an explicit unsupported error.