microsoft/vscode · error · Error

Failed to find session item for forked session ${forkedSessi

Error message

Failed to find session item for forked session ${forkedSessionId}

What it means

Error "Failed to find session item for forked session ${forkedSessionId}" thrown in microsoft/vscode.

Source

Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:840

			return {
				title,
				history,
				activeResponseCallback: undefined,
				requestHandler: undefined,
				options: options,
			};
		}
	}

	private async forkSession(sessionId: string, requestId: string | undefined, token: CancellationToken): Promise<vscode.ChatSessionItem> {
		const folderInfo = await this.folderRepositoryManager.getFolderRepository(sessionId, undefined, token);
		const forkedSessionId = await this.sessionService.forkSession({ sessionId, requestId, workspace: folderInfo }, token);

		const items = await this.sessionItemProvider.provideChatSessionItems(token);
		const forkedSessionUri = SessionIdForCLI.getResource(forkedSessionId);
		const item = items.find(i => isEqual(i.resource, forkedSessionUri));
		if (!item) {
			throw new Error(`Failed to find session item for forked session ${forkedSessionId}`);
		}
		return item;
	}

	private async getSessionHistory(sessionId: string, workspaceInfo: IWorkspaceInfo, token: vscode.CancellationToken) {
		try {
			_invalidCopilotCLISessionIdsWithErrorMessage.delete(sessionId);
			const history = await this.sessionService.getChatHistory({ sessionId, workspace: workspaceInfo }, token);
			return history;
		} catch (error) {
			if (!isUnknownEventTypeError(error)) {
				throw error;
			}

			const partialHistory = await this.sessionService.tryGetPartialSessionHistory(sessionId);
			if (partialHistory) {
				_invalidCopilotCLISessionIdsWithErrorMessage.set(sessionId, error.message || String(error));
				return partialHistory;

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts:840 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12). Data as JSON: /api/errors/6767c35286507699. Report an issue: GitHub.