Problem
The deployment-plan view currently chooses the most recently modified prepare-plan.json. An older session can therefore appear instead of the active deployment session if its artifact has a newer timestamp. This can briefly show the original or otherwise incorrect project plan before the expected plan opens.
Proposed work
- Resolve
.copilot-azure/sessions/active-session.json first.
- Prefer
.copilot-azure/sessions/{activeSessionId}/prepare-plan.json and verify that any root-level plan belongs to the active session.
- Use newest-modification-time selection only as a recovery fallback when the active-session pointer is absent or stale.
- Apply the same active-session filtering to plan watchers so a non-active session cannot steal focus.
- Extract a shared active-session artifact resolver rather than duplicating logic.
Existing patterns to reuse:
src/webviews/copilotOnRails/extension/openDeployResultView.ts
src/webviews/copilotOnRails/extension/deployProgressWatcher.ts
Primary implementation surface:
src/webviews/copilotOnRails/extension/openDeploymentPlanView.ts
- Potential shared helper in
src/tree/project/projectPlanFiles.ts
Acceptance criteria
- Opening deployment planning selects the active session's plan whenever a valid active-session pointer exists.
- Updating an older session's plan cannot replace or focus over the active plan.
- A missing or stale pointer still has a deterministic recovery path.
- Existing approval state keyed by artifact path/content remains intact.
- Tests cover active, stale, missing, and competing-session artifacts.
Problem
The deployment-plan view currently chooses the most recently modified
prepare-plan.json. An older session can therefore appear instead of the active deployment session if its artifact has a newer timestamp. This can briefly show the original or otherwise incorrect project plan before the expected plan opens.Proposed work
.copilot-azure/sessions/active-session.jsonfirst..copilot-azure/sessions/{activeSessionId}/prepare-plan.jsonand verify that any root-level plan belongs to the active session.Existing patterns to reuse:
src/webviews/copilotOnRails/extension/openDeployResultView.tssrc/webviews/copilotOnRails/extension/deployProgressWatcher.tsPrimary implementation surface:
src/webviews/copilotOnRails/extension/openDeploymentPlanView.tssrc/tree/project/projectPlanFiles.tsAcceptance criteria