{"record":{"id":"fff626ecb29b467c","repo":"microsoft/vscode","slug":"patchmuststartwithbeginpatch","errorCode":"patchMustStartWithBeginPatch","errorMessage":"Patch must start with *** Begin Patch\\n","messagePattern":"Patch must start with \\*\\*\\* Begin Patch\\\\n","errorType":"exception","errorClass":"InvalidPatchFormatError","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/tools/node/applyPatch/parser.ts","lineNumber":954,"sourceCode":"\t\t} else if (change.type === ActionType.ADD) {\n\t\t\twriteFn(p, change.newContent ?? '');\n\t\t} else if (change.type === ActionType.UPDATE) {\n\t\t\tif (change.movePath) {\n\t\t\t\twriteFn(change.movePath, change.newContent ?? '');\n\t\t\t\tremoveFn(p);\n\t\t\t} else {\n\t\t\t\twriteFn(p, change.newContent ?? '');\n\t\t\t}\n\t\t}\n\t}\n}\n\nexport async function processPatch(\n\ttext: string,\n\topenFn: (p: string) => Promise<AbstractDocumentWithLanguageId | TextDocument>,\n): Promise<Commit> {\n\tif (!text.startsWith(PATCH_PREFIX)) {\n\t\tthrow new InvalidPatchFormatError('Patch must start with *** Begin Patch\\\\n', 'patchMustStartWithBeginPatch');\n\t}\n\tconst paths = identify_files_needed(text);\n\tconst orig = await load_files(paths, openFn);\n\tconst [patch, _fuzz] = text_to_patch(text, orig);\n\treturn patch_to_commit(patch, orig);\n}\n","sourceCodeStart":936,"sourceCodeEnd":961,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/tools/node/applyPatch/parser.ts#L936-L961","documentation":"Error \"Patch must start with *** Begin Patch\\n\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/tools/node/applyPatch/parser.ts:954 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"}