{"record":{"id":"668b366178536c50","repo":"microsoft/vscode","slug":"0","errorCode":null,"errorMessage":"{0}","messagePattern":"\\{0\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts","lineNumber":1655,"sourceCode":"\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\n\t * as the first argument, from which we resolve the task id. Shows a \"Creating pull request\"\n\t * progress notification while the Task API's `create-pr` endpoint runs and the PR is reflected\n\t * on the task; on success it shows no further message and instead flips the toolbar action to\n\t * \"Open pull request\" (which opens the PR in the browser) by updating the context keys in place.\n\t * The session list refreshes in place after the pull request is reflected on the task.\n\t */\n\tprivate async handleCreatePullRequestForTaskCommand(sessionItemOrResource?: vscode.ChatSessionItem | vscode.Uri): Promise<void> {\n\t\tconst backend = this._backend;\n\t\tconst resource = sessionItemOrResource instanceof vscode.Uri ? sessionItemOrResource : sessionItemOrResource?.resource;\n\t\tconst taskId = resource ? SessionIdForTask.parse(resource)?.taskId : undefined;\n\t\tif (!taskId) {","sourceCodeStart":1637,"sourceCodeEnd":1673,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts#L1637-L1673","documentation":"Error \"{0}\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:1655 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"}