Skip to content

feat(web): configure worktree branch prefixes - #7887

Open
yasinkavakli wants to merge 3 commits into
pingdotgg:mainfrom
yasinkavakli:t3code/configurable-branch-prefix
Open

feat(web): configure worktree branch prefixes#7887
yasinkavakli wants to merge 3 commits into
pingdotgg:mainfrom
yasinkavakli:t3code/configurable-branch-prefix

Conversation

@yasinkavakli

@yasinkavakli yasinkavakli commented Aug 22, 2026

Copy link
Copy Markdown

What Changed

  • Added a server setting for the prefix used when T3 Code promotes temporary worktree branches to generated names.
  • Added a Worktree branch prefix field under Settings → General. It defaults to t3code, accepts a normalized custom prefix, and can be left empty for unprefixed branch names.
  • Added settings search, restore-default behavior, user documentation, and focused contract/server tests.
  • Kept temporary branch naming and the wire protocol unchanged. The configured prefix is applied at the shared server rename boundary, so web, desktop, mobile, local, and remote clients receive the same behavior.

Why

Generated worktree branches were always placed under the hard-coded t3code/ namespace. Fork maintainers and teams commonly need a personal or team namespace, while some workflows require no prefix at all.

This makes that namespace configurable without adding client-specific flows or changing worktree creation semantics. Existing installations remain backward compatible because t3code is still the default.

UI Changes

Before: Settings had no branch-prefix control, and generated worktree branches always used t3code/.

After: Settings → General includes a Worktree branch prefix field with inline guidance.

Worktree branch prefix setting in Settings General

Verification

  • Rebased onto the latest main before publishing.
  • 96 focused tests passed across shared Git helpers, settings contracts, and the provider command reactor.
  • Shared, contracts, server, and web typechecks passed.
  • Changed-file lint, formatting, and git diff --check passed.
  • Three independent review passes covered correctness, multi-surface/remote behavior, and unnecessary complexity; follow-up delta reviews found no actionable issues.
  • Confirmed the functionality is not already present on upstream main and found no open upstream PR implementing it.

Checklist

  • This PR is small and focused on one change
  • The problem and implementation are explained above
  • UI evidence is included above; the before state had no corresponding control
  • Video is not applicable because this change adds no animation or timing-dependent interaction

Built with Codex through the Codex harness in T3 Code.

Generated with Codex


Note

Medium Risk
Touches git branch rename behavior and persisted server settings. Temporary worktree detection stays hardcoded, so risk is mainly misconfigured prefixes producing unexpected branch names, not auth or data loss.

Overview
Adds a Worktree branch prefix server setting (default t3code, empty allowed) so auto-renamed worktree branches can use a team namespace or no prefix.

The first-turn rename path now applies settings.worktreeBranchPrefix in buildGeneratedWorktreeBranchName, stripping a matching configured or default prefix from the model output and sanitizing the remainder. Temporary worktree detection is unchanged.

Settings → General gets a searchable input with reset-to-default and client-side sanitization. Invalid prefixes are rejected by the settings schema. Docs and reactor tests cover default, custom, nested, and empty prefixes.

Reviewed by Cursor Bugbot for commit 8baa28d. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add configurable worktreeBranchPrefix setting for generated worktree branches

  • Introduces WorktreeBranchPrefix schema in settings.ts that validates either an empty string or a normalized git branch prefix (length <= 64, alphanumeric boundaries, no //). Added to both ServerSettings (default 't3code') and ServerSettingsPatch.
  • buildGeneratedWorktreeBranchName in ProviderCommandReactor.ts now accepts a caller-supplied prefix and uses sanitizeBranchFragment to normalize it before composing the generated branch name.
  • Adds a DraftInput-based settings row in SettingsPanels.tsx for editing the prefix, with dirty-state tracking, reset-to-default, and normalization on commit (empty if no alphanumeric characters).
  • Registers the new setting in settingsSearch.ts and documents it in source-control.md.
  • Behavioral Change: generated worktree branch names now prefix with the configured value (default 't3code') instead of a hardcoded prefix; existing server settings without worktreeBranchPrefix will decode to 't3code' by default.

Macroscope summarized 8baa28d.

@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ffabb3a0-4f65-47ae-96c1-718b2ef4ef64

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 22, 2026
Comment thread apps/server/src/orchestration/Layers/ProviderCommandReactor.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two consistency issues in the new General → Worktree branch prefix row. Both are local to the added block.

Posted via Macroscope — UI Consistency

Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
Comment thread apps/web/src/components/settings/SettingsPanels.tsx Outdated
@macroscopeapp

macroscopeapp Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Skipped

Macroscope did not run approvability analysis for this PR. Macroscope could not determine whether this PR modifies its approvability configuration, so the PR was not approved automatically. A PR that may change the rules that govern approval is never approved automatically.

yasinkavakli added a commit to yasinkavakli/t3code that referenced this pull request Aug 22, 2026
@yasinkavakli
yasinkavakli force-pushed the t3code/configurable-branch-prefix branch from 0251fb3 to 8baa28d Compare August 22, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant