Changesets · Branches · Tags · Compare
| Changeset | 625e95c1684134c8df9e59598647e1a4da8e5e3b8415fd386feb8921f780919e |
|---|---|
| Author | Jacob Kim <jacob@continue.dev> · 2025-08-20 18:00 -07:00 |
| Committer | GitHub <noreply@github.com> · 2025-08-20 21:00 -04:00 |
| Parents | fd844fe861c4 |
3 files changed
modified core/nextEdit/templating/NextEditPromptEngine.vitest.ts +6 −2
| @@ -14,6 +14,8 @@ | ||
| 14 | 14 | MERCURY_EDIT_DIFF_HISTORY_OPEN, |
| 15 | 15 | MERCURY_RECENTLY_VIEWED_CODE_SNIPPETS_CLOSE, |
| 16 | 16 | MERCURY_RECENTLY_VIEWED_CODE_SNIPPETS_OPEN, |
| 17 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE, | |
| 18 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN, | |
| 17 | 19 | } from "../constants"; |
| 18 | 20 | import { |
| 19 | 21 | renderDefaultSystemPrompt, |
| @@ -31,7 +33,7 @@ | ||
| 31 | 33 | |
| 32 | 34 | beforeEach(() => { |
| 33 | 35 | mercuryHelper = { |
| 34 | - modelName: "inception/mercury-coder-nextedit" as NEXT_EDIT_MODELS, | |
| 36 | + modelName: "inception/mercury-coder" as NEXT_EDIT_MODELS, | |
| 35 | 37 | fileContents: "function test() {\n const a = 1;\n return a;\n}", |
| 36 | 38 | pos: { line: 1, character: 12 } as Position, |
| 37 | 39 | lang: { name: "typescript" }, |
| @@ -63,7 +65,7 @@ | ||
| 63 | 65 | }; |
| 64 | 66 | }); |
| 65 | 67 | |
| 66 | - it("should render mercury-coder-nextedit prompt correctly", async () => { | |
| 68 | + it("should render mercury-coder prompt correctly", async () => { | |
| 67 | 69 | const result = await renderPrompt(mercuryHelper, ctx); |
| 68 | 70 | |
| 69 | 71 | expect(result).toHaveProperty("prompt"); |
| @@ -72,6 +74,8 @@ | ||
| 72 | 74 | const content = result.prompt.content; |
| 73 | 75 | expect(content).toContain(MERCURY_RECENTLY_VIEWED_CODE_SNIPPETS_OPEN); |
| 74 | 76 | expect(content).toContain(MERCURY_RECENTLY_VIEWED_CODE_SNIPPETS_CLOSE); |
| 77 | + expect(content).toContain(MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN); | |
| 78 | + expect(content).toContain(MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE); | |
| 75 | 79 | expect(content).toContain(MERCURY_CURRENT_FILE_CONTENT_OPEN); |
| 76 | 80 | expect(content).toContain(MERCURY_CURRENT_FILE_CONTENT_CLOSE); |
| 77 | 81 | expect(content).toContain(MERCURY_EDIT_DIFF_HISTORY_OPEN); |
modified core/nextEdit/templating/mercuryCoderNextEdit.ts +4 −0
| @@ -3,6 +3,8 @@ | ||
| 3 | 3 | MERCURY_CODE_TO_EDIT_CLOSE, |
| 4 | 4 | MERCURY_CODE_TO_EDIT_OPEN, |
| 5 | 5 | MERCURY_CURSOR, |
| 6 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE, | |
| 7 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN, | |
| 6 | 8 | } from "../constants"; |
| 7 | 9 | import { insertCursorToken } from "./utils"; |
| 8 | 10 | |
| @@ -11,8 +13,10 @@ | ||
| 11 | 13 | ) { |
| 12 | 14 | return recentlyViewedCodeSnippets.reduce((acc, snippet, i) => { |
| 13 | 15 | const block = [ |
| 16 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN, | |
| 14 | 17 | `code_snippet_file_path: ${snippet.filepath}`, |
| 15 | 18 | snippet.content, |
| 19 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE, | |
| 16 | 20 | ].join("\n"); |
| 17 | 21 | |
| 18 | 22 | return ( |
modified core/nextEdit/templating/mercuryCoderNextEdit.vitest.ts +7 −1
| @@ -4,6 +4,8 @@ | ||
| 4 | 4 | MERCURY_CODE_TO_EDIT_CLOSE, |
| 5 | 5 | MERCURY_CODE_TO_EDIT_OPEN, |
| 6 | 6 | MERCURY_CURSOR, |
| 7 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE, | |
| 8 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN, | |
| 7 | 9 | } from "../constants"; |
| 8 | 10 | import { |
| 9 | 11 | currentFileContentBlock, |
| @@ -25,10 +27,14 @@ | ||
| 25 | 27 | const result = recentlyViewedCodeSnippetsBlock(snippets); |
| 26 | 28 | |
| 27 | 29 | const expected = |
| 30 | + `${MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN}\n` + | |
| 28 | 31 | "code_snippet_file_path: /path/to/file1.ts\n" + |
| 29 | 32 | "const a = 1;\n" + |
| 33 | + `${MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE}\n` + | |
| 34 | + `${MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_OPEN}\n` + | |
| 30 | 35 | "code_snippet_file_path: /path/to/file2.ts\n" + |
| 31 | - "function test() { return true; }"; | |
| 36 | + "function test() { return true; }\n" + | |
| 37 | + MERCURY_RECENTLY_VIEWED_CODE_SNIPPET_CLOSE; | |
| 32 | 38 | |
| 33 | 39 | expect(result).toBe(expected); |
| 34 | 40 | }); |