Skip to content

feat: auto-rename workspace branch from the first prompt - #2888

Merged
brennanb2025 merged 2 commits into
stablyai:mainfrom
tmchow:tmchow/Nautilus-7
May 27, 2026
Merged

brennanb2025 merged 2 commits into
stablyai:mainfrom
tmchow:tmchow/Nautilus-7

Conversation

@tmchow

@tmchow tmchow commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A new opt-in Git setting, Auto-Rename Branch From Work, frees a workspace from the random "creature" name it's born with. The moment an agent starts working on your first prompt, Orca renames both the git branch and the sidebar title to a short summary of the task — turning you/Nautilus into you/supported-models-list ("Supported models list") with no manual rename step. The auto-generated name is still great for spinning a workspace up instantly; this removes the friction of living with it once the work has a clear subject.

Off by default; enable it under Settings → Git.

Demo

Setting

In Action

How it works

The rename hangs off Orca's unified agent-hook status listener, so it fires the first time any supported agent reports it has begun working — and the prompt text is available at that moment. Doing this in the main process (where git and the worktree store already live) lets one code path cover every agent and every entry flow instead of per-agent wiring.

The short name is generated by the same agent you've already configured for AI commit messages — no new model setup. The output is sanitized to a 2–4 word kebab slug for the branch (you/<slug>) and a humanized label for the sidebar.

Guardrails

Situation Behavior
Branch is the auto-generated creature name Renamed
Branch name you chose yourself Left alone
Branch already pushed / has an upstream Left alone — never rewrites published history
Sidebar title you customized Preserved — only the branch is renamed
Generated name collides with an existing branch Suffixed (-2, -3, …)

The trigger settles once per worktree and retries only on transient failures (agent momentarily unreachable, brief detached HEAD). So it doesn't re-probe git every turn for an already-handled workspace, and a one-off hiccup never permanently skips a workspace.

Worktree identity is resolved from the session's tab→worktree map rather than the agent-echoed hook field — the latter isn't present on every event, which was the source of early run-to-run flakiness.

Tests

Unit coverage for slug sanitization and display-name humanization, creature-name eligibility, the git rename op (upstream guardrail, collision suffixing), and the orchestrator's gating: setting off, replayed/non-working events, custom-display preservation, tab-based worktree resolution, settle-after-success, and retry-after-transient-failure.


Compound Engineering
Claude Code

tmchow and others added 2 commits May 27, 2026 13:38
Opt-in Git setting (off by default). When an agent begins working in a
freshly created workspace, Orca renames the auto-generated creature
branch (e.g. you/Nautilus) and the sidebar name to a short summary of
the first prompt, generated by the agent already configured for AI
commit messages.

Guardrails: only auto-generated branches are renamed (never a name the
user chose), never a branch that already has an upstream, and a custom
display name is preserved. The rename is driven off the unified
agent-hook listener so it works across every supported agent, settles
once per worktree, and retries only on transient failures.
@brennanb2025
brennanb2025 merged commit a65f7b4 into stablyai:main May 27, 2026
@brennanb2025

Copy link
Copy Markdown
Contributor

Thanks for the PR @tmchow! Very cool feature 👍 I'm also going to split out the different AI prompts soon (for commit message, PR, and branch name generation), just fyi.

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.

2 participants