From e6708734ee83667fe140d64d83f8c6a334faca0a Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Tue, 29 Sep 2026 07:37:46 -0300 Subject: [PATCH] test(skills): read CLI endpoint examples from the generated references too #14293 moved oversized endpoint sections from SKILL.md into references/endpoints.md, so the CLI configuration contract test found no GET /api/cli-tools/config section in the body and went red on the tip. --- tests/unit/cli-configuration-consumer-contract.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/unit/cli-configuration-consumer-contract.test.ts b/tests/unit/cli-configuration-consumer-contract.test.ts index 36d4c3b31b9..7f9fd2d2412 100644 --- a/tests/unit/cli-configuration-consumer-contract.test.ts +++ b/tests/unit/cli-configuration-consumer-contract.test.ts @@ -5,12 +5,15 @@ import { parseOpenapi } from "../../src/lib/agentSkills/openapiParser.ts"; import { buildApiOperationExample } from "../../src/lib/agentSkills/apiOperationExample.ts"; test("generated CLI skill uses header previews and original-input dry-run application", () => { - const { body } = buildSkillMarkdown("omni-cli-tools", { + const { body, references } = buildSkillMarkdown("omni-cli-tools", { openapi: parseOpenapi(), cliRegistry: { commands: new Map(), families: new Map() }, }); + // #14293 moved oversized endpoint sections out of SKILL.md into + // references/endpoints.md, so the examples may live in either document. + const docs = [body, ...references.map((reference) => reference.content)].join("\n"); const section = (method: string, path: string) => - body.split(`### ${method} ${path}\n`)[1]?.split("\n### ")[0] || ""; + docs.split(`### ${method} ${path}\n`)[1]?.split("\n### ")[0] || ""; const preview = section("GET", "/api/cli-tools/config"); assert.ok(preview.includes("x-omniroute-config-api-key: ")); assert.ok(!preview.includes("?apiKey="));