From 62c74820cce0cb435ca1ed2d771be20b4933d105 Mon Sep 17 00:00:00 2001 From: Dotta Date: Sat, 6 Jun 2026 20:09:22 +0000 Subject: [PATCH] Guard runtime skill mention lookup --- .../__tests__/heartbeat-project-env.test.ts | 22 +++++++++++++++---- server/src/services/heartbeat.ts | 4 +++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/server/src/__tests__/heartbeat-project-env.test.ts b/server/src/__tests__/heartbeat-project-env.test.ts index 410e0f111d6..1f62aa76197 100644 --- a/server/src/__tests__/heartbeat-project-env.test.ts +++ b/server/src/__tests__/heartbeat-project-env.test.ts @@ -274,9 +274,11 @@ describe("resolveExecutionRunAdapterConfig", () => { }); describe("extractMentionedSkillIdsFromSources", () => { - it("collects explicit skill mention ids across issue sources", () => { - const releaseHref = buildSkillMentionHref("skill-1", "release-changelog"); - const browserHref = buildSkillMentionHref("skill-2", "agent-browser"); + it("collects UUID skill mention ids across issue sources", () => { + const releaseSkillId = "11111111-1111-4111-8111-111111111111"; + const browserSkillId = "22222222-2222-4222-8222-222222222222"; + const releaseHref = buildSkillMentionHref(releaseSkillId, "release-changelog"); + const browserHref = buildSkillMentionHref(browserSkillId, "agent-browser"); expect( extractMentionedSkillIdsFromSources([ @@ -284,7 +286,19 @@ describe("extractMentionedSkillIdsFromSources", () => { `And also [/agent-browser](${browserHref})`, `Duplicate mention [/release-changelog](${releaseHref})`, ]), - ).toEqual(["skill-1", "skill-2"]); + ).toEqual([releaseSkillId, browserSkillId]); + }); + + it("ignores legacy non-UUID skill mention ids before runtime database lookup", () => { + const validSkillId = "33333333-3333-4333-8333-333333333333"; + const validHref = buildSkillMentionHref(validSkillId, "greploop"); + const legacyHref = buildSkillMentionHref("skill-greploop", "greploop"); + + expect( + extractMentionedSkillIdsFromSources([ + `Use [/greploop](${legacyHref}) and [/prcheckloop](${validHref})`, + ]), + ).toEqual([validSkillId]); }); }); diff --git a/server/src/services/heartbeat.ts b/server/src/services/heartbeat.ts index 6a7ec69e99c..5903c11f81a 100644 --- a/server/src/services/heartbeat.ts +++ b/server/src/services/heartbeat.ts @@ -528,7 +528,9 @@ export function extractMentionedSkillIdsFromSources( for (const source of sources) { if (typeof source !== "string" || source.length === 0) continue; for (const skillId of extractSkillMentionIds(source)) { - mentionedIds.add(skillId); + if (isUuidLike(skillId)) { + mentionedIds.add(skillId); + } } } return [...mentionedIds];