feat(coding-agent): add configurable title system prompt for sessions

- add discovery of `TITLE_SYSTEM.md` and pass it through interactive startup context
- route custom title prompts to online and local tiny title generators via protocol
- update session-title docs and changelog with override behavior
- add tests for prompt discovery, forwarding, and fallback to bundled title prompts
This commit is contained in:
Adryel Dearo
2026-06-09 14:13:20 -03:00
committed by can1357
parent 96defff9a5
commit ecbc2a3c15
15 changed files with 232 additions and 19 deletions
@@ -243,6 +243,27 @@ describe("tiny title generator routing", () => {
expect(online).not.toHaveBeenCalled();
});
it("passes the resolved TITLE_SYSTEM.md prompt to the local client", async () => {
const model = getModelOrThrow("claude-sonnet-4-5");
const customPrompt = "Generate lowercase colon-delimited session names.";
const local = vi.spyOn(tinyTitleClient, "generate").mockResolvedValue("Local Title");
const online = mockOnlineTitle("Online Title");
const title = await generateSessionTitle(
"Investigate routing",
createRegistry(model),
createSettings(model, "lfm2-350m"),
undefined,
undefined,
undefined,
customPrompt,
);
expect(title).toBe("Local Title");
expect(local).toHaveBeenCalledWith("lfm2-350m", "Investigate routing", { systemPrompt: customPrompt });
expect(online).not.toHaveBeenCalled();
});
it("starts online fallback immediately when local returns null", async () => {
const model = getModelOrThrow("claude-sonnet-4-5");
vi.spyOn(tinyTitleClient, "generate").mockResolvedValue(null);