Add smart support for resuming projects with Copilot on Rails#1443
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances the “Copilot on Rails” project-creation workflow by detecting existing plan files in the workspace and offering a resume path (continue with local development or deployment) instead of always starting from scratch.
Changes:
- Add resume logic to
createProjectWithCopilotby detecting prior scaffold/local-dev completion via plan markdown files. - Ensure a fresh Copilot Chat session is created when launching the scaffold agent from the “Create with Copilot” webview.
- Expose “Create Project with Copilot…” as an item in the Workspace tree; align deploy hand-off prompts; update dependency manifest/lockfile accordingly.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts | Detects previous plan phases and offers resume actions; otherwise opens the create-project webview. |
| src/webviews/copilotOnRails/extension/controllers/CreateProjectViewController.ts | Opens a new chat before launching the scaffold agent mode. |
| src/tree/workspace/WorkspaceResourceTreeDataProvider.ts | Adds a Workspace tree item to start “Create Project with Copilot…”. |
| src/commands/registerCommands.ts | Updates default deployment hand-off prompt wording. |
| resources/agents/azure-local-debug.agent.md | Keeps the hand-off command args aligned with updated deploy prompt wording. |
| package.json | Removes direct dependency on @microsoft/applicationinsights-common. |
| package-lock.json | Reflects updated dependency graph (notably @vscode/extension-telemetry and transitive AppInsights packages). |
Comments suppressed due to low confidence (1)
src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts:67
hasCompletedPhasereads the detected plan file without any error handling. If the file exists but can’t be read (permissions, transient FS error), the whole command will reject and prevent users from starting/resuming project creation. Consider wrapping the read/parse in a try/catch and treating failures as “phase not completed” (or showing a targeted message).
async function hasCompletedPhase(filePath: string, expectedStatus: string): Promise<boolean> {
const files = await vscode.workspace.findFiles(filePath);
if (!files.length) {
return false;
}
const content = Buffer.from(await vscode.workspace.fs.readFile(files[0])).toString('utf-8');
return new RegExp(`status.*:.*${expectedStatus}`, 'i').test(content);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexweininger
previously approved these changes
May 13, 2026
Contributor
There was a problem hiding this comment.
Copilot's findings
Comments suppressed due to low confidence (1)
src/webviews/copilotOnRails/extension/createProjectWithCopilot.ts:67
hasCompletedPhasetakes the first URI returned byvscode.workspace.findFiles(...)and ignores the rest. In workspaces with multiple matching plan files (e.g., multiple apps or stale plans), this can select an arbitrary file and resume the wrong phase. Iterate all matches and return true if any matching file has the expected status (or disambiguate via quick pick / preference order).
async function hasCompletedPhase(filePath: string, expectedStatus: string): Promise<boolean> {
const files = await vscode.workspace.findFiles(filePath);
if (!files.length) {
return false;
}
const content = Buffer.from(await vscode.workspace.fs.readFile(files[0])).toString('utf-8');
return new RegExp(`status.*:\\s*${expectedStatus}`, 'i').test(content);
- Files reviewed: 3/3 changed files
- Comments generated: 2
nturinski
reviewed
May 13, 2026
nturinski
reviewed
May 13, 2026
nturinski
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.