Skip to content

Fix stale orchestration bundle path after lane VM placement change#376

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-8371
Closed

Fix stale orchestration bundle path after lane VM placement change#376
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-correctness-bugs-8371

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 27, 2026

Bug and impact

Orchestration split-brain after lane placement change (critical correctness)

When a lane moves between local worktree and Mac VM (or back), handleLanePlacementChanged refreshed chat execution context but left orchestrationBundlePath pointing at the old worktree. Agent tools and sandbox protection used the stale path while the Orchestration panel IPC resolved the bundle from the current getLaneWorktreePath, causing manifest/code divergence and workers editing the wrong tree.

Concrete trigger: Start an orchestration run on a local lane → attach lane to Mac VM (or detach) mid-run → lead spawns workers → workers read/write .ade/orchestration/<runId> under the old path while the UI shows state from the new worktree.

Root cause

  • orchestrationBundlePath is set at session creation and never updated on lane-placement-changed.
  • getOrCreateRuntime pinned the first bundle path seen for a runId and ignored later paths.

Fix

  • On placement change, recompute bundle path from laneWorktreePath + orchestrationRunId, persist on the session, and call relocateRunBundle.
  • When an existing runtime receives a new bundle path, clear cached manifest/plan and restart file watching on the new directory.

Validation

  • npm run test -- --run src/main/services/orchestration/orchestrationService.test.ts -t "relocates in-memory"
  • npm run test -- --run src/main/services/chat/agentChatService.test.ts -t "repoints orchestration bundle"

Does not overlap open draft PRs for orchestration manifest clobber (#375/#365), plan approval bypass (#364), sync/CRR (#367/#363/#372), or Linear review bypass (#374).

Open in Web View Automation 

When a lane moves between local and Mac VM, IPC resolves the bundle from
the current worktree but agent sessions kept the old orchestrationBundlePath.
Repoint persisted session paths and relocate in-memory run runtimes on
lane-placement-changed events.

Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored May 27, 2026 2:12pm

@arul28
Copy link
Copy Markdown
Owner

arul28 commented May 28, 2026

Closing in favor of #382. I validated the stale orchestration bundle path issue and folded the fixed relocation behavior into the combined orchestration hardening lane.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants