Repository navigation
fix(chat): name orchestration worker chat tabs after their task title - #28045
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to 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 ·
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
52897e17-07a2-4b73-b835-7627239c94d6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
src/main/native-chat/structured-chat-naming-command-first.test.tssrc/main/native-chat/structured-chat-naming-status-hook.test.tssrc/main/native-chat/structured-chat-naming.test.tssrc/main/native-chat/structured-chat-naming.tssrc/main/runtime/orca-runtime-get-worktree-ps.tssrc/main/runtime/structured-chat-naming-runtime.test.tssrc/main/runtime/structured-chat-naming-runtime.tssrc/main/runtime/structured-worker-at-rest.test.tssrc/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 |
There was a problem hiding this comment.
🎯 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)
|
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 Still open: CI is red because static analysis fails on imports in |
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-startin 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 nowworkerTaskTitle: 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 instructured-worker-custody.tsbeside 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".
After: the worker tab is "Review PR 1234 login fix"; a second worker started without
--task-titletakes the start of its brief.After, ordinary chat unchanged: a chat started by hand is still named by the agent ("Ocean Poem Request").
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 --checkpassed.ORCA_BACKGROUND_LAUNCH=1 orca-ci-checkspassed 22 of 24 checks, including the regularpnpm run typecheck. Its Bun compiler check again reportedScript not found "check"in this local Bun installation. The native code-quality audit flagged four imports inconfig/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
Notes
No new setting, no wire or storage format change: the name lands in the existing
conversationNamefield. The fix also removes unrelated lockfile changes. Performance: one primary-key join per newly working worker chat, once.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)