Skip to content

[CoR] Resolve deployment plans from the active session #1894

Description

@nturinski

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoRCopilot on Rails

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions