Skip to content

fix(bots): make bot group room and thread tabs renamable - #50436

Merged
nwparker merged 2 commits into
mainfrom
bugbash/issue-50312
Nov 27, 2026
Merged

nwparker merged 2 commits into
mainfrom
bugbash/issue-50312

Conversation

@nwparker

@nwparker nwparker commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

You could double-click a bot group thread tab (or the group's room tab) to rename it, but pressing Enter threw the new name away. Now the new name sticks.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​59 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​56
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​128 $\color{#cf222e}{\Huge{\mathbf{−}}}$​11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​117

What Changed

  • Before: On a bot group room or thread tab, double-click or right-click > Change Title opened the rename box. Committing it did nothing: the tab went back to the first post's text, or to the group name. Nothing else (RPC, CLI, mobile) could rename a thread either.
  • After: Renaming the original room tab renames the group. Renaming a thread tab sets that thread's title. The tab and the members' chat names (orca bot chats) follow the new name.
  • Mechanism:
    • TabBarItemRow passes an onSetCustomTitle for room tabs. It calls renameBotGroupRoom, which sends the rename to the group's host: bots.groups.update (name) for the original room, and a new bots.groups.renameThread RPC for a thread. An empty name, or one equal to the name already shown, sends nothing, so blurring an untitled thread doesn't name it "New thread".
    • bots.groups.renameThread (owner-only, workspace permission, mobile allowlisted) runs on the group's serialized queue. It writes the title and leaves the group revision alone, because a title is no roster change and a post composed before the rename should still send. The first-post auto-title already skips threads that have a title, so the hand-given name wins.
    • BotGroupThreadName collapses whitespace to one line, trims it, and caps it at the same 80 characters as a first post's name (BOT_GROUP_THREAD_TITLE_MAX_LENGTH). It bounds the input before collapsing it and refuses an empty result.
    • BotGroupChat now sets the tab label from botGroupRoomLabel for both rooms, so a group rename also shows up on the original room tab.
    • A host too old to know bots.groups.renameThread (method_not_found) shows a toast asking you to update Orca on that host.

Why

A room tab's name belongs to the group or thread on the group's host. It is not a per-tab custom label, so other windows, the mobile app and the members' chat names all need to see the same rename. The tab store's findRenamableUnifiedTab only renames terminal and agent-session tabs. Giving room tabs a local custom label would have kept the name only on this tab, and it would have drifted from what the host and mobile show.

Linked Issue

Fixes #50312

Visual Proof

N/A. No before/after capture was taken for this run, and GUI runs aren't allowed on the machine that landed it. The behavior is covered by the unit tests below and is simple to check by hand with the repro steps.

Testing

  • Repro (from the issue): create a bot group, start a thread from the room tab's + menu, post "Draft the release notes for the next version", double-click the thread tab, type "Release notes", and press Enter. Before this change the tab went back to the post text. With it, the tab and orca bot chats show "Release notes".

  • src/main/bots/bot-group-member-chat-names.test.ts: a renamed thread is collapsed to one line and capped at 80 characters, a blank name is refused, the revision doesn't change, and the members' chat names follow the rename.

  • src/renderer/src/lib/bot-group-room-rename.test.ts: a thread rename goes to bots.groups.renameThread and an original-room rename goes to bots.groups.update (capped at the bot name limit). An empty or unchanged name sends no RPC.

  • Targeted vitest passes (2 files, 6 tests). oxlint, oxfmt, anti-slop, the native code-quality plugins, ast-grep and the changed-code quality gate all report 0 findings. Only the unit tests were run, on macOS.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None. The rename only runs when the user commits a tab rename: one RPC and one store write on the group's existing serialized queue. There is no polling, no new sync I/O and no subprocess. The other changes were measured:

  • Parsing a rename: 0.59 us typical. A 9 MB whitespace-heavy title takes 2.25 us, because the input is bounded before the regex.
  • The BotGroupChat label lookup is the same single threads.find as before: 1.3 us with 500 threads.
  • The tab-label effect only fires when the name string changes, and setTabLabel does nothing when the value is the same.
  • The room tab's new inline onSetCustomTitle closure works like the existing inline props on that row.

Risk

Level: Low

  • Older hosts (SSH or paired desktops) don't have bots.groups.renameThread. Renaming a thread on one shows an "Update Orca on " toast instead of failing silently. Renaming the original room uses the existing bots.groups.update, so it works on older hosts.
  • Saved data keeps the same shape: threads[].title was already optional with a max length of 80.
  • To back it out, revert this PR. Titles already renamed stay saved, and they read the same way first-post titles do.

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Reported by @zengwenliang416

Committing a rename on a bot group's room or thread tab was dropped,
because the tab store only renames terminal and agent-session tabs.
The room tab now forwards the new name to the group's host: the
original room renames the group (bots.groups.update), and a thread
gets its own title through a new bots.groups.renameThread RPC. The
title is collapsed to one line and capped like a first post's name,
and does not bump the group revision, so posts composed before the
rename still send. The room tab then shows the host's name for both
rooms. A host too old to rename threads gets an "update Orca" toast.

Fixes #50312
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds owner-provided thread titles, validates and normalizes them to 80 characters, and exposes a runtime RPC for updating them. Thread renames preserve the group revision and update member chat names. Renderer room tabs route rename requests to thread or group updates, display errors, and show labels derived from the group room data.

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 766f7 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(bots): make bot group room and thread tabs renamable" matches the main change. The PR makes bot group room and thread tabs renamable, and the rename persists to the group host, so the t…
Description check Passed The description follows the template. It has an ELI5 section, a What Changed section with before and after and mechanism, a Why section explaining the alternative of local tab labels, a linked issue (…
Linked Issues check Passed [#50312] Requirements and evidence:
(1) Committed thread renames must persist. bots.groups.renameThread (owner-only, mobile-allowlisted) calls renameBotGroupThread. That function runs on the per-g…
Out of Scope Changes check Passed Each changed area maps to the thread and room rename objective of #50312:
- Main process: renameBotGroupThread, the runtime renameThread method, RPC registration in bot-groups.ts, the mobile all…
Full details: Title check

Explanation

The title "fix(bots): make bot group room and thread tabs renamable" matches the main change. The PR makes bot group room and thread tabs renamable, and the rename persists to the group host, so the title is clearly related to the changeset. It is specific and concise, and it follows a conventional commit style.

Full details: Description check

Explanation

The description follows the template. It has an ELI5 section, a What Changed section with before and after and mechanism, a Why section explaining the alternative of local tab labels, a linked issue (Fixes #50312), a Visual Proof section that marks N/A with a reason, a Testing section with repro steps and test results, a Performance section with a reason, a Risk section with level and backout plan, and an AI Disclosure heading left unfilled. Some template checkboxes are unchecked, including manual testing and the lint/typecheck/test/build item. The Visual Proof N/A reason is weak because the UI behavior change could have been captured manually.

Full details: Linked Issues check

Explanation

[#50312] Requirements and evidence:
(1) Committed thread renames must persist. bots.groups.renameThread (owner-only, mobile-allowlisted) calls renameBotGroupThread. That function runs on the per-group serialized queue, writes thread.title, stores the group, and signals groups.changed.
(2) The new name must reach the tab label and orca bot chats. BotGroupChat sets the tab label from botGroupRoomLabel. Member chat names derive from thread.title. Unit tests in bot-group-member-chat-names.test.ts cover this.
(3) A later first post must not overwrite a hand-set title. titleThread already skips threads that have a title. The PR keeps that behavior.
(4) Titles must be trimmed, collapsed to one line, capped at 80 characters, and refused when empty. BotGroupThreadName implements these rules using BOT_GROUP_THREAD_TITLE_MAX_LENGTH.
(5) Original room renames must use bots.groups.update { name }. renameBotGroupRoom routes room renames to that method. TabBarItemRow passes onSetCustomTitle for room tabs. bot-group-room-rename.test.ts covers RPC routing and the no-op cases for empty or unchanged names.
Deviation: the issue suggests bumping the group revision on a thread rename. The PR leaves the revision unchanged and states a reason: a title is not a roster change, and posts composed before the rename should still send. The issue's stated goal (the name persists and appears in the tab and orca bot chats) is met. This deviation does not fail a requirement.
The generated RPC params catalog at head imports BotGroupRenameThread. The truncated read did not confirm its method entry. No manual UI check was run.

Full details: Out of Scope Changes check

Explanation

Each changed area maps to the thread and room rename objective of #50312:

  • Main process: renameBotGroupThread, the runtime renameThread method, RPC registration in bot-groups.ts, the mobile allowlist entry, and the thread title schema.
  • Shared schemas: BotGroupRenameThread, BotGroupThreadName, and BOT_GROUP_THREAD_TITLE_MAX_LENGTH.
  • Renderer: renameBotGroupRoom, the TabBarItemRow rename hook, the BotGroupChat label source, and the host-update toast through botGroupRenameErrorMessage.
  • Supporting: titleThread uses the shared max-length constant, the locale strings for the toast and the "Not started" label, the comment update in bot-group-room-label.ts, and the generated RPC params catalog import.
    Tests cover the new behavior. No unrelated change was found.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8cd033ab-ae5e-47e7-b7d7-6663da8d0d31
Commits

Reviewing files that changed from the base of the PR and between 00bb8e1 and 766f74a.

Files selected for processing: 1

  • src/shared/bots/bot-group-schema.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker
nwparker merged commit fafc4f1 into main Nov 27, 2026
99 of 101 checks passed
@nwparker
nwparker deleted the bugbash/issue-50312 branch November 27, 2026 06:19
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.

[Bug]: Bot group thread tabs can't be renamed: Change Title and double-click do nothing

1 participant