{"record":{"id":"0c34a7ecbed428d5","repo":"microsoft/vscode","slug":"sign-in-to-github-to-use-the-cloud-agent","errorCode":null,"errorMessage":"Sign in to GitHub to use the Cloud Agent.","messagePattern":"Sign in to GitHub to use the Cloud Agent\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/taskApiBackend.ts","lineNumber":465,"sourceCode":" * Real HTTP client for the Mission Control Task API, routing every call through\n * `ICAPIClientService.makeRequest({...}, { type: RequestType.AgentTask, ... })`.\n * The CAPI client maps the `action` discriminator to a URL under `api.github.com/agents/...`\n * (GHE-aware via the shared `dotcomAPIURL`). Auth is the same permissive GitHub\n * session used by the GitHub service.\n */\nexport class TaskApiHttpClient implements ITaskApiClient {\n\n\tconstructor(\n\t\tprivate readonly _capiClientService: ICAPIClientService,\n\t\tprivate readonly _authService: IAuthenticationService,\n\t\tprivate readonly _logService: ILogService,\n\t) { }\n\n\tprivate async _authHeaders(): Promise<Record<string, string>> {\n\t\tconst session = await this._authService.getGitHubSession('permissive', { silent: true });\n\t\tconst token = session?.accessToken;\n\t\tif (!token) {\n\t\t\tthrow new Error(l10n.t('Sign in to GitHub to use the Cloud Agent.'));\n\t\t}\n\t\treturn { Authorization: `Bearer ${token}`, Accept: 'application/json' };\n\t}\n\n\tprivate async _request<T>(\n\t\tmethod: 'GET' | 'POST',\n\t\taction: AgentTaskRequestAction,\n\t\topts: { owner?: string; repo?: string; taskId?: string; body?: unknown; searchParams?: Record<string, string | number | boolean> },\n\t): Promise<T | undefined> {\n\t\tconst headers = await this._authHeaders();\n\t\tconst init: { method: 'GET' | 'POST'; headers: Record<string, string>; body?: string } = { method, headers };\n\t\tif (opts.body !== undefined) {\n\t\t\tinit.headers['Content-Type'] = 'application/json';\n\t\t\tinit.body = JSON.stringify(opts.body);\n\t\t}\n\t\tconst response = await this._capiClientService.makeRequest<Response>(init, {\n\t\t\ttype: RequestType.AgentTask,\n\t\t\taction,","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/taskApiBackend.ts#L447-L483","documentation":"Error \"Sign in to GitHub to use the Cloud Agent.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/taskApiBackend.ts:465 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"}