From 8175a3df065155c5a164e29bd1c47aad392ae555 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 28 Jun 2026 21:56:23 +0900 Subject: feat(cli): add --title flag to set tab title when summoning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a --title flag to the dispatch CLI so a summoned agent's conversation/tab gets a human-readable title at creation time instead of the auto-derived default (Untitled until the first message append). The title is carried as an additive optional ChatRequest.title field (the HTTP client-server contract), parsed + trimmed server-side in parseChatBody, and persisted via the conversation store's setConversationTitle in the POST /chat route BEFORE the turn starts — so the title is set atomically with creation and before --open signals the frontend to open the tab. No second HTTP round-trip is needed. A whitespace-only title is treated as absent (auto-derive); a non-string title yields HTTP 400. A title-set failure is logged but never blocks the turn (the title is a nicety, the answer is not). The change is purely additive — no existing behavior or assertion changes. Verification: typecheck EXIT 0; test 2021 passed | 6 skipped | 0 failed; check EXIT 0 (12 pre-existing warnings in untouched files). --- packages/cli/src/message.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'packages/cli/src/message.ts') diff --git a/packages/cli/src/message.ts b/packages/cli/src/message.ts index ddbec6b..5db9966 100644 --- a/packages/cli/src/message.ts +++ b/packages/cli/src/message.ts @@ -39,6 +39,7 @@ interface ChatCmd { readonly conversationId?: string | undefined; readonly reasoningEffort?: ReasoningEffort | undefined; readonly workspaceId?: string | undefined; + readonly title?: string | undefined; readonly showReasoning: boolean; } @@ -55,5 +56,6 @@ export function buildChatRequest(cmd: ChatCmd, ctx: BuildCtx): ChatRequest { ...(cmd.cwd !== undefined ? { cwd: cmd.cwd } : { cwd: ctx.cwd }), ...(cmd.reasoningEffort !== undefined && { reasoningEffort: cmd.reasoningEffort }), ...(cmd.workspaceId !== undefined && { workspaceId: cmd.workspaceId }), + ...(cmd.title !== undefined && { title: cmd.title }), }; } -- cgit v1.2.3