feat(web): configure worktree branch prefixes - #7887
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Two consistency issues in the new General → Worktree branch prefix row. Both are local to the added block.
Posted via Macroscope — UI Consistency
ApprovabilityVerdict: 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. |
0251fb3 to
8baa28d
Compare
What Changed
t3code, accepts a normalized custom prefix, and can be left empty for unprefixed branch names.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
t3codeis 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.
Verification
mainbefore publishing.96focused tests passed across shared Git helpers, settings contracts, and the provider command reactor.git diff --checkpassed.mainand found no open upstream PR implementing it.Checklist
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.worktreeBranchPrefixinbuildGeneratedWorktreeBranchName, 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
worktreeBranchPrefixsetting for generated worktree branchesWorktreeBranchPrefixschema in settings.ts that validates either an empty string or a normalized git branch prefix (length <= 64, alphanumeric boundaries, no//). Added to bothServerSettings(default't3code') andServerSettingsPatch.buildGeneratedWorktreeBranchNamein ProviderCommandReactor.ts now accepts a caller-suppliedprefixand usessanitizeBranchFragmentto normalize it before composing the generated branch name.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).'t3code') instead of a hardcoded prefix; existing server settings withoutworktreeBranchPrefixwill decode to't3code'by default.Macroscope summarized 8baa28d.