From 074054710fca071fd4c4ce0aa2a2937304ffd242 Mon Sep 17 00:00:00 2001 From: Ronald Roy Date: Tue, 3 Feb 2026 12:02:11 -0800 Subject: [PATCH] fix: Remove arbitrary 12-character limit on AskUserQuestion header The header field validation was rejecting valid headers like "Image extraction" (16 chars). Claude Code's tool definition suggests 12 chars but doesn't enforce it, so this validation was overly strict. Also fixes vault-setup test that expected outdated content after daily-debrief command was updated. Co-Authored-By: Claude Opus 4.5 --- backend/src/__tests__/vault-setup.test.ts | 2 +- shared/src/__tests__/protocol.test.ts | 14 -------------- shared/src/protocol.ts | 4 ++-- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend/src/__tests__/vault-setup.test.ts b/backend/src/__tests__/vault-setup.test.ts index 1c4564db..8a9d4ba4 100644 --- a/backend/src/__tests__/vault-setup.test.ts +++ b/backend/src/__tests__/vault-setup.test.ts @@ -212,7 +212,7 @@ describe("installCommands", () => { // Verify custom file was replaced with server version const content = await readFile(join(commandsDir, "daily-debrief.md"), "utf-8"); expect(content).not.toBe(customContent); - expect(content).toContain("Quick focused conversation"); // Should have the real content + expect(content).toContain("Quick, focused conversation"); // Should have the real content }); test("reports mixed installed and updated files", async () => { diff --git a/shared/src/__tests__/protocol.test.ts b/shared/src/__tests__/protocol.test.ts index 4ea699c4..6198a078 100644 --- a/shared/src/__tests__/protocol.test.ts +++ b/shared/src/__tests__/protocol.test.ts @@ -1182,20 +1182,6 @@ describe("AskUserQuestion Schemas", () => { expect(result.options).toHaveLength(2); }); - test("rejects header longer than 12 characters", () => { - const longHeader = { - question: "Question?", - header: "VeryLongHeader", - options: [ - { label: "A", description: "Option A" }, - { label: "B", description: "Option B" }, - ], - multiSelect: false, - }; - - expect(() => AskUserQuestionItemSchema.parse(longHeader)).toThrow(ZodError); - }); - test("rejects less than 2 options", () => { const tooFewOptions = { question: "Question?", diff --git a/shared/src/protocol.ts b/shared/src/protocol.ts index 86f24ecb..8dc1a37e 100644 --- a/shared/src/protocol.ts +++ b/shared/src/protocol.ts @@ -486,8 +486,8 @@ export const AskUserQuestionOptionSchema = z.object({ export const AskUserQuestionItemSchema = z.object({ /** The full question text to display */ question: z.string().min(1, "Question text is required"), - /** Short label for the question (max 12 chars) */ - header: z.string().max(12, "Header must be 12 characters or less"), + /** Short label for the question */ + header: z.string().min(1, "Header is required"), /** Available choices (2-4 options) */ options: z.array(AskUserQuestionOptionSchema).min(2).max(4), /** If true, users can select multiple options */