Fix automatic session title generation

This commit is contained in:
Federico Jaramillo Martinez
2026-05-08 15:06:04 +02:00
parent 99f434a259
commit b328c816f9
3 changed files with 40 additions and 7 deletions
@@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";
import { cleanSessionName, fallbackSessionName } from "./sessionNameGenerator.js";
describe("sessionNameGenerator", () => {
it("cleans model-generated titles", () => {
expect(cleanSessionName('Title: "Fix Session Naming."\nextra')).toBe("Fix Session Naming");
});
it("builds a concise fallback from the first request", () => {
expect(fallbackSessionName("Seems like auto name for sessions is not working, I still get the first message as a name."))
.toBe("Seems like auto name for sessions");
});
it("ignores skill blocks in fallback names", () => {
expect(fallbackSessionName('<skill name="x" location="/x">\nDo x\n</skill>\n\nCheck the UI now'))
.toBe("Check the UI now");
});
});