Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { threadTitleTextFromPrompt } from "./threadTitle.ts";
4
5describe("threadTitleTextFromPrompt", () => {
6 it("names a mentioned model by its slug, without the reference syntax", () => {
7 expect(threadTitleTextFromPrompt("Delegate to model:codex/gpt-6.1-sol and report back")).toBe(
8 "Delegate to gpt-6.1-sol and report back",
9 );
10 expect(
11 threadTitleTextFromPrompt("model:opencode/anthropic/opus, then model:codex/gpt-5.4."),
12 ).toBe("anthropic/opus, then gpt-5.4.");
13 });
14
15 it("composes NFD macOS paths mentioned in the prompt", () => {
16 expect(threadTitleTextFromPrompt("Read @\u1109\u1175\u110b\u1161\u11ab/a.txt")).toBe(
17 "Read @\uc2dc\uc548/a.txt",
18 );
19 });
20});