@devries-cameron20 / t3code-1 / commits / 343c0a9472
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Generate temporary worktree branch names from UUID tokens

- Remove message/time hashing for temporary branch names in `ChatView` - Use an 8-char UUID token while preserving backend-detected suffix format

Julius Marminge committed Feb 28, 2026 at 22:39 UTC 343c0a94729b7d8040dd4a0fe54a8c6fdee6eeef
1 file changed +5 -13
apps/web/src/components/ChatView.tsx
+5 -13
@@ -233,18 +233,10 @@ function readFileAsDataUrl(file: File): Promise<string> {
233 });
234 }
235
236 -function hashBranchSeed(value: string): string {
237 - let hash = 2166136261;
238 - for (let index = 0; index < value.length; index++) {
239 - hash ^= value.charCodeAt(index);
240 - hash = Math.imul(hash, 16777619);
241 - }
242 - return (hash >>> 0).toString(16).padStart(8, "0");
243 -}
244 -
245 -function buildTemporaryWorktreeBranchName(message: string): string {
246 - const seed = `${Date.now()}:${message.trim().toLowerCase()}:${crypto.randomUUID()}`;
247 - return `${WORKTREE_BRANCH_PREFIX}/${hashBranchSeed(seed)}`;
236 +function buildTemporaryWorktreeBranchName(): string {
237 + // Keep the 8-hex suffix shape for backend temporary-branch detection.
238 + const token = crypto.randomUUID().slice(0, 8).toLowerCase();
239 + return `${WORKTREE_BRANCH_PREFIX}/${token}`;
240 }
241
242 const VscodeEntryIcon = memo(function VscodeEntryIcon(props: {
@@ -1544,7 +1536,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
1536 // On first message: lock in branch + create worktree if needed.
1537 if (baseBranchForWorktree) {
1538 setSendPhase("preparing-worktree");
1547 - const newBranch = buildTemporaryWorktreeBranchName(trimmed);
1539 + const newBranch = buildTemporaryWorktreeBranchName();
1540 const result = await createWorktreeMutation.mutateAsync({
1541 cwd: activeProject.cwd,
1542 branch: baseBranchForWorktree,