diff --git a/core/autocomplete/postprocessing/index.ts b/core/autocomplete/postprocessing/index.ts index 11cdf88d4e4..6ce3742d6a2 100644 --- a/core/autocomplete/postprocessing/index.ts +++ b/core/autocomplete/postprocessing/index.ts @@ -150,7 +150,7 @@ export function postprocessCompletion({ completion = completion.replace(/^\n+|\n+$/g, ""); } - if (llm.model.includes("mercury") || llm.model.includes("granite")) { + if (llm.model.includes("granite")) { // Granite tends to repeat the start of the line in the completion output let prefixEnd = prefix.split("\n").pop(); if (prefixEnd) { diff --git a/core/nextEdit/providers/MercuryCoderNextEditProvider.ts b/core/nextEdit/providers/MercuryCoderNextEditProvider.ts index 3d234a55983..49527c84ea3 100644 --- a/core/nextEdit/providers/MercuryCoderNextEditProvider.ts +++ b/core/nextEdit/providers/MercuryCoderNextEditProvider.ts @@ -43,7 +43,7 @@ export class MercuryCoderProvider extends BaseNextEditModelProvider { // Extract the code between the markdown code blocks. return message.slice( message.indexOf("```\n") + "```\n".length, - message.lastIndexOf("\n\n```"), + message.lastIndexOf("\n```"), ); }