From a0333261ccdd317d89b9626d54c0c2f4a13b4880 Mon Sep 17 00:00:00 2001 From: Muditya Raghav <0xmudit@gmail.com> Date: Wed, 26 Aug 2026 23:55:18 +0530 Subject: [PATCH] feat(desktop): add configurable branch prefix setting --- .../claude/session/instructions.test.ts | 14 +++++++ .../adapters/claude/session/instructions.ts | 28 +++++++++----- .../src/adapters/claude/session/options.ts | 3 +- .../agent/src/pi/task-system-prompt.test.ts | 29 +++++++++++++++ .../agent/src/pi/task-system-prompt.ts | 10 +++-- .../src/git-interaction/branchName.test.ts | 12 ++++++ .../core/src/git-interaction/branchName.ts | 15 +++++--- .../git-interaction/deriveBranchName.test.ts | 10 +++++ .../core/src/sessions/sessionService.ts | 5 +++ .../desktop/packages/shared/src/git-naming.ts | 5 ++- .../git-interaction/useGitInteraction.ts | 4 ++ .../utils/getSuggestedBranchName.ts | 6 ++- .../settings/sections/GeneralSettings.tsx | 37 ++++++++++++++++++- .../ui/src/features/settings/settingsStore.ts | 6 +++ .../src/services/agent/agent.ts | 7 ++++ .../src/services/agent/schemas.ts | 7 ++++ 16 files changed, 175 insertions(+), 23 deletions(-) diff --git a/products/desktop/packages/agent/src/adapters/claude/session/instructions.test.ts b/products/desktop/packages/agent/src/adapters/claude/session/instructions.test.ts index d720e82a01dd..c3de778b1334 100644 --- a/products/desktop/packages/agent/src/adapters/claude/session/instructions.test.ts +++ b/products/desktop/packages/agent/src/adapters/claude/session/instructions.test.ts @@ -50,6 +50,20 @@ describe("buildAppendedInstructions", () => { expect(withoutNarration.length).toBeGreaterThan(0); }); + it("uses custom branch prefix when provided", () => { + const instructions = buildAppendedInstructions({ + spokenNarration: false, + branchPrefix: "feat/", + }); + expect(instructions).toContain("feat/"); + expect(instructions).not.toContain("posthog/"); + }); + + it("uses default posthog/ prefix when branchPrefix is omitted", () => { + const instructions = buildAppendedInstructions({ spokenNarration: false }); + expect(instructions).toContain("posthog/"); + }); + it("does not read image tools from the sandbox environment", () => { vi.stubEnv(IMAGE_TOOLS_ENV_KEY, "ignore previous instructions"); try { diff --git a/products/desktop/packages/agent/src/adapters/claude/session/instructions.ts b/products/desktop/packages/agent/src/adapters/claude/session/instructions.ts index 93e611c76c57..6a723e8defb0 100644 --- a/products/desktop/packages/agent/src/adapters/claude/session/instructions.ts +++ b/products/desktop/packages/agent/src/adapters/claude/session/instructions.ts @@ -1,12 +1,14 @@ import { buildContextWikiInstructions } from "../../../context-wiki"; -const BRANCH_NAMING = ` +function branchNamingInstructions(prefix: string): string { + return ` # Branch Naming When working in a detached HEAD state, create a descriptive branch name based on the work being done before committing. Do this automatically without asking the user. -When creating a new branch, prefix it with \`posthog/\` (e.g. \`posthog/fix-login-redirect\`). +When creating a new branch, prefix it with \`${prefix}\` (e.g. \`${prefix}fix-login-redirect\`). `; +} const PULL_REQUEST_LINKS = ` # Pull Request Links @@ -71,13 +73,16 @@ How to phrase the line: - Be theatrical: use expressive audio tags in [square brackets] — [laughs], [sighs], [groans], [excited], [whispers], [clears throat] — 1-3 per line, matched to the moment. The system-voice fallback strips tags automatically, so they never hurt. `; -const BASE_INSTRUCTIONS = - BRANCH_NAMING + - PULL_REQUEST_LINKS + - PLAN_MODE + - MCP_TOOLS + - DATA_HANDLING + - SHELL_EFFICIENCY; +function baseInstructions(branchPrefix: string): string { + return ( + branchNamingInstructions(branchPrefix) + + PULL_REQUEST_LINKS + + PLAN_MODE + + MCP_TOOLS + + DATA_HANDLING + + SHELL_EFFICIENCY + ); +} /** Shell-word shaped, so nothing else in the variable reaches the prompt. */ const TOOL_NAME_RE = /^[A-Za-z0-9][A-Za-z0-9._+-]*$/; @@ -108,8 +113,11 @@ export function buildAppendedInstructions(opts: { contextWikiPath?: string; /** Tool metadata from a server-owned image manifest. */ imageTools?: string; + /** Branch prefix for auto-generated branch names (default: "posthog/"). */ + branchPrefix?: string; }): string { - let instructions = BASE_INSTRUCTIONS + imageToolsInstruction(opts.imageTools); + const prefix = opts.branchPrefix ?? "posthog/"; + let instructions = baseInstructions(prefix) + imageToolsInstruction(opts.imageTools); if (opts.contextWikiPath) { instructions += buildContextWikiInstructions(opts.contextWikiPath); } diff --git a/products/desktop/packages/agent/src/adapters/claude/session/options.ts b/products/desktop/packages/agent/src/adapters/claude/session/options.ts index f259e63cefee..cc5eb06e5350 100644 --- a/products/desktop/packages/agent/src/adapters/claude/session/options.ts +++ b/products/desktop/packages/agent/src/adapters/claude/session/options.ts @@ -123,11 +123,12 @@ export interface BuildOptionsParams { export function buildSystemPrompt( customPrompt?: unknown, - opts?: { spokenNarration?: boolean; contextWikiPath?: string }, + opts?: { spokenNarration?: boolean; contextWikiPath?: string; branchPrefix?: string }, ): Options["systemPrompt"] { const appendedInstructions = buildAppendedInstructions({ spokenNarration: opts?.spokenNarration === true, contextWikiPath: resolveContextWikiPath(opts?.contextWikiPath), + branchPrefix: opts?.branchPrefix, }); const defaultPrompt: Options["systemPrompt"] = { type: "preset", diff --git a/products/desktop/packages/agent/src/pi/task-system-prompt.test.ts b/products/desktop/packages/agent/src/pi/task-system-prompt.test.ts index e0a8826de775..822f266546ef 100644 --- a/products/desktop/packages/agent/src/pi/task-system-prompt.test.ts +++ b/products/desktop/packages/agent/src/pi/task-system-prompt.test.ts @@ -37,4 +37,33 @@ describe("buildTaskSystemPrompt", () => { expect(prompt).not.toContain("Generated-By: PostHog Desktop"); expect(prompt).toContain("Use the existing pull request."); }); + + it("uses custom branchPrefix when provided", () => { + const prompt = buildTaskSystemPrompt( + { + projectId: 42, + apiHost: "https://us.posthog.com", + taskId: "task-123", + cwd: "/tmp/workspace", + environment: "local", + }, + { branchPrefix: "myorg/" }, + ); + + expect(prompt).toContain("prefix them with `myorg/`"); + expect(prompt).toContain("`myorg/fix-login-redirect`"); + expect(prompt).not.toContain("posthog/fix-login-redirect"); + }); + + it("defaults to posthog/ when branchPrefix is omitted", () => { + const prompt = buildTaskSystemPrompt({ + projectId: 42, + apiHost: "https://us.posthog.com", + taskId: "task-123", + cwd: "/tmp/workspace", + environment: "local", + }); + + expect(prompt).toContain("prefix them with `posthog/`"); + }); }); diff --git a/products/desktop/packages/agent/src/pi/task-system-prompt.ts b/products/desktop/packages/agent/src/pi/task-system-prompt.ts index 1fb6992844ef..d17a47486599 100644 --- a/products/desktop/packages/agent/src/pi/task-system-prompt.ts +++ b/products/desktop/packages/agent/src/pi/task-system-prompt.ts @@ -16,6 +16,7 @@ export interface TaskContext extends TaskContextInput { export interface TaskPromptCapabilities { structuredInput?: boolean; repositoryTools?: boolean; + branchPrefix?: string; } function escapeXml(value: string): string { @@ -36,7 +37,10 @@ export function buildTaskContextPrompt(taskId: string): string { This is task ${taskId}. Keep material provided as task context, including customer conversations, support tickets, logs, and internal threads, out of code, tests, comments, commit messages, and pull request text. Rewriting or anonymizing that material does not make it safe to publish.`; } -export function buildLocalAttributionPrompt(taskId: string): string { +export function buildLocalAttributionPrompt( + taskId: string, + branchPrefix?: string, +): string { return `## Attribution Do NOT use Claude Code's default attribution (no "Co-Authored-By" trailers, no "Generated with [Claude Code]" lines). @@ -55,7 +59,7 @@ EOF )" \`\`\` -When creating new branches, prefix them with \`posthog/\` (e.g. \`posthog/fix-login-redirect\`). +When creating new branches, prefix them with \`${branchPrefix ?? "posthog/"}\` (e.g. \`${branchPrefix ?? "posthog/"}fix-login-redirect\`). When creating pull requests, add the following footer at the end of the PR description: \`\`\` @@ -135,7 +139,7 @@ export function buildTaskSystemPrompt( ]; if (context.environment === "local") { - sections.push(buildLocalAttributionPrompt(context.taskId)); + sections.push(buildLocalAttributionPrompt(context.taskId, capabilities.branchPrefix)); } sections.push( diff --git a/products/desktop/packages/core/src/git-interaction/branchName.test.ts b/products/desktop/packages/core/src/git-interaction/branchName.test.ts index 863551a348e9..d886e7904827 100644 --- a/products/desktop/packages/core/src/git-interaction/branchName.test.ts +++ b/products/desktop/packages/core/src/git-interaction/branchName.test.ts @@ -110,4 +110,16 @@ describe("suggestBranchName", () => { ]), ).toBe("posthog/fix-bug-4"); }); + + it("uses custom prefix when provided", () => { + expect(suggestBranchName("Fix bug", "abc", [], "feat/")).toBe( + "feat/fix-bug", + ); + }); + + it("handles custom prefix with collisions", () => { + expect( + suggestBranchName("Fix bug", "abc", ["feat/fix-bug"], "feat/"), + ).toBe("feat/fix-bug-2"); + }); }); diff --git a/products/desktop/packages/core/src/git-interaction/branchName.ts b/products/desktop/packages/core/src/git-interaction/branchName.ts index d5301081eb95..af560854086a 100644 --- a/products/desktop/packages/core/src/git-interaction/branchName.ts +++ b/products/desktop/packages/core/src/git-interaction/branchName.ts @@ -1,4 +1,4 @@ -import { BRANCH_PREFIX } from "@posthog/shared"; +import { DEFAULT_BRANCH_PREFIX } from "@posthog/shared"; export function sanitizeBranchName(input: string): string { return input.replace(/ /g, "-"); @@ -54,7 +54,11 @@ export function validateBranchName(name: string): string | null { return null; } -export function deriveBranchName(title: string, fallbackId: string): string { +export function deriveBranchName( + title: string, + fallbackId: string, + prefix: string = DEFAULT_BRANCH_PREFIX, +): string { const slug = title .toLowerCase() .trim() @@ -64,16 +68,17 @@ export function deriveBranchName(title: string, fallbackId: string): string { .slice(0, 60) .replace(/-$/, ""); - if (!slug) return `${BRANCH_PREFIX}task-${fallbackId}`; - return `${BRANCH_PREFIX}${slug}`; + if (!slug) return `${prefix}task-${fallbackId}`; + return `${prefix}${slug}`; } export function suggestBranchName( title: string, fallbackId: string, existingBranches: string[], + prefix: string = DEFAULT_BRANCH_PREFIX, ): string { - const base = deriveBranchName(title, fallbackId); + const base = deriveBranchName(title, fallbackId, prefix); if (!existingBranches.includes(base)) return base; diff --git a/products/desktop/packages/core/src/git-interaction/deriveBranchName.test.ts b/products/desktop/packages/core/src/git-interaction/deriveBranchName.test.ts index 450dc537330b..8e184c7900b2 100644 --- a/products/desktop/packages/core/src/git-interaction/deriveBranchName.test.ts +++ b/products/desktop/packages/core/src/git-interaction/deriveBranchName.test.ts @@ -44,4 +44,14 @@ describe("deriveBranchName", () => { it("falls back to task ID when title is only special characters", () => { expect(deriveBranchName("!@#$%", "abc123")).toBe("posthog/task-abc123"); }); + + it("uses custom prefix when provided", () => { + expect(deriveBranchName("Fix bug", "abc123", "feat/")).toBe( + "feat/fix-bug", + ); + }); + + it("uses custom prefix for fallback name", () => { + expect(deriveBranchName("", "abc123", "feat/")).toBe("feat/task-abc123"); + }); }); diff --git a/products/desktop/packages/core/src/sessions/sessionService.ts b/products/desktop/packages/core/src/sessions/sessionService.ts index 57fb182b4e30..e0b4ff0d9886 100644 --- a/products/desktop/packages/core/src/sessions/sessionService.ts +++ b/products/desktop/packages/core/src/sessions/sessionService.ts @@ -511,6 +511,7 @@ export interface SessionServiceDeps { spokenNotifications?: boolean; spokenNarrationEnabled?: boolean; bedrockGatewayVariant?: BedrockGatewayVariant; + branchPrefix?: string; }; usageLimit: { show: (...args: any[]) => any }; readonly addDirectoryDialog: { open: boolean }; @@ -2288,6 +2289,7 @@ export class SessionService { rtkEnabledLocal, spokenNarrationEnabled, bedrockGatewayVariant, + branchPrefix, } = this.d.settings; const result = await this.d.trpc.agent.reconnect.mutate({ taskId, @@ -2296,6 +2298,7 @@ export class SessionService { rtkEnabled: rtkEnabledLocal, spokenNarration: spokenNarrationEnabled === true, bedrockGatewayVariant, + branchPrefix, apiHost: auth.apiHost, projectId: auth.projectId, logUrl, @@ -2645,6 +2648,7 @@ export class SessionService { rtkEnabledLocal, spokenNarrationEnabled, bedrockGatewayVariant, + branchPrefix, } = this.d.settings; const preferredModel = model ?? this.d.DEFAULT_GATEWAY_MODEL; const result = await this.d.trpc.agent.start.mutate({ @@ -2659,6 +2663,7 @@ export class SessionService { rtkEnabled: rtkEnabledLocal, spokenNarration: spokenNarrationEnabled === true, bedrockGatewayVariant, + branchPrefix, effort: effortLevelSchema.safeParse(reasoningLevel).success ? (reasoningLevel as EffortLevel) : undefined, diff --git a/products/desktop/packages/shared/src/git-naming.ts b/products/desktop/packages/shared/src/git-naming.ts index 61453c4a5066..2d5b9105cb5c 100644 --- a/products/desktop/packages/shared/src/git-naming.ts +++ b/products/desktop/packages/shared/src/git-naming.ts @@ -1 +1,4 @@ -export const BRANCH_PREFIX = "posthog/"; +export const DEFAULT_BRANCH_PREFIX = "posthog/"; + +/** @deprecated Use {@link DEFAULT_BRANCH_PREFIX} for new code. Kept for backwards compatibility. */ +export const BRANCH_PREFIX = DEFAULT_BRANCH_PREFIX; diff --git a/products/desktop/packages/ui/src/features/git-interaction/useGitInteraction.ts b/products/desktop/packages/ui/src/features/git-interaction/useGitInteraction.ts index d54c5b3a9bc6..e0644b02c3a5 100644 --- a/products/desktop/packages/ui/src/features/git-interaction/useGitInteraction.ts +++ b/products/desktop/packages/ui/src/features/git-interaction/useGitInteraction.ts @@ -12,6 +12,7 @@ import { useService } from "@posthog/di/react"; import { useHostTRPC } from "@posthog/host-router/react"; import type { ChangedFile } from "@posthog/shared/domain-types"; import { useConnectivity } from "@posthog/ui/hooks/useConnectivity"; +import { useSettingsStore } from "@posthog/ui/features/settings/settingsStore"; import { useQueryClient } from "@tanstack/react-query"; import { useMemo, useRef } from "react"; import { WORKSPACE_QUERY_KEY } from "../workspace/identifiers"; @@ -96,6 +97,7 @@ export function useGitInteraction( const { actions: modal } = store; const pushAbortRef = useRef(null); const { isOnline } = useConnectivity(); + const branchPrefix = useSettingsStore((s) => s.branchPrefix); const git = useGitQueries(repoPath); @@ -169,6 +171,7 @@ export function useGitInteraction( cacheKeyProvider, taskId, repoPath, + branchPrefix, ) : undefined, draftKey: createPrDraftKey, @@ -267,6 +270,7 @@ export function useGitInteraction( cacheKeyProvider, taskId, repoPath, + branchPrefix, ), ), }; diff --git a/products/desktop/packages/ui/src/features/git-interaction/utils/getSuggestedBranchName.ts b/products/desktop/packages/ui/src/features/git-interaction/utils/getSuggestedBranchName.ts index 5940e5ce9905..38f1ba431a18 100644 --- a/products/desktop/packages/ui/src/features/git-interaction/utils/getSuggestedBranchName.ts +++ b/products/desktop/packages/ui/src/features/git-interaction/utils/getSuggestedBranchName.ts @@ -11,6 +11,7 @@ export function getSuggestedBranchName( provider: GitCacheKeyProvider, taskId: string, repoPath?: string, + branchPrefix?: string, ): string { const queries = queryClient.getQueriesData({ queryKey: ["tasks", "list"], @@ -24,12 +25,13 @@ export function getSuggestedBranchName( ? String(task.task_number) : (task?.slug ?? taskId); - if (!repoPath) return deriveBranchName(task?.title ?? "", fallbackId); + if (!repoPath) + return deriveBranchName(task?.title ?? "", fallbackId, branchPrefix); const cached = queryClient.getQueryData( provider.gitQueryKey("getAllBranches", { directoryPath: repoPath }), ) ?? []; - return suggestBranchName(task?.title ?? "", fallbackId, cached); + return suggestBranchName(task?.title ?? "", fallbackId, cached, branchPrefix); } diff --git a/products/desktop/packages/ui/src/features/settings/sections/GeneralSettings.tsx b/products/desktop/packages/ui/src/features/settings/sections/GeneralSettings.tsx index 735262c9ce6a..4875ff4ef98d 100644 --- a/products/desktop/packages/ui/src/features/settings/sections/GeneralSettings.tsx +++ b/products/desktop/packages/ui/src/features/settings/sections/GeneralSettings.tsx @@ -2,7 +2,7 @@ import { ArrowSquareOut } from "@phosphor-icons/react"; import { buildPostHogUrl } from "@posthog/core/settings/posthogUrl"; import { useServiceOptional } from "@posthog/di/react"; import { useHostTRPC } from "@posthog/host-router/react"; -import { Button, Switch } from "@posthog/quill"; +import { Button, Input, Switch } from "@posthog/quill"; import { ANALYTICS_EVENTS } from "@posthog/shared"; import { EFFORT_LEVEL_DOCS_URLS, @@ -145,6 +145,7 @@ export function GeneralSettings() { defaultReasoningEffort, diffOpenMode, sendMessagesWith, + branchPrefix, setAutoConvertLongText, setDefaultInitialTaskMode, setDefaultMessagingMode, @@ -152,6 +153,7 @@ export function GeneralSettings() { setDefaultReasoningEffort, setDiffOpenMode, setSendMessagesWith, + setBranchPrefix, } = useSettingsStore(); const handleThemeChange = useCallback( @@ -250,6 +252,19 @@ export function GeneralSettings() { [sendMessagesWith, setSendMessagesWith], ); + const handleBranchPrefixChange = useCallback( + (e: React.FocusEvent) => { + const value = e.target.value; + track(ANALYTICS_EVENTS.SETTING_CHANGED, { + setting_name: "branch_prefix", + new_value: value, + old_value: branchPrefix, + }); + setBranchPrefix(value); + }, + [branchPrefix, setBranchPrefix], + ); + const accountUrl = buildPostHogUrl("/settings/user", cloudRegion); return ( @@ -417,6 +432,26 @@ export function GeneralSettings() { + + + + { + if (e.key === "Enter") { + (e.target as HTMLInputElement).blur(); + } + }} + className="w-[160px]" + /> + + + + diff --git a/products/desktop/packages/ui/src/features/settings/settingsStore.ts b/products/desktop/packages/ui/src/features/settings/settingsStore.ts index 1abbb3694c20..83fac0b159a0 100644 --- a/products/desktop/packages/ui/src/features/settings/settingsStore.ts +++ b/products/desktop/packages/ui/src/features/settings/settingsStore.ts @@ -279,12 +279,15 @@ interface SettingsStore { // sessions, cloud covers cloud runs. rtkEnabledLocal: boolean; rtkEnabledCloud: boolean; + // Prefix prepended to auto-generated branch names (e.g. "posthog/", "feat/"). + branchPrefix: string; setAllowBypassPermissions: (enabled: boolean) => void; setPreventSleepWhileRunning: (enabled: boolean) => void; setDebugLogsCloudRuns: (enabled: boolean) => void; setAutoPublishCloudRuns: (enabled: boolean) => void; setRtkEnabledLocal: (enabled: boolean) => void; setRtkEnabledCloud: (enabled: boolean) => void; + setBranchPrefix: (prefix: string) => void; // Terminal terminalFont: TerminalFont; @@ -541,6 +544,7 @@ export const useSettingsStore = create()( autoPublishCloudRuns: true, rtkEnabledLocal: true, rtkEnabledCloud: true, + branchPrefix: "posthog/", setAllowBypassPermissions: (enabled) => set({ allowBypassPermissions: enabled }), setPreventSleepWhileRunning: (enabled) => @@ -550,6 +554,7 @@ export const useSettingsStore = create()( set({ autoPublishCloudRuns: enabled }), setRtkEnabledLocal: (enabled) => set({ rtkEnabledLocal: enabled }), setRtkEnabledCloud: (enabled) => set({ rtkEnabledCloud: enabled }), + setBranchPrefix: (prefix) => set({ branchPrefix: prefix }), // Terminal terminalFont: "berkeley-mono", @@ -699,6 +704,7 @@ export const useSettingsStore = create()( autoPublishCloudRuns: state.autoPublishCloudRuns, rtkEnabledLocal: state.rtkEnabledLocal, rtkEnabledCloud: state.rtkEnabledCloud, + branchPrefix: state.branchPrefix, // Terminal terminalFont: state.terminalFont, diff --git a/products/desktop/packages/workspace-server/src/services/agent/agent.ts b/products/desktop/packages/workspace-server/src/services/agent/agent.ts index d963fa105ad2..0aee15c6f41d 100644 --- a/products/desktop/packages/workspace-server/src/services/agent/agent.ts +++ b/products/desktop/packages/workspace-server/src/services/agent/agent.ts @@ -304,6 +304,8 @@ interface SessionConfig { spokenNarration?: boolean; /** Matched `bedrock-llm-gateway` variant at session start. */ bedrockGatewayVariant?: BedrockGatewayVariant; + /** Branch prefix for auto-generated branch names (default: "posthog/"). */ + branchPrefix?: string; } /** Pull the adapter's negotiated `agentCapabilities._meta.posthog` capabilities from initialize. */ @@ -685,6 +687,7 @@ export class AgentService extends TypedEventEmitter { additionalDirectories?: string[], systemPromptOverride?: string, channelMode?: boolean, + branchPrefix?: string, ): { append: string; } { @@ -711,6 +714,7 @@ export class AgentService extends TypedEventEmitter { { structuredInput: true, repositoryTools: true, + branchPrefix, }, ); @@ -795,6 +799,7 @@ export class AgentService extends TypedEventEmitter { fastMode, model, jsonSchema, + branchPrefix, } = config; // Preview config doesn't need a real repo — use a temp directory @@ -872,6 +877,7 @@ export class AgentService extends TypedEventEmitter { additionalDirectories, systemPromptOverride, channelMode, + branchPrefix, ); const bundledSkillsDir = join( @@ -2188,6 +2194,7 @@ For git operations while detached: "bedrockGatewayVariant" in params ? params.bedrockGatewayVariant : undefined, + branchPrefix: "branchPrefix" in params ? params.branchPrefix : undefined, }; } diff --git a/products/desktop/packages/workspace-server/src/services/agent/schemas.ts b/products/desktop/packages/workspace-server/src/services/agent/schemas.ts index 230227a592a1..afdbfc321cb9 100644 --- a/products/desktop/packages/workspace-server/src/services/agent/schemas.ts +++ b/products/desktop/packages/workspace-server/src/services/agent/schemas.ts @@ -108,6 +108,11 @@ export const startSessionInput = z.object({ * (headless runs, unresolved flags) leaves the gateway on its default. */ bedrockGatewayVariant: z.enum(BEDROCK_GATEWAY_VARIANTS).optional(), + /** + * Branch prefix for auto-generated branch names (e.g. "posthog/", "feat/"). + * Defaults to "posthog/" when absent. + */ + branchPrefix: z.string().optional(), }); export type StartSessionInput = z.infer; @@ -269,6 +274,8 @@ export const reconnectSessionInput = z.object({ spokenNarration: z.boolean().optional(), /** See startSessionInput.bedrockGatewayVariant. */ bedrockGatewayVariant: z.enum(BEDROCK_GATEWAY_VARIANTS).optional(), + /** See startSessionInput.branchPrefix. */ + branchPrefix: z.string().optional(), }); export type ReconnectSessionInput = z.infer;