Skip to content

Commit 1606486

Browse files
fix(evals): links written inside inline code are not pills
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent c6f7316 commit 1606486

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎evals/mcp-tool-use/file-link-grading.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ it("grades pills the way chat resolves them against the thread cwd", () => {
2222
"[`src/ws.ts`](/home/user/app/packages/server/src/ws.ts), [`src/index.ts` boots it](/home/user/app/packages/server/src/ws.ts)",
2323
"`/usr/bin/node`, `git rebase --onto`",
2424
"```md\n[example](docs/missing.md) and `src/missing.ts`\n```",
25+
"Write links as `[example](docs/missing.md)`.",
2526
].join("\n");
2627
const pills = Object.fromEntries(
2728
fileLinkPills(text, cwd, files).map((pill) => [pill.source, pill.works]),

‎evals/mcp-tool-use/file-link-grading.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export const fileLinkPills = (
6262
: link,
6363
);
6464
const sources = [
65-
...extractMarkdownLinkHrefs(prose),
65+
// A link written inside inline code renders as code.
66+
...extractMarkdownLinkHrefs(prose.replace(/`[^`\n]+`/g, "")),
6667
...extractInlineCodeSpans(withoutFileLabels).flatMap(
6768
(span) => inlineCodeFilePathCandidate(span) ?? [],
6869
),

0 commit comments

Comments
 (0)