Skip to content

Move branch-name AI config into Git AI Author Advanced; surface rename failures#4725

Open
brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/branch-rename-settings
Open

Move branch-name AI config into Git AI Author Advanced; surface rename failures#4725
brennanb2025 wants to merge 6 commits into
mainfrom
brennanb2025/branch-rename-settings

Conversation

@brennanb2025
Copy link
Copy Markdown
Contributor

@brennanb2025 brennanb2025 commented Jun 5, 2026

Summary

Two related improvements to the auto branch-rename feature and its settings, motivated by a workspace getting stuck on a perpetual "rename pending" badge after the branch-name generation agent (codex) failed silently.

1. Auto-name settings consolidated under Git AI Author

The per-branch-name model picker and prompt editor were buried in the Advanced collapsible of the "Auto-Name From First Message" row in Git settings — hard to discover, and disconnected from the equivalent commit/PR controls. The on/off toggle also sat in the Git settings list, separate from Git AI Author even though auto-name functionally requires it (the rename hook runs through the same agent and bails with "Enable Git AI Author…" when it's off).

  • Added a "Branch Names" group to the Git AI Author customization section, alongside Commit Messages and Pull Requests, reusing the same per-operation model + thinking-effort + prompt controls.
  • Renamed that section from "Commit and PR customization" → "Advanced".
  • Moved the auto-name on/off toggle into the Git AI Author pane as a top-level row (gated on Git AI Author being enabled), directly above Advanced — so the toggle, its dependency, and its tuning now live together. The toggle copy points to Advanced → Branch Names for tuning. Deleted the now-orphaned AutoRenameBranchFromWorkSetting component and moved its settings-search identity into the Git AI Author pane's search set (so an auto-name search surfaces the Enable row when the feature is off). Removed the now-dead branch-prompt dirty-state plumbing from GitPane / Settings (it folds into the commit pane's existing unsaved-changes signal).

2. "rename failed" badge

Today, when auto-rename fails, nothing surfaces — the worktree just shows "rename pending" forever.

  • New firstAgentMessageRenameError field on worktree meta, set by the auto-rename hook only on real generation failures (no agent configured / env prep failed / generation failed). Benign skips (branch already pushed, not a creature name, etc.) are unaffected.
  • Cleared on a successful rename, a manual rename, or when a worktree that earlier hit a transient failure later settles benignly (user pushed the branch, renamed it, or it became ineligible) — so a stale badge can't stick forever. A user-canceled generation does not raise the badge.
  • WorktreeCard shows a red AlertCircle "rename failed" badge with the error message in its tooltip when the field is set, otherwise the existing "rename pending" badge.

Testing

  • pnpm typecheck:web
  • pnpm typecheck:node
  • Relevant unit suites (first-work-branch-rename, CommitMessageAiPane, GitPane, worktrees store): all green
  • Badge coverage: error set on generation failure / missing agent; cleared on success; NOT set on benign skips; cleared when a retryable worktree later reaches a benign stop; not raised on user-canceled generation; retry-then-success clears the prior error.
  • Settings coverage: auto-name toggle hidden when Git AI Author is off and rendered when on; an auto-name search surfaces the Enable row while off; the toggle no longer renders in GitPane.

Review & validation

  • Code-review loop: three rounds of two parallel independent reviewers. Round 1 surfaced one stale-badge bug (transient failure raises the badge, but a later benign settle — e.g. user pushes the branch — never clears it) plus a misleading badge on user-cancel; both fixed. Rounds 2–3 confirmed the fixes and flagged one more reachable-after-error terminal stop (no distinct unique branch name) that didn't clear — also fixed. Both reviewers returned clean in the final round. Also added an idempotent guard to the main-process setRenameError so benign skips that clear a never-set error don't churn the renderer.
  • Electron validation: built and ran the app, in two passes (badge + settings relocation, and the toggle move). Confirmed the auto-name toggle is gone from Settings → Git; under Settings → Git AI Author it is hidden while the feature is off and appears as a top-level row directly above Advanced when on, toggles and persists; Advanced shows the Branch Names group (model control + prompt editor) alongside Commit Messages and Pull Requests; settings search for "branch name model" / "branch name prompt" opens Advanced → Branch Names and "auto-name" surfaces the toggle / Enable row. The "rename failed" badge renders red with the error in its tooltip and takes priority over "rename pending" (validated by injecting the meta field). 0 renderer console errors. pnpm typecheck and pnpm lint clean.

Notes

  • Cross-platform: no platform-specific behavior added; the new meta field flows through the existing provider-agnostic (local + SSH) rename path.
  • Existing stuck worktrees won't retroactively show "rename failed" (their meta predates the field); this fixes the experience going forward.
  • The badge could not be triggered via a real generation failure during validation (hard to force on demand); it was validated by store injection plus the main-process unit tests covering every set/clear path.

Made with Orca 🐋

brennanb2025 and others added 3 commits June 5, 2026 15:37
…e failures

Relocate the branch-name model picker and prompt editor out of the
Auto-Name From First Message row's Advanced collapsible and into the
Git AI Author customization section as a "Branch Names" group, alongside
Commit Messages and Pull Requests. Rename that section to "Advanced".
The Auto-Name row in Git settings is now just the on/off toggle.

