MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / formatPatchFailureMessage

Function formatPatchFailureMessage

sdk/src/tools/apply-patch.ts:552–569  ·  view source on GitHub ↗
(params: {
  path: string
  attemptedStrategies: string[]
  lastError?: string
})

Source from the content-addressed store, hash-verified

550}
551
552function formatPatchFailureMessage(params: {
553 path: string
554 attemptedStrategies: string[]
555 lastError?: string
556}): string {
557 const { path, attemptedStrategies, lastError } = params
558
559 return [
560 `Failed to apply patch to ${path}.`,
561 attemptedStrategies.length > 0
562 ? `Tried strategies: ${attemptedStrategies.join(', ')}.`
563 : undefined,
564 lastError ? `Last error: ${lastError}.` : undefined,
565 'Please re-read the file and generate a patch with exact context lines.',
566 ]
567 .filter(Boolean)
568 .join(' ')
569}
570
571function successResult(file: string, action: PatchAction): ApplyPatchJson {
572 return {

Callers 1

applyPatchToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected