{"record":{"id":"aee6339fadf465e2","repo":"microsoft/vscode","slug":"failed-to-get-session-item-for-forked-session-fo","errorCode":null,"errorMessage":"Failed to get session item for forked session ${forkedSessionId}","messagePattern":"Failed to get session item for forked session (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts","lineNumber":223,"sourceCode":"\t\t\t\t\t// Given we're done generating a title, refresh the contents of this session so that the new title is picked up.\n\t\t\t\t\tif (this.controller.items.get(resource)) {\n\t\t\t\t\t\tthis.refreshSession({ reason: 'update', sessionId }).catch(() => { /* expected if session was deleted */ });\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.catch(ex => this.logService.error(ex, 'Failed to generate custom session title'));\n\n\t\t\tcontroller.items.add(session);\n\t\t\tthis.newSessions.set(resource, session);\n\t\t\treturn session;\n\t\t};\n\t\tif (this.configurationService.getConfig(ConfigKey.Advanced.CLIForkSessionsEnabled)) {\n\t\t\tcontroller.forkHandler = async (sessionResource: Uri, request: ChatRequestTurn2 | undefined, token: vscode.CancellationToken) => {\n\t\t\t\tconst sessionId = SessionIdForCLI.parse(sessionResource);\n\t\t\t\tconst folderInfo = await this.folderRepositoryManager.getFolderRepository(sessionId, undefined, token);\n\t\t\t\tconst forkedSessionId = await this.sessionService.forkSession({ sessionId, requestId: request?.id, workspace: folderInfo }, token);\n\t\t\t\tconst item = await this.sessionService.getSessionItem(forkedSessionId, token);\n\t\t\t\tif (!item) {\n\t\t\t\t\tthrow new Error(`Failed to get session item for forked session ${forkedSessionId}`);\n\t\t\t\t}\n\t\t\t\treturn this.toChatSessionItem(item, undefined, token);\n\t\t\t};\n\t\t}\n\t\t// Defers the slow `buildChanges` (git diff) call to when the editor renders the item.\n\t\tif (this.configurationService.getConfig(ConfigKey.Advanced.CLIChatLazyLoadSessionItem)) {\n\t\t\tcontroller.resolveChatSessionItem = async (item, token) => {\n\t\t\t\tconst sessionId = SessionIdForCLI.parse(item.resource);\n\t\t\t\tconst session = await this.sessionService.getSessionItem(sessionId, token);\n\t\t\t\tif (!session || token.isCancellationRequested) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst updatedItem = await this.toChatSessionItem(session, { includeChanges: true }, token);\n\t\t\t\tcontroller.items.add(updatedItem);\n\t\t\t};\n\t\t}\n\t\tthis._register(this.sessionService.onDidDeleteSession(async (e) => {\n\t\t\tcontroller.items.delete(SessionIdForCLI.getResource(e));","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts#L205-L241","documentation":"Error \"Failed to get session item for forked session ${forkedSessionId}\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessions.ts:223 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"}