Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

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

  • Added USE_CURRENT_BRANCH / USE_DEFAULT_BRANCH button constants and CHOOSE_BRANCH_MESSAGE prompt
  • Added isOnNonDefaultBranch condition in buildConfirmation() to detect when user is on a non-default branch that exists on remote
  • Handles both standalone case and auth-required combination (needsPermissiveAuth && isOnNonDefaultBranch)
  • Updated handleConfirmationData() to respect user's explicit branch choice via useDefaultBranch flag
// New condition covers the missing case
const isOnNonDefaultBranch = baseBranchInfo && 
  !baseBranchInfo.missingOnRemote && 
  baseBranchInfo.baseRef !== baseBranchInfo.repoDefaultBranch;

// User now sees: "Continue on `feature-branch`, or start from `main`?"
// with buttons: [Use Current Branch] [Use Default Branch]
Original 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:

  1. "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?" - User is seeking clarification on a bug and whether there is existing code to address it.
  2. "Is this not handled by 'PUSH_BRANCH_MESSAGE'?" - User is probing if a specific message constant is responsible for the expected behavior.]

[Technical Inventory:

  • 'PUSH_BRANCH_MESSAGE': A constant or message likely related to branch management in the codebase, potentially responsible for prompting users when switching branches.]

[Code Archaeology:

  • File: /Users/jospicer/dev/vscode-copilot-chat/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts
  • The file is related to chat session management within the VS Code Copilot Chat extension, specifically handling cloud sessions.]

[Progress Assessment:

  • Completed Tasks: User has identified a bug related to branch confirmation prompts.
  • Partially Complete Work: User is inquiring about existing code to address the bug, specifically the role of 'PUSH_BRANCH_MESSAGE'.]

[Context Validation: All critical information for continuation is captured, including the bug report and the inquiry about 'PUSH_BRANCH_MESSAGE'.]

[Recent Commands Analysis:

  • Last Agent Commands: The user did not execute specific commands but made inquiries regarding the bug and the handling of branch messages.
  • Tool Results Summary: No tool results were generated as the user was discussing code behavior rather than executing commands.
  • Pre-Summary State: The agent was actively discussing the bug related to branch confirmation prompts and the potential role of 'PUSH_BRANCH_MESSAGE' when the token budget was exceeded.
  • Operation Context: The user was seeking to understand if existing code could resolve the reported bug, indicating a focus on debugging and code verification.]
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.
  1. Technical Foundation:
  • 'PUSH_BRANCH_MESSAGE': A message constant likely related to branch management and user prompts in the codebase.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.
  1. 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.

Copilot AI self-assigned this Dec 5, 2025
Copilot AI and others added 2 commits December 5, 2025 22:35
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
Copilot AI requested a review from joshspicer December 5, 2025 22:39
Copilot finished work on behalf of joshspicer December 5, 2025 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants