Add confirmation prompt when on non-default branch without uncommitted changes#2457
Draft
Add confirmation prompt when on non-default branch without uncommitted changes#2457
Conversation
When user is on a non-default branch that exists on the remote with no uncommitted changes, they now get a confirmation prompt to choose between continuing on their current branch or starting from the default branch. This covers the missing case in the buildConfirmation method. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Add explicit non-null assertions (!) when destructuring baseBranchInfo in the isOnNonDefaultBranch blocks to make the code clearer and address code review feedback about null safety. Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug not showing confirmation prompt on non-default branch
Add confirmation prompt when on non-default branch without uncommitted changes
Dec 5, 2025
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.
Users on a non-default branch (present on remote) with no uncommitted changes were not getting prompted to choose between their current branch or the default branch before delegating to cloud agent.
Changes
USE_CURRENT_BRANCH/USE_DEFAULT_BRANCHbutton constants andCHOOSE_BRANCH_MESSAGEpromptisOnNonDefaultBranchcondition inbuildConfirmation()to detect when user is on a non-default branch that exists on remoteneedsPermissiveAuth && isOnNonDefaultBranch)handleConfirmationData()to respect user's explicit branch choice viauseDefaultBranchflagOriginal prompt
Yea, so that. Make sure to cover all cases.
[Chronological Review: The conversation began with the user reporting a bug related to not receiving a confirmation prompt when checked out to a non-default branch with no uncommitted changes. The user inquired if the issue was handled by 'PUSH_BRANCH_MESSAGE', indicating a desire to confirm if existing code could resolve the problem.][Intent Mapping:
[Technical Inventory:
[Code Archaeology:
[Progress Assessment:
[Context Validation: All critical information for continuation is captured, including the bug report and the inquiry about 'PUSH_BRANCH_MESSAGE'.]
[Recent Commands Analysis:
1. Conversation Overview: - Primary Objectives: - "When I'm checked out to a non-default branch (and NO uncommitted changes) I am not getting a confirmation prompt on whether I'd like to continue on 'current branch' or 'default.' That is a bug, we have the code for that right?" - "Is this not handled by 'PUSH_BRANCH_MESSAGE'?" - Session Context: The user reported a bug regarding branch confirmation prompts and inquired about the handling of this behavior in the codebase. - User Intent Evolution: The user transitioned from reporting a bug to seeking confirmation on whether existing code could address the issue.- Technical Foundation:
- 'PUSH_BRANCH_MESSAGE': A message constant likely related to branch management and user prompts in the codebase.
- Codebase Status:
- File Name: copilotCloudSessionsProvider.ts
- Purpose: Manages chat sessions within the VS Code Copilot Chat extension.
- Current State: User is investigating a bug related to branch confirmation prompts.
- Key Code Segments: Not specified in detail, but the focus is on the handling of branch messages.
- Dependencies: Related to the overall functionality of the chat session management.
- Problem Resolution:
- Issues Encountered: Bug related to missing confirmation prompts when switching branches.
- Solutions Implemented: None yet; user is inquiring about existing code.
- Debugging Context: Ongoing investigation into the role of 'PUSH_BRANCH_MESSAGE'.
- Lessons Learned: User is actively engaging with the code to understand its behavior.
- Progress Tracking:
- Completed Tasks: Identification of the bug.
- Partially Complete Work: Inquiry about the role of 'PUSH_BRANCH_MESSAGE'.
- Validated Outcomes: None yet; awaiting further investigation.
- Active Work State:
- Current Focus: Investigating the bug related to branch confirmation prompts.
- Recent Context: User has been discussing the bug and the potential role of 'PUSH_BRANCH_MESSAGE'.
- Working Code: No specific code snippets were modified or discussed recently.
- Immediate Context: User was addressing the bug and seeking clarification on existing code.
- Recent Operations:
- Last Agent Commands: User inquiries regarding the bug and 'PUSH_BRANCH_MESSAGE'.
- Tool Results Summary: No tool results generated; discussion focused on code behavior.
- Pre-Summary State: User was actively discussing the bug and potential solutions.
- Operation Context: User's inquiries are directly related to resolving the reported bug.
- Continuation Plan:
- Pending Task 1: Investigate the role of 'PUSH_BRANCH_MESSAGE' in handling branch confi...
Created from VS Code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.