You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(bots): label an item's old Home Chat by its own title - #51881
Each bot has a "Home Chat" where it normally talks. When you start a fresh chat with the bot (orca bot new-chat), the old chat stops being home, but items made there still said "Home Chat" with the house icon. Now those items show the old chat's real name (or just "Chat" if it has none), so the label matches the chat you actually open.
What Changed
Before: an item made in a chat that was the bot's Home Chat at the time kept kind: 'home' and the "Home Chat" label forever, on desktop, mobile, the CLI and the look-around prompt. On mobile, kind === 'home' also sent the click to the bot's current Home Chat instead of the chat the item was made in.
After: the same item reads as a plain chat with its own title. An item made in the bot's current Home Chat still says "Home Chat" with the house icon.
Mechanism:BotItemsHost.chatSource() records { kind: 'home' } when the item is created and never revisits it. owningChat() (src/main/bots/bot-items-runtime.ts) now resolves that recorded source at read time: a home source stays home only while the owning bot's chatRoot(chatSessionId) === item.chatId. Otherwise it becomes { kind: 'chat', title: null }, and the chat's own title wins as before; with no title the UI shows the generic "Chat" label and the CLI prints chat:<id>. chatSource and the read-time check share one isHomeChat helper so the two cannot drift. owningChat now takes ownerBotId; item views pass the full record and noteBy in bots-items-mail.ts passes the bot id. Other source kinds (chat, thread, automation) pass through unchanged.
Why
The stored source is an honest snapshot of where the item came from, and the issue confirms the link target is right and only the label is wrong. Resolving at read time avoids a migration or a write on bot new-chat, and it also fixes items created before this change without a backfill. An untitled replaced Home falls back to title: null rather than the recorded "Home Chat", so it never reads "Home Chat" next to a plain chat icon.
Same item row, rendered through BotItemView's label rule (botItemChatName) with the chat source the item had before this change (recorded kind: 'home') and after (owningChat returns kind: 'chat' with the chat's title). The images come from @2SinceJuly's component-fixture capture in the original PR. The fixture was screenshot-only, so it is not part of this change. It shows the label rule; the owningChat resolution is covered by the unit test below.
Before
After
Testing
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
Reproduced with a unit test in src/main/bots/bot-items-runtime.test.ts: bot chatSessionId is home-2, and the item has chatId: 'home-1' with a recorded home source. With bot-items-runtime.ts from main it fails (kind stays 'home'). On this branch it passes for a titled old home, an untitled old home (title: null) and the current home (still home).
Extra probes (deleted owning bot, old home that is gone, another bot's home with the same id) fail on main and pass here.
vitest: bot-items-runtime, every src/main/bots/bot-item* and src/main/runtime/rpc/methods/bots-items* suite (18 files, 71 tests), plus the bot-chat-address, look-around, home and chat suites. All pass.
oxlint, oxfmt --check, anti-slop oxlint, native and type-aware code-quality oxlint, ast-grep, and the changed-code quality gate are clean on the 4 touched files.
Platform: macOS (main-process logic only, no platform-specific code).
Performance
None that matters. owningChat runs once per item when an item list is read, in the main process. It is not a renderer, store or selector path, so nothing fans out per tab. Non-home items return early. A home item adds one bots() lookup (already cached) and one chatRoot call. Benchmark with 200 items, 50 bots and 5000 session records, using the real cached session resolver:
non-home items: 11.0 µs on main, 8.8 µs here per 200-item view
home items: 8.7 µs on main, 47.6 µs here per 200-item view, about +200 ns per item
worst adversarial view: about 3 ms, well under 16 ms
No new I/O, subprocesses or polling.
Risk
Level: Low
Behavior: items made in a Home Chat that has since been replaced change label and icon. If the owning bot is deleted or the bot store hasn't loaded yet, the item falls back to a plain chat label rather than throwing.
Callers: the worker-origin linked-item chatTitle now gets null for an untitled replaced Home, which the type already allows. bot-chat-address --item uses only id/gone, so it is unaffected.
Live refresh: an open items list shows the new label the next time it reads. bot new-chat sends only a 'bot' change notice, so an open list does not re-read straight away. This matches main and is not a regression.
Data/remote: nothing is written and BotItemRecord.source keeps its recorded value. The server resolves the kind before sending, so paired phones and older clients need no wire change.
Rollback: a plain revert.
Review
Reviewed for correctness, breakage across every owningChat caller, and perf. No blocking findings.
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.
It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.
No actionable comments were generated in the recent review.
Walkthrough
The owning chat resolver now receives the owner bot ID and uses the bot’s current Home Chat root to classify items recorded as home. Items from a replaced Home Chat are represented as regular chats with their own title, or no source title when untitled. The mail method passes the bot ID, and tests cover the current and replaced Home Chat cases.
Severity of issue fixed: Low
Merge Risk: Low · up to 1d794
The change makes items from a replaced Home Chat show their own chat title instead of "Home Chat". A narrow edge case may remain for untitled former Home Chats. The change only affects display, writes no data, and is easy to revert, so merge risk is low.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: an item made in a replaced Home Chat is now labelled with its own chat's title. It is specific, concise, and matches the linked issue and the changed code path (owning…
Description check
The description follows the template closely. It covers ELI5, What Changed (before/after and mechanism), Why, a linked issue (Fixes #51868), Visual Proof with before/after images, Testing with the new…
Linked Issues check
Issue #51868 requires that items recorded as made in a replaced Home Chat stop showing "Home Chat" with the house icon, and show that chat's own title. The link target stays unchanged. At head, `BotIt…
Out of Scope Changes check
All changed code connects to the #51868 label fix. owningChat gains ownerBotId in src/main/bots/bot-items-runtime.ts, and the BotItemViewDeps.owningChat type in src/main/bots/bot-item-views.ts p…
Full details: Title check
Explanation
The title names the main change: an item made in a replaced Home Chat is now labelled with its own chat's title. It is specific, concise, and matches the linked issue and the changed code path (owningChat resolves the recorded home source at read time).
Full details: Description check
Explanation
The description follows the template closely. It covers ELI5, What Changed (before/after and mechanism), Why, a linked issue (Fixes #51868), Visual Proof with before/after images, Testing with the new test cases and results, Performance, Risk with level and rollback, AI Disclosure, and the upstream boundary checkbox. The Visual Proof images are from a fixture harness rather than the running app, which the author states, and the template asks for a real BEFORE/AFTER. Some template items such as the Notes and Checklist sections are not ticked, but the content is substantially complete.
Full details: Linked Issues check
Explanation
Issue #51868 requires that items recorded as made in a replaced Home Chat stop showing "Home Chat" with the house icon, and show that chat's own title. The link target stays unchanged. At head, BotItemsHost.currentSource (src/main/bots/bot-items-runtime.ts) returns the recorded source unless its kind is home. For a home source, it keeps home only when isHomeChat(owner, chatId, chatRoot) is true for the item's ownerBotId. Otherwise it returns { kind: 'chat', title: null }. owningChat then uses chatTitle(id) ?? title, so the chat's own title is shown. The stored source is not written, and owningChat still returns the same id, so the link is unchanged. The new unit test in src/main/bots/bot-items-runtime.test.ts covers the replaced chat (kind chat, its own title), an untitled replaced chat (title null, not the recorded 'Home Chat'), and the current Home Chat (kind home). Remaining uncertainty: the renderer label rule botItemChatName was not inspected, so the displayed fallback for a null title is not verified. The PR description also states a second test for chat, thread, and automation pass-through. The test diff at head contains only one new it block, so that claimed test is not present in this diff. The implementation for the linked objective is present regardless.
Full details: Out of Scope Changes check
Explanation
All changed code connects to the #51868 label fix. owningChat gains ownerBotId in src/main/bots/bot-items-runtime.ts, and the BotItemViewDeps.owningChat type in src/main/bots/bot-item-views.ts passes it through. src/main/runtime/rpc/methods/bots-items-mail.ts passes the bot id at the owningChat call, so the same resolution applies to bot-note attribution. The test file changes generalize the existing retention test helper into hostWith(deps) to support the new Home Chat test. This is supporting test refactoring for the same change. No unrelated change was identified. The chat, thread, and automation pass-through behavior is unchanged in code because currentSource returns any non-home source as is. The PR description's claimed fixture and image assets were not inspected, so no conclusion is drawn about them.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 9b83ec69-5de0-417d-85ac-ea3e8f3a50e5
Commits
Reviewing files that changed from the base of the PR and between b2f550f and 1d79479.
Files selected for processing: 2
src/main/bots/bot-items-runtime.test.ts
src/main/bots/bot-items-runtime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
2SinceJuly
added a commit
to 2SinceJuly/orca
that referenced
this pull request
Nov 28, 2026
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Do not fall back to the stored Home Chat title for a demoted Home Chat.
When settledSource demotes a home source to chat, owningChat still falls back to source.title when chatTitle(id) returns null. A stored 'Home Chat' title then remains on that item. This can happen when the chat has no conversationName, when its record is missing (including a deleted chat), or when no record store is available. The label then says Home Chat for a chat that is no longer the bot's Home Chat, which is the defect this change targets.
The fallback for a demoted item must not show Home Chat. The choice of replacement text is open. Options include a generic plain-chat label or the chat id. Keep the fallback for all other sources.
After `orca bot new-chat`, items made in the previous Home Chat kept the
recorded `home` source, so they still showed the house icon and the
"Home Chat" label even though that chat is now a plain chat.
owningChat now resolves a recorded `home` source at read time: it stays
`home` only while the owning bot's current chatSessionId roots to the
item's chat. Otherwise it presents as a plain chat labelled by its own
title (or no title, so the UI falls back to "Chat"). chatSource and the
read-time check share one isHomeChat helper. Nothing stored changes.
Fixesstablyai#51868
Co-authored-by: Neil <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Each bot has a "Home Chat" where it normally talks. When you start a fresh chat with the bot (
orca bot new-chat), the old chat stops being home, but items made there still said "Home Chat" with the house icon. Now those items show the old chat's real name (or just "Chat" if it has none), so the label matches the chat you actually open.What Changed
Before: an item made in a chat that was the bot's Home Chat at the time kept
kind: 'home'and the "Home Chat" label forever, on desktop, mobile, the CLI and the look-around prompt. On mobile,kind === 'home'also sent the click to the bot's current Home Chat instead of the chat the item was made in.After: the same item reads as a plain chat with its own title. An item made in the bot's current Home Chat still says "Home Chat" with the house icon.
Mechanism:
BotItemsHost.chatSource()records{ kind: 'home' }when the item is created and never revisits it.owningChat()(src/main/bots/bot-items-runtime.ts) now resolves that recorded source at read time: ahomesource stayshomeonly while the owning bot'schatRoot(chatSessionId) === item.chatId. Otherwise it becomes{ kind: 'chat', title: null }, and the chat's own title wins as before; with no title the UI shows the generic "Chat" label and the CLI printschat:<id>.chatSourceand the read-time check share oneisHomeChathelper so the two cannot drift.owningChatnow takesownerBotId; item views pass the full record andnoteByinbots-items-mail.tspasses the bot id. Other source kinds (chat,thread,automation) pass through unchanged.Why
The stored
sourceis an honest snapshot of where the item came from, and the issue confirms the link target is right and only the label is wrong. Resolving at read time avoids a migration or a write onbot new-chat, and it also fixes items created before this change without a backfill. An untitled replaced Home falls back totitle: nullrather than the recorded "Home Chat", so it never reads "Home Chat" next to a plain chat icon.Linked Issue
Fixes #51868
Visual Proof
Same item row, rendered through
BotItemView's label rule (botItemChatName) with the chat source the item had before this change (recordedkind: 'home') and after (owningChatreturnskind: 'chat'with the chat's title). The images come from @2SinceJuly's component-fixture capture in the original PR. The fixture was screenshot-only, so it is not part of this change. It shows the label rule; theowningChatresolution is covered by the unit test below.Before

After

Testing
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
Reproduced with a unit test in
src/main/bots/bot-items-runtime.test.ts: botchatSessionIdishome-2, and the item haschatId: 'home-1'with a recordedhomesource. Withbot-items-runtime.tsfrommainit fails (kindstays'home'). On this branch it passes for a titled old home, an untitled old home (title: null) and the current home (stillhome).Extra probes (deleted owning bot, old home that is gone, another bot's home with the same id) fail on main and pass here.
vitest:
bot-items-runtime, everysrc/main/bots/bot-item*andsrc/main/runtime/rpc/methods/bots-items*suite (18 files, 71 tests), plus the bot-chat-address, look-around, home and chat suites. All pass.oxlint,
oxfmt --check, anti-slop oxlint, native and type-aware code-quality oxlint, ast-grep, and the changed-code quality gate are clean on the 4 touched files.Platform: macOS (main-process logic only, no platform-specific code).
Performance
None that matters.
owningChatruns once per item when an item list is read, in the main process. It is not a renderer, store or selector path, so nothing fans out per tab. Non-homeitems return early. Ahomeitem adds onebots()lookup (already cached) and onechatRootcall. Benchmark with 200 items, 50 bots and 5000 session records, using the real cached session resolver:No new I/O, subprocesses or polling.
Risk
Level: Low
chatTitlenow getsnullfor an untitled replaced Home, which the type already allows. bot-chat-address--itemuses onlyid/gone, so it is unaffected.bot new-chatsends only a'bot'change notice, so an open list does not re-read straight away. This matches main and is not a regression.BotItemRecord.sourcekeeps its recorded value. The server resolves the kind before sending, so paired phones and older clients need no wire change.Review
Reviewed for correctness, breakage across every
owningChatcaller, and perf. No blocking findings.Agent skill upstream boundary
Notes
Original fix by @2SinceJuly in #51881. Issue reported by @tenko-labs in #51868.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)