Add interactive prompt for uncommitted changes in cloud agent workflow #1484
+71
−6
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.
Overview
This PR enhances the Copilot Cloud Chat Session Provider to provide a better user experience when local git changes are detected. Instead of blocking with an error message, users are now prompted to either commit their changes and continue, or cancel the request.
Problem
Previously, when a user attempted to delegate work to the cloud agent with uncommitted changes in their workspace, the system would immediately fail with an error message:
This required users to:
This workflow was disruptive and added unnecessary friction to the user experience.
Solution
The cloud agent now detects uncommitted changes and presents an interactive modal dialog with two options:
User Experience Flow
Technical Details
Modified File:
src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.tsshowWarningMessagemodalrepo.add()to stage changesrepo.commit()to create commitrepo.push()to push to remotecopilot.codingAgent.uncommittedChangesto track user decisionsBenefits
✅ Seamless workflow - Users can continue with their task without context switching
✅ User choice - Users maintain control over whether to commit or cancel
✅ Transparency - Clear progress messages inform users what's happening
✅ Safety - Proper error handling ensures users are informed if operations fail
✅ Telemetry - User decisions are tracked to understand usage patterns
Testing
npm run compile)npm run typecheck)npm run lint)tsfmtOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.