Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2import { buildRuntimeInstructions } from "./RuntimeInstructions.ts";
3
4describe("buildRuntimeInstructions", () => {
5 it("requires explicit registration of every PR and stack layer", () => {
6 const instructions = buildRuntimeInstructions({ harness: "Codex" });
7 expect(instructions).toContain("When the t3-code MCP server exposes link_pull_request");
8 expect(instructions).toContain("with the full PR URL immediately after creating a PR");
9 expect(instructions).toContain("For a stack, call it for every layer");
10 expect(instructions).toContain("call list_thread_pull_requests and link any PR");
11 });
12
13 it("keeps known model and effort metadata on one line", () => {
14 expect(
15 buildRuntimeInstructions({
16 harness: "Codex",
17 model: " custom\nmodel ",
18 reasoningEffort: " high\n",
19 }),
20 ).toContain("through the Codex harness, as custom model with high reasoning effort.");
21 });
22
23 it.each([undefined, "", "auto", "default"])("omits unresolved model %s", (model) => {
24 const instructions = buildRuntimeInstructions({ harness: "Cursor", model });
25 expect(instructions).toContain("through the Cursor harness.");
26 expect(instructions).not.toContain("reasoning effort");
27 });
28});