microsoft/vscode · error · TaskApiError

Task API request failed: {0} {1}

Error message

Task API request failed: {0} {1}

What it means

Error "Task API request failed: {0} {1}" thrown in microsoft/vscode.

Source

Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/taskApiBackend.ts:493

		const headers = await this._authHeaders();
		const init: { method: 'GET' | 'POST'; headers: Record<string, string>; body?: string } = { method, headers };
		if (opts.body !== undefined) {
			init.headers['Content-Type'] = 'application/json';
			init.body = JSON.stringify(opts.body);
		}
		const response = await this._capiClientService.makeRequest<Response>(init, {
			type: RequestType.AgentTask,
			action,
			...(opts.owner !== undefined && { owner: opts.owner }),
			...(opts.repo !== undefined && { repo: opts.repo }),
			...(opts.taskId !== undefined && { taskId: opts.taskId }),
			...(opts.searchParams && { searchParams: opts.searchParams }),
		});
		if (!response.ok) {
			let body = '';
			try { body = await response.text(); } catch { /* ignore */ }
			this._logService.warn(`Task API ${action} failed: ${response.status} ${response.statusText} (owner=${opts.owner ?? 'n/a'}, repo=${opts.repo ?? 'n/a'}, taskId=${opts.taskId ?? 'n/a'}); body=${body.slice(0, 200)}`);
			throw new TaskApiError(l10n.t('Task API request failed: {0} {1}', response.status, response.statusText), response.status, action);
		}
		if (response.status === 204 || response.status === 202) {
			return undefined;
		}
		return await response.json() as T;
	}

	async createTask(owner: string, repo: string, request: AgentTaskCreateRequest): Promise<AgentTask> {
		const task = await this._request<AgentTask>('POST', 'create', { owner, repo, body: request });
		if (!task) {
			throw new Error(l10n.t('Task API createTask returned an empty response.'));
		}
		return task;
	}

	async listTasksForRepo(owner: string, repo: string, options?: ListTasksOptions): Promise<AgentTaskListResponse> {
		const response = await this._request<AgentTaskListResponse>('GET', 'list-for-repo', {
			owner, repo, searchParams: toSearchParams(options),

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/taskApiBackend.ts:493 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/e1e44a33549110f8. Report an issue: GitHub.