Add a "rename failed" worktree badge: when the auto-rename generation
step fails (no agent configured, env prep failed, or generation failed),
persist the error on worktree meta and show a red AlertCircle badge with
the error in its tooltip, instead of a perpetual "rename pending".

Co-authored-by: Orca <help@stably.ai>
A transient branch-name generation failure raises the rename-failed
badge, but the worktree isn't settled, so a later event re-probes. If
that event reached a benign terminal state (user pushed the branch,
renamed it, or it became ineligible) the badge stuck forever. Clear it
on those benign stops, skip raising it on user-canceled generation, and
make the main-process setRenameError clear idempotent so benign skips
don't churn the renderer.

Co-authored-by: Orca <help@stably.ai>
@brennanb2025 brennanb2025 marked this pull request as ready for review June 6, 2026 00:52
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Reviewed changes — moves branch-name model/prompt controls into the Git AI Author → Advanced section alongside commit and PR controls, and adds a "rename failed" badge when auto-branch-name generation fails.

  • Relocate branch-name AI config — the branch-name model picker and prompt editor move from a hidden collapsible inside Auto-Name From First Message into a new Branch Names group in CommitMessageAiPane's Advanced section, reusing the same per-operation model + thinking-effort + prompt controls. AutoRenameBranchFromWorkSetting is now just an on/off toggle with a pointer to where the tuning lives.
  • Remove dead branch-prompt plumbingGitPane and Settings drop the hasUnsavedBranchPromptChanges state, onBranchPromptDirtyChange, branchPromptDiscardSignal, and writeSourceControlAiSettings props. Branch-prompt dirty state folds into the commit pane's existing unsaved-changes signal.
  • Surface rename failures in WorktreeCard — a new firstAgentMessageRenameError field on Worktree / WorktreeMeta is set on real generation failures (no agent configured, env prep failed, generation failed — but not user-canceled) and cleared on success, manual rename, or when a worktree that earlier hit a transient failure later settles benignly. WorktreeCard renders a red AlertCircle "rename failed" badge with the error in its tooltip, taking priority over "rename pending."
  • Update settings search — branch-name model/prompt search entries move from auto-rename-branch-search into commit-message-ai-search, and the "Commit and PR customization" search entry is renamed to "Advanced" with expanded keywords.

✅ No new issues found.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

The auto-name on/off toggle lived in the Git settings list, separated
from Git AI Author even though it functionally depends on it — the
rename hook runs through the same agent and bails with "Enable Git AI
Author..." when that feature is off. Co-locate the toggle as a
top-level row in the Git AI Author pane (gated on it being enabled),
above the Advanced group where its model/prompt tuning already lives.

Deletes the now-orphaned AutoRenameBranchFromWorkSetting component and
moves its search identity entry from the Git pane's search set into the
Git AI Author pane's, so an auto-name search surfaces the Enable row
when the feature is off.

Co-authored-by: Orca <help@stably.ai>
Copy link
Copy Markdown
Contributor

@pullfrog pullfrog Bot left a comment

Choose a reason for hiding this comment

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

Reviewed changes — moves the auto-name toggle from AutoRenameBranchFromWorkSetting into an inline SearchableSetting in CommitMessageAiPane, deletes the now-orphaned component, and removes the branch-prompt dirty-state plumbing from GitPane and Settings.

  • Delete AutoRenameBranchFromWorkSetting — the entire component (~419 SLOC) is removed. Its model/prompt controls were already rehomed under Advanced → Branch Names in prior commits; its toggle is now inlined in CommitMessageAiPane.
  • Add inline auto-name toggle to CommitMessageAiPane — rendered as a top-level row directly above Advanced when Git AI Author is enabled. The copy points to Advanced → Branch Names for tuning. Hidden when Git AI Author is off; searching for "auto-name" surfaces the Enable row instead.
  • Remove branch-prompt plumbing from GitPane and SettingshasUnsavedBranchPromptChanges, onBranchPromptDirtyChange, branchPromptDiscardSignal, writeSourceControlAiSettings, and shouldShowAutoRenameBranchSetting are all removed. CommitMessageAiPane now owns all prompt dirty-state tracking.
  • Consolidate search entriesAUTO_RENAME_BRANCH_PARENT_SEARCH_ENTRY is imported by commit-message-ai-search.ts. AUTO_RENAME_BRANCH_ADVANCED_SEARCH_ENTRIES and AUTO_RENAME_BRANCH_SEARCH_ENTRIES removed from auto-rename-branch-search.ts. Renamed "Commit and PR customization" → "Advanced" in both search entries and UI labels.

✅ No new issues found.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

brennanb2025 and others added 2 commits June 5, 2026 18:44
The Branch Names prompt editor used space-y-2 without py-2, so it hugged
the group's divide-y divider unlike the model row above it and the
commit/PR prompt editors. Add py-2 to match.

Co-authored-by: Orca <help@stably.ai>
The commit and PR prompt editors in the Git AI Author Advanced groups
label theirs just "Prompt"; the branch-name editor said "Branch name
prompt". Use "Prompt" too since the group heading already says Branch
Names.

Co-authored-by: Orca <help@stably.ai>
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