Skip to content

fix(chat): name orchestration worker chat tabs after their task title - #28045

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-tab-auto-title
Oct 12, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-tab-auto-title

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24
Prod 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​95 $\color{#cf222e}{\Huge{\mathbf{−}}}$​33 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​62

ELI5

When a coordinator agent starts helper agents (orchestration workers) in chat mode, every helper's tab was called "Claude Chat". With ten helpers open you could not tell which one was the reviewer, the fixer or the QA prep. Now each helper's tab is named after the task it was started for.

What Changed

Before: a worker started with orca orchestration worker-start in chat mode kept the default tab name ("Claude Chat", "Codex Chat"). Chat naming deliberately skipped any chat with an open orchestration task, and only tries once, so the tab never got a name. On my machine, every Claude worker chat since 10-11 was unnamed (89 of 89), while every chat I started myself was named (12 of 12).

After: a worker's chat is named from its task title, for example "Review PR 1234 login fix". Without --task-title, the task's title is the start of its brief, which orchestration already derives (for example "Look at README.md and reply with one sentence…"). Chats you start yourself are still named by the agent from your first message, as before. The existing Settings → Chat → Chat names switch still turns all of this off.

Mechanism: the chat-naming step already ran for workers, then bailed out on hasOpenDispatch. That check is now workerTaskTitle: when the chat belongs to a worker with an open task, the step writes that task's title through the same compare-and-set the generated name uses (so a name the user set is never overwritten), then retitles the open tab the same way. The title is read in structured-worker-custody.ts beside the existing "does this worker still owe work" check, sharing its ownership query; that check's own query is unchanged. Older tasks with no saved title use the start of their task brief. If both are empty, the worker stays unnamed instead of generating a misleading name from its orchestration instructions.

Why

The task title is the name the coordinator already gave the work, so it describes the worker better than a summary of a long task brief would, and it costs no model call. The alternative, removing the skip and generating a name from the worker's first message, would spend a model call per worker and summarize a long orchestration preamble.

Known behaviour: a worker reused across several tasks keeps the title of its first task, since a later task never renames a chat that already has a name. Tabs that already exist are not renamed.

Visual Proof

Same flow on both builds: a real Claude worker (Haiku) started with --task-title "Review PR 1234 login fix".

Before (main at 25f8754): the worker tab is "Claude Chat".

before

After: the worker tab is "Review PR 1234 login fix"; a second worker started without --task-title takes the start of its brief.

after

After, ordinary chat unchanged: a chat started by hand is still named by the agent ("Ocean Poem Request").

after normal chat

Testing

  • Live on macOS in a background dev Orca with a fresh profile and real Claude: two workers (with and without --task-title) plus one hand-started chat, on this branch and on main. Screens were driven over CDP.

  • Unit tests: worker named from its task title with no model call, worker left unnamed when the setting is off, and the title lookup returning the open task's title and nothing once it settles.

  • After the merge with current main, five targeted test files passed (81 tests), including the older-task fallback and empty-title behavior. git diff --check passed.

  • ORCA_BACKGROUND_LAUNCH=1 orca-ci-checks passed 22 of 24 checks, including the regular pnpm run typecheck. Its Bun compiler check again reported Script not found "check" in this local Bun installation. The native code-quality audit flagged four imports in config/scripts/check-main-sync-spawn-ratchet.mjs, a file brought in unchanged from main; no PR file triggered those warnings.

  • Not tested: Windows, Linux, SSH or WSL workers. Chat naming only runs for chats on this machine, so remote workers are unaffected either way.

  • I manually tested these changes locally

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

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

No new setting, no wire or storage format change: the name lands in the existing conversationName field. The fix also removes unrelated lockfile changes. Performance: one primary-key join per newly working worker chat, once.

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)
  • 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)

Background CDP QA renderer showing the PR worktree selected and its agent-session history

Background CDP QA renderer visibly showing QA Explicit Worker Title in the structured worker row

Worker chats were skipped by chat naming and stayed "Claude Chat".
Name them from the task they were started for instead, with no model call.
@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9554f35a-3ac4-4a23-82dd-62e78e66b599

📥 Commits

Reviewing files that changed from the base of the PR and between d283bdc and 1c8def5.


📒 Files selected for processing (4)
  • src/main/native-chat/structured-chat-naming.test.ts
  • src/main/native-chat/structured-chat-naming.ts
  • src/main/runtime/structured-worker-at-rest.test.ts
  • src/main/runtime/structured-worker-custody.ts

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



📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

Structured chat naming now uses an open worker task title when one is available. Otherwise, it checks the first prompt and may generate a name. The runtime resolves worker task titles through the orchestration database. Tests cover task-title lookup, worker naming behavior, and updated dependency wiring.


Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 1c8de

Worker chat tabs are named from their task title. Tasks created before the title migration fall back to their brief, so naming no longer depends on a model call for them. No actionable merge risk remains.

Pre-merge checks · Passed 3 · Failed 2

Failed Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description explains the user impact, implementation, rationale, visual proof, testing, limitations, and checklist status. The required Linked Issue field is incomplete because Fixes # has no is… Add the actual linked issue number to the Fixes # field. If this is a maintainer change with no issue, document the applicable pre-existing issue or explain why no issue is required.
Passed Passed checks (3 passed)
Check name Status Explanation
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.
Title check Passed The title clearly and concisely describes the main change: naming orchestration worker chat tabs from their task titles.

Full details: Description check

Explanation

The description explains the user impact, implementation, rationale, visual proof, testing, limitations, and checklist status. The required Linked Issue field is incomplete because Fixes # has no issue number.


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

  • 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

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: Advanced
  • Run ID: 52897e17-07a2-4b73-b835-7627239c94d6
📥 Commits

Reviewing files that changed from the base of the PR and between c62c5a4 and d283bdc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • src/main/native-chat/structured-chat-naming-command-first.test.ts
  • src/main/native-chat/structured-chat-naming-status-hook.test.ts
  • src/main/native-chat/structured-chat-naming.test.ts
  • src/main/native-chat/structured-chat-naming.ts
  • src/main/runtime/orca-runtime-get-worktree-ps.ts
  • src/main/runtime/structured-chat-naming-runtime.test.ts
  • src/main/runtime/structured-chat-naming-runtime.ts
  • src/main/runtime/structured-worker-at-rest.test.ts
  • src/main/runtime/structured-worker-custody.ts

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

}
const row: unknown = db.db
.prepare(
`SELECT task.task_title FROM dispatch_contexts dispatch

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Derive a title for tasks created before the title migration.

The v5 migration leaves existing task_title values null. If one of those tasks is dispatched to a new worker after upgrade, this query returns null. The naming handler then generates a name from the prompt instead of using the task brief. Use a normalized title derived from task.spec when task.task_title is null. (raw.githubusercontent.com)

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Worker chats started through orchestration all appeared as generic provider tabs, because automatic chat naming skipped chats with an open task. This PR now names a worker chat from its task title. An older task without a saved title uses the start of its brief; ordinary chats keep their first-message naming, and manual names and the Chat names switch still take precedence.

The review fixed one legacy-data gap: a worker with a null or empty stored task title could otherwise be named from its dispatch preamble, leaving a misleading name permanently. The fix derives a title from the task brief and keeps an unnameable worker out of first-message generation. I also removed unrelated lockfile changes. Two independent review rounds and final readiness/performance passes found no remaining proven P0–P2 issue.

Verified: five targeted test files passed (81 tests) both locally and on the M4Air. The regular typecheck and the other 22 local repository checks passed. On the pushed commit 1c8def5239f, a background M4Air dev build launched a real structured worker, and the CDP screenshot shows its task-title prefix in the rendered row. The remote QA worktree was removed afterward.

Still open: CI is red because static analysis fails on imports in config/scripts/check-main-sync-spawn-ratchet.mjs that are identical to current origin/main; verify then fails downstream. The local Bun-only compiler check could not run with the installed Bun (Script not found "check"). Do not merge until the inherited CI failure is repaired and CI passes. A reused worker chat intentionally keeps its first task title; showing its current task is deferred. The no-title and ordinary-chat flows were covered by tests but were not rerun in the final remote UI session; Windows, Linux, SSH, WSL, and large-database latency were not measured here.

@brennanb2025
brennanb2025 merged commit 9fcbb2c into main Oct 12, 2026
23 of 25 checks passed
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