[Bug]: Branch name generation double-prefixes fix/ into feature/fix/
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/contracts or packages/shared
Steps to reproduce
- Make a change that reads as a bug fix, or use a repo that follows Conventional Commits.
- Create a PR from the default branch via "Commit, push & create PR" or "Create PR" with a feature branch.
- Look at the branch name it created.
The branch naming prompt asks the model for "a short semantic git branch fragment". For a fix the model returns something like fix/calendar-recruitment-filter.
Expected behavior
The branch keeps its prefix and lands as fix/calendar-recruitment-filter, or feat/…, chore/…, and so on.
Actual behavior
It comes out as feature/fix/calendar-recruitment-filter. The feature/ prefix gets glued onto an already-prefixed fix/ fragment.
Cause
sanitizeFeatureBranchName in packages/shared/src/git.ts only treats a feature/ prefix as "already complete":
if (sanitized.includes("/")) {
return sanitized.startsWith("feature/") ? sanitized : `feature/${sanitized}`;
}
Any other slash-separated fragment (fix/…, feat/…, chore/…) gets feature/ prepended. There is a test that currently codifies this as intended: CodexTextGeneration.test.ts expects feature/fix/important-system-change.
Impact
Minor bug or occasional failure
Version or commit
main
Environment
OpenCode provider, macOS
Workaround
Rename the branch after it is created, or create the branch and push it manually.
A small PR that fixes this is open at https://github.com/pingdotgg/t3code/pull/7074
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sanitizeFeatureBranchName in packages/shared/src/git.ts and the existing expectation in CodexTextGeneration.test.ts. Run that test to confirm the current behavior, then verify that conventional prefixes such as fix/, feat/, and chore/ remain intact without an extra feature/ prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100