Skip to content

fix(naming): keep the built-in branch-name prompt general - #9088

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/generic-branch-name-prompt
Jul 17, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/generic-branch-name-prompt

Conversation

@brennanb2025

Copy link
Copy Markdown
Contributor

Summary

  • Soften the shipped auto-rename branch-name prompt so it only asks for a short name summarizing the task and a single-line reply — no hard-coded word count, kebab-case, or “no prefixes” style rules.
  • When users supply Source Control AI branch-name instructions, lead with that override so it owns naming style instead of sitting under a prescriptive default.
  • Leave post-generation sanitizeBranchSlug / prefix stripping in place for git-safe leaves.

Why

Users can already customize naming via instructions and the branch-name command template. A rigid built-in rule list fights those overrides. The default should stay general; mechanical sanitization still keeps branches usable.

Test plan

  • vitest for branch-name-from-work and branch-name custom prompt coverage
  • Manually: create a new workspace with auto-rename on, start an agent, confirm rename still produces a short branch leaf
  • Manually: set a custom branch-name instruction (e.g. prefer product nouns) and confirm the generated prompt leads with that text

The shipped auto-rename prompt no longer hard-codes style rules (word
count, kebab-case, no prefixes). Users can already override naming via
Source Control AI instructions and the branch-name command template; a
prescriptive default fought those overrides. Git-safe sanitization still
runs after generation.
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Updated branch-name prompt construction so custom prompts take precedence and default prompts use shorter general instructions. Added assertions for prompt ordering, template migration, and removal of legacy rule sections. Revised prefix-stripping documentation and tests, updated source-control AI branch-name template ordering across normalization and legacy migration paths, changed a persistence expectation, and advanced selected manifest versions to 1.4.144-rc.2.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary, rationale, and testing, but omits required Screenshots, AI Review Report, Security Audit, and Notes sections. Add the missing template sections, including Screenshots/No visual change, AI Review Report, Security Audit, and Notes, and expand the testing checklist.
Docstring Coverage ⚠️ Warning Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: simplifying the built-in branch-name prompt and preserving prefix handling.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d6334c24-16b3-468b-9e32-b99de056a192

📥 Commits

Reviewing files that changed from the base of the PR and between 3874e62 and 13f107e.

📒 Files selected for processing (7)
  • resources/skills/current-manifest.json
  • src/main/persistence.test.ts
  • src/main/text-generation/commit-message-text-generation.test.ts
  • src/shared/branch-name-from-work.test.ts
  • src/shared/branch-name-from-work.ts
  • src/shared/source-control-ai.test.ts
  • src/shared/source-control-ai.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/main/text-generation/commit-message-text-generation.test.ts
  • src/shared/branch-name-from-work.test.ts
  • src/shared/branch-name-from-work.ts

Comment thread src/shared/source-control-ai.ts Resolved
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Live Electron validation

Validated the regular auto-rename flow in an isolated dev profile against this PR:

  1. Added a disposable Git repository and created a workspace with no explicit name; Orca generated the creature branch siren.
  2. Started a real Claude agent with: “Update README.md with one sentence explaining that this repository validates automatic branch naming.”
  3. The first-work hook renamed the same worktree to docs-readme-branch-naming; the sidebar updated to “Docs readme branch naming,” and the agent continued normally.
  4. Independently verified with git branch --show-current and git worktree list --porcelain that /Users/brennanbenson/orca/workspaces/repo/siren now points at refs/heads/docs-readme-branch-naming.

Before — generated creature branch siren, real agent at its trust/start screen:

Before: creature-named siren workspace

After — sidebar and terminal show the renamed branch while the agent completes the task:

After: docs-readme-branch-naming workspace

@brennanb2025
brennanb2025 merged commit ce910e5 into main Jul 17, 2026
14 checks passed
brennanb2025 added a commit that referenced this pull request Jul 22, 2026
* fix(naming): remove identifier-first name post-processing

Workspace display names and tab titles were being rewritten after
generation by prompt-scanning heuristics from #8238 — a stray "#1" in
prose became a workspace named "#1 - Fix", and the rewrite ran
downstream of generation so user naming instructions couldn't override
it. Per the same principle as #9088, naming defaults stay minimal and
user overrides own the style.

- Delete work-item-reference.ts and display-name-from-work.ts (+tests).
- Auto-rename display names return to the humanized branch slug; tab
  titles return to the cleaned first prompt clause.
- Explicit create-from-work-item naming returns to action-first
  ("Review PR 1234").
- Keep #8238's URL-before-markdown strip-order bugfix in tab titles,
  with regression tests adjusted to the natural expectations.

* test(naming): pin incidental marker regression
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
)

* fix(naming): keep the built-in branch-name prompt general

The shipped auto-rename prompt no longer hard-codes style rules (word
count, kebab-case, no prefixes). Users can already override naming via
Source Control AI instructions and the branch-name command template; a
prescriptive default fought those overrides. Git-safe sanitization still
runs after generation.

* fix(naming): preserve branch prompt overrides

* chore(skills): refresh rc.2 manifest version
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
)

* fix(naming): remove identifier-first name post-processing

Workspace display names and tab titles were being rewritten after
generation by prompt-scanning heuristics from stablyai#8238 — a stray "stablyai#1" in
prose became a workspace named "stablyai#1 - Fix", and the rewrite ran
downstream of generation so user naming instructions couldn't override
it. Per the same principle as stablyai#9088, naming defaults stay minimal and
user overrides own the style.

- Delete work-item-reference.ts and display-name-from-work.ts (+tests).
- Auto-rename display names return to the humanized branch slug; tab
  titles return to the cleaned first prompt clause.
- Explicit create-from-work-item naming returns to action-first
  ("Review PR 1234").
- Keep stablyai#8238's URL-before-markdown strip-order bugfix in tab titles,
  with regression tests adjusted to the natural expectations.

* test(naming): pin incidental marker regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant