Harden orchestration approval and manifest state#382
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Fold the validated orchestration fixes into one lane: require explicit plan approval, block lead self-approval patches, suspend on foreign bundle swaps, detect on-disk manifest conflicts, relocate run bundles after lane placement changes, and restore preload project bindings after cancelled openRepo.
9e250d3 to
888598e
Compare
|
Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews. |
There was a problem hiding this comment.
PR Review
Scope: 11 file(s), +742 / −32
Verdict: Minor issues
This PR tightens orchestration correctness: explicit plan approval (no regex or planning-phase shortcuts), lead self-approval blocked in patch policy, manifest suspend/conflict handling on external bundle changes, bundle-path repointing when lane placement/worktree moves, and preload project-binding restore on cancelled openRepo. The changes are well-tested; one edge case in cold-session repointing is worth fixing.
🐛 Functionality
[Medium] Cold orchestration sessions can keep a stale bundle path after lane placement changes
File: apps/desktop/src/main/services/chat/agentChatService.ts:23807-23836
Issue: When repointing persisted (non-managed) orchestration sessions, the handler scans sessionService.list({ limit: 500 }) ordered by started_at desc. Any chat session with an orchestrationRunId that is not in the newest 500 rows is skipped, so its orchestrationBundlePath stays on the pre-move path after VM detach or worktree relocation.
Repro: Create 501+ chat sessions in a project; start an orchestration lead run, dispose the session (cold), change the lane worktree or detach from Mac VM, then reopen the cold session and invoke orchestration tools — metadata still points at the old bundle directory.
Fix: Query only sessions that carry orchestration metadata (e.g. filter persisted rows / metadata files with orchestrationRunId), or pass laneId into sessionService.list and drop the fixed 500 cap for this path.
Notes
- Good hardening overall:
requestPlanApprovalrequiringdecision === "accept" | "accept_for_session",isOrchestrationPlanApprovedno longer treating planning phasedoneas approval,persistManifestTOCTOU guard + suspend onrunIdmismatch, and watcher callbacks serialized under the run mutex. - Bundle relocation assumes orchestration files already exist at the destination worktree (mirror sync / manual copy); that matches VM mirror behavior (
.ade/orchestrationis not rsync-excluded). - VM detach still depends on mirror→lane flush before the share directory is removed;
stopMirrorSyncForLaneis optional on the Mac VM service — worth verifying separately if detach-related manifest loss is reported.
Sent by Cursor Automation: BUGBOT in Versic


Summary
Validation
Related