{"record":{"id":"72d2d36885ca9453","repo":"microsoft/vscode","slug":"agent-returned-an-unexpected-http-response-statu","errorCode":null,"errorMessage":"Agent returned an unexpected HTTP ${response.status} error (request id ${requestId || 'unknown'}).","messagePattern":"Agent returned an unexpected HTTP (.+?) error \\(request id (.+?)\\)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/review/node/githubReviewAgent.ts","lineNumber":620,"sourceCode":"\t\t\treturn {\n\t\t\t\trequestId: undefined,\n\t\t\t\trl: undefined,\n\t\t\t};\n\t\t}\n\t\tthrow err;\n\t} finally {\n\t\tdisposable.dispose();\n\t}\n\n\tconst requestId = response.headers.get('x-github-request-id') || undefined;\n\n\tif (!response.ok) {\n\t\tif (response.status === 402) {\n\t\t\tconst err = new Error(`You have reached your Code Review quota limit.`);\n\t\t\t(err as any).severity = 'info';\n\t\t\tthrow err;\n\t\t}\n\t\tthrow new Error(`Agent returned an unexpected HTTP ${response.status} error (request id ${requestId || 'unknown'}).`);\n\t}\n\n\treturn {\n\t\trequestId,\n\t\trl: readline.createInterface({ input: Readable.fromWeb(response.body.toReadableStream()) }),\n\t};\n}\n\nexport function reversePatch(after: string, diff: string) {\n\tconst patch = parsePatch(diff.split(/\\r?\\n/));\n\tconst patchedLines = reverseParsedPatch(after.split(/\\r?\\n/), patch);\n\treturn patchedLines.join('\\n');\n}\n\nexport interface LineChange {\n\tbeforeLineNumber: number;\n\tcontent: string;\n\ttype: 'add' | 'remove';","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/review/node/githubReviewAgent.ts#L602-L638","documentation":"Error \"Agent returned an unexpected HTTP ${response.status} error (request id ${requestId || 'unknown'}).\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/review/node/githubReviewAgent.ts:620 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"}