{"record":{"id":"a83aff1713d6fd74","repo":"microsoft/vscode","slug":"repo-base-branch-is-not-detected-on-remote-push-y","errorCode":null,"errorMessage":"Repo base branch is not detected on remote. Push your branch and try again.","messagePattern":"Repo base branch is not detected on remote\\. Push your branch and try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts","lineNumber":1644,"sourceCode":"\t\t\ttry {\n\t\t\t\tstream.progress(vscode.l10n.t('Pushing base branch to remote'));\n\t\t\t\tconst baseBranch = await this.gitOperationsManager.pushBaseRefToRemote();\n\t\t\t\tstream.markdown(vscode.l10n.t('Base branch `{0}` pushed to remote.', baseBranch));\n\t\t\t} catch (error) {\n\t\t\t\tthis.logService.error(`Push branch failed: ${error}`);\n\t\t\t\tthrow vscode.l10n.t('{0}. Push the current branch to remote and try again.', (error instanceof Error ? error.message : String(error)) ?? vscode.l10n.t('Failed to push current branch.'));\n\t\t\t}\n\t\t}\n\n\t\t// Get the selected repository from the chat context for multiroot workspace support\n\t\tconst chatResource = metadata.chatContext.chatSessionContext?.chatSessionItem?.resource;\n\t\tconst selectedRepository = chatResource ? this.sessionRepositoryMap.get(chatResource) : undefined;\n\n\t\tconst base_ref: string = await (async () => {\n\t\t\tconst res = await this.checkBaseBranchPresentOnRemote(selectedRepository);\n\t\t\tif (!res) {\n\t\t\t\t// Unexpected\n\t\t\t\tthrow new Error(vscode.l10n.t('Repo base branch is not detected on remote. Push your branch and try again.'));\n\t\t\t}\n\t\t\treturn (res?.missingOnRemote || !res?.baseRef) ? res.repoDefaultBranch : res?.baseRef;\n\t\t})();\n\t\tstream.progress(vscode.l10n.t('Validating branch base branch exists on remote'));\n\n\t\t// Now trigger delegation\n\t\ttry {\n\t\t\tawait this.delegate(request, stream, context, token, metadata, base_ref, head_ref);\n\t\t} catch (error) {\n\t\t\tthis.logService.error(`Failure in delegation: ${error}`);\n\t\t\tthrow new Error(vscode.l10n.t('{0}', (error instanceof Error ? error.message : String(error))));\n\t\t}\n\t}\n\n\t/**\n\t * Handle a click on the chat input \"Create pull request\" toolbar action (contributed to\n\t * `chat/input/editing/sessionToolbar` and registered as\n\t * {@link CREATE_PULL_REQUEST_FOR_TASK_COMMAND_ID}). The toolbar passes the session resource","sourceCodeStart":1626,"sourceCodeEnd":1662,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts#L1626-L1662","documentation":"Error \"Repo base branch is not detected on remote. Push your branch and try again.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:1644 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}