Skip to content

Keep only on-screen chats loaded, so memory stays flat - #45916

Merged
brennanb2025 merged 37 commits into
mainfrom
brennanb2025/flatback-3
Nov 28, 2026
Merged

brennanb2025 merged 37 commits into
mainfrom
brennanb2025/flatback-3

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Before: every chat you opened stayed fully loaded in the background for the rest of the session. After a long day with many chats, Orca's window grew to several GB of memory and never gave it back.

Now: Orca keeps only the chats on screen loaded. A chat loads again when you switch back to it, and it comes back as you left it: your unsent draft, the place you were reading (up to 600 rows back), open sections, a half-answered question or approval, a queued message you were editing, Find and its selected match, and any reply still streaming in. Undo history in the message box starts fresh after a switch, as it does when you open a chat.

Files Added Deleted Net
Test 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1301 $\color{#cf222e}{\Huge{\mathbf{−}}}$​62 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1239
Prod 100 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​2649 $\color{#cf222e}{\Huge{\mathbf{−}}}$​682 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1967

What Changed

  • Before: switching back to any chat visited earlier was instant, but memory grew about 13 MB per chat visited. After: switching back reloads the chat, at about the cost of opening it the first time (switch times below), and memory stays roughly flat.
  • native-chat-view-retention.ts decides which chat views stay mounted across the window: the shown chats, in every split. StructuredAgentSessionPaneOverlayLayer.tsx mounts from that set. Bot rooms are unchanged.
  • native-chat-view-memory.ts is a small per-tab store for view state that used to live only in the mounted view (reading position, expanded turns, Find, question answers, approval detail, new-message marker, the /compact and fork guards). It is bounded per tab and dropped when the tab closes; native-chat-closed-tab-release.ts releases closed tabs from the tab store, including tabs whose workspace is not on screen.
  • The draft text already lives in the draft store, so it survives the reload; the editor and its Undo history are not kept for a released chat.
  • An open queued-message edit stays open across a switch: the edit and its delivery hold are kept with the tab and handed back to the chat's draft only when the tab closes.
  • A chat's read owner is now dropped once its last send settles, so a chat released mid-send does not keep its transcript.

Why

Hidden chat views were the largest piece of renderer memory on heavy profiles. Visiting 150 chats with 2 long turns each on a 1,901-workspace profile (Linux, production build, memory after GC):

Chats visited Renderer before Renderer after Whole app before Whole app after
10 617 MB 490 MB 1,128 MB 964 MB
60 1,426 MB 722 MB 1,916 MB 1,257 MB
150 2,710 MB 764 MB 3,334 MB 1,348 MB

Mounting only the chat on screen and keeping each chat's view state and drafts outside the view is the usual shape for chat apps with many threads. Keeping hidden chats mounted, or keeping each chat's editor for its Undo history, would bring the growth back.

Linked Issue

None: maintainer change from a memory investigation on heavy profiles.

Visual Proof

N/A: nothing looks different. A released chat reloads with the same transcript, draft and reading position. The change is in memory use, measured above.

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

QA ran on a Linux production build with a profile of about 1,900 workspaces and real Claude and Codex agents. The final run covered every flow below in both a Claude and a Codex chat:

  • Memory: after visiting 150 chats, the renderer used 650 MB on this change, against 2,710 MB on main (76% less). An earlier version that still kept 3 hidden chats loaded used 764 MB (766 MB with a draft left in every chat).

  • Coming back after release: a released chat returned with its draft, reading position, expanded turns, a pending approval it could still answer, a reply still streaming in, and Find with its selected match. A chat scrolled near the start of a 1,200-message history opened at the end after reading 3 older pages.

  • Remount flows:

    • /clear then coming back: the expanded turn returned, and the cleared turns stayed hidden.
    • Queued message reorder while switched away: the moved order was kept.
    • Rewind while switched away: Send was enabled again once the rewound conversation showed.
    • Closing a switched-away chat with a draft, then reopening it from Session History.
    • Renaming the workspace of a switched-away chat.
    • A queued edit across a switch: still open with its text, and handed back to the draft when the tab closed.
    • A draft across a switch.
  • Switch time: from clicking a previously opened chat to its text showing, over 30 switches between 10 chats with long transcripts. On main the chat is already loaded; here it reloads.

    Run This change, median / p95 Main, median / p95 Machine load average
    1 95.6 / 243 ms 49.8 / 63.6 ms about 7 (other work on the machine)
    2 74.2 / 99.6 ms 43.5 / 54.7 ms 6.5 falling to 3
    3 72.9 / 84.2 ms – about 3

    In run 1, switches 14 to 20 took 156 to 259 ms while the machine was busy; the other switches took 67 to 124 ms. An earlier run gave 72 / 86 ms here and 46 / 66 ms on main.

  • Reading position: after a keyboard scroll, it came back exactly, including inside one long reply.

Unit tests cover the logic where a silent regression would cost the most:

  • Only shown chats stay mounted.
  • Closed tabs release their state, while renamed or moved tabs keep it, and that work stays bounded.
  • Writes from a closed tab's old requests are ignored.
  • A guard still in flight is never evicted.
  • After a release, these come back and block a second request: an async answer, a queued reorder, a queued edit, /clear's hold and the rewind guard.
  • The new-message marker and the reading-position bookmark come back too.

Each test fails with its fix reverted.

Performance

Renderer memory at 150 visited chats drops from 2,710 MB to 650 MB (76% less). The trade is that each switch back to a chat now reloads it: about 73 ms median against about 45 ms on main, with p95 84 to 100 ms on a quiet machine and 243 ms in one run on a busy one (Testing above). A chat that was scrolled up reads up to 3 older pages (600 rows) to get back to where the reader was; past that it opens at the end. Nothing new runs while idle, and no work grows with the number of tabs or workspaces on a keystroke, store update or switch.

Risk

The riskiest part is a chat coming back after release: if some piece of view state was missed, a user would see it reset (a section collapsed again, or the reading position back at the end). Drafts, running turns, approvals and questions belong to the session or are kept per tab, so no work or text is lost. Nothing is saved to disk; settings, SSH servers and paired phones are unaffected. Back out with a plain revert.

Every guard a chat view held for a send, request or action now lives with the chat tab. A chat released mid-request comes back still waiting on it and can't send it twice. Each guard belongs to the chat tab's lifetime and to the conversation it shows: a request that settles after its tab closed, or after the tab switched to another chat, changes nothing. A guard is dropped when its request settles, and they all end when the tab closes:

  • Sends and answers: async question answers, approvals and worker approvals, paired-device asks, the queued-message send/delete guard, /compact, /clear's hold on sends until the new conversation shows, fork and rewind (each held per conversation, so a late reply never blocks the chat that replaced it), and Continue after an interruption.
  • Queued messages: reorder (its pending flag and the previewed order), and an open edit (kept open, with its delivery hold, until Save, Cancel, the tab closing or a reload, which hands the typed text back to the chat's draft).
  • Stops: background-task Stop, and joining a repeated Stop on older hosts.
  • Composer and account: leaving plan mode, taking input back from a phone, redeeming a Codex reset credit (and its retry key), cancelling an automatic continue after a usage limit, the Antigravity sign-in switch, Claude account sign-in (held per account, so no chat can cancel another's login, and a login that finishes while the chat is switched away shows as signed in on return), model and option picks in flight, reconnecting or starting a stopped host, and opening a terminal for a host command.
  • Cards in the transcript: automation save, run and wait-cancel, Send again on an automation run, create-bot offers, added bot tools, auto-review approvals, the thread goal, the worker dock, and bot tool and Composio app sign-ins, finishing a sign-in from a pasted address, Google setup (sign-in and its waiting state, including one started from the account picker, accounts, client file, stop, step answers, blocker answers, the signed-in account step).

Left in the view on purpose:

  • Terminal-chat sends, their prompt card and session-option commands: unmounting cancels the pending terminal write, so nothing is left in flight.
  • Fork's same-click flag: it is set and cleared together with the kept fork guard.
  • Stop's "Stopping" label: it's only presentation, and a repeated Stop joins the kept Stop request.
  • Orca Cloud sign-in: its progress is already held app-wide, not in the view.
  • Reads, not actions: copying session context, preparing a hand-off, re-checking an agent install, retrying an MCP or link lookup, Slack mirror status, command refresh, and history jumps.
  • After a request settles: the "stop confirmed" marker on a background task (a second Stop on a stopped task does nothing). In a Google setup card the account picks are kept until Add; in a dialog they last as long as the dialog is open.

Coming back to a chat you left far up its history reads at most 3 older pages (600 rows) to get back to where you were. Past that, the chat opens at the end instead of replaying the history page by page on every switch.

Level: Medium

AI Disclosure

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)

@brennanb2025 brennanb2025 changed the title perf(native-chat): keep only shown and recently shown chat views mounted Keep only on-screen and recently viewed chats loaded, so memory stays flat Nov 20, 2026
onegaop added a commit to onegaop/orca that referenced this pull request Nov 27, 2026
onegaop added a commit to onegaop/orca that referenced this pull request Nov 27, 2026
onegaop added a commit to onegaop/orca that referenced this pull request Nov 27, 2026
@brennanb2025
brennanb2025 force-pushed the brennanb2025/flatback-3 branch from 4534a42 to dff1081 Compare November 27, 2026 20:48
…e store, drop idle read owners, keep command and subagent state across remounts
…rk; a subagent view still pages to its spawn
…and released rewinds; closed tabs swept on layer changes, not store writes
…p restore stops re-applying; kept places follow key changes
…eleased per layer; kept editors capped; no marker state while marking is off
…te writes O(1); closed tabs swept per workspace; bookmark survives a given-up restore; marker keeps each transcript's place; restore leaves the tail
…hout a layer swept in turn; give-up flag per transcript; restore leaves follow mode to the landing
…b; closed tabs released at close; sweep bounded; settled async answers dropped
…y no longer kept across release; an open queued edit is kept per tab; guards scoped to the tab's life and conversation; more in-flight guards kept
…n reload and kept across a tab move; reorder preview shows fresh cards; Claude sign-in guarded per account; more guards kept
…ed view; Google sign-in keeps nothing once settled; bulk close groups without copying
…ed command guards keep nothing; /clear holds end when another session shows; Google sign-in and account picks kept per tab
…t through a switch; setup account picks clear on save; pasted-address guard keyed by its sign-in
…nd abandoned runs beyond the newest few are dropped
@brennanb2025 brennanb2025 changed the title Keep only on-screen and recently viewed chats loaded, so memory stays flat Keep only on-screen chats loaded, so memory stays flat Nov 28, 2026
@brennanb2025
brennanb2025 marked this pull request as ready for review November 28, 2026 02:09
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

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.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The PR adds per-tab native-chat view memory, retention, and release handling. It moves state for setup flows, prompts, in-progress actions, composer operations, and queued-session operations into keyed tab memory. It adds transcript-scoped state for expanded turns, disclosures, new-row markers, Find, and reading-position restoration. Navigation supports waiting rows and offsets. Tests cover remounts, tab closure and movement, and pending operations.

Merge Risk: Low · up to c32c5

The change keeps only on-screen chats loaded and restores view state when a chat is revisited. Several edge cases remain open where a failure or completion arriving after a chat switch is not shown on return. These are minor and recoverable, so the change is mergeable with follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: only on-screen chats stay loaded, which keeps memory flat. The changeset matches this. The title is concise and specific, so a teammate scanning history would understa…
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.
Description check Passed The description is thorough and covers every template section. It has a clear ELI5, a detailed What Changed section, a Why section with measured memory and switch-time data, and a Performance line tha…
Full details: Title check

Explanation

The title names the main change: only on-screen chats stay loaded, which keeps memory flat. The changeset matches this. The title is concise and specific, so a teammate scanning history would understand the primary change.

Full details: Description check

Explanation

The description is thorough and covers every template section. It has a clear ELI5, a detailed What Changed section, a Why section with measured memory and switch-time data, and a Performance line that states the trade-off. It also has a Risk section with a Level and a back-out plan, and it includes Testing with checked items and QA steps. Two gaps remain. The Linked Issue section says 'None' and gives a maintainer reason, which the template does not cover for outside contributors. The AI Disclosure section is empty. The template says to leave that section blank for internal team members, so the empty section may be acceptable, but the author should confirm it.

  • 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: 86c658eb-93d3-44cf-940e-9167e7c84646
Commits

Reviewing files that changed from the base of the PR and between 021c084 and c32c51c.

Files selected for processing: 4

  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.test.tsx
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.ts
  • src/renderer/src/components/native-chat/viewport/virtualization/NativeChatTranscriptItems.tsx

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

@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: 14

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: 2f9506a6-ae57-48e3-8501-e19a200fa78b
Commits

Reviewing files that changed from the base of the PR and between 89945de and 998d815.

Files selected for processing: 109

  • config/react-compiler-bailout-baseline.txt
  • src/renderer/src/components/bots/BotToolFinishSignIn.tsx
  • src/renderer/src/components/bots/SignInAddressPaste.tsx
  • src/renderer/src/components/bots/bot-tool-sign-in-action.ts
  • src/renderer/src/components/bots/composio/ComposioSetupChatCard.tsx
  • src/renderer/src/components/bots/google/GoogleAccountPicker.tsx
  • src/renderer/src/components/bots/google/GoogleAccountsChoice.tsx
  • src/renderer/src/components/bots/google/GoogleSignInWaiting.tsx
  • src/renderer/src/components/bots/google/google-account-picker-sign-in.test.tsx
  • src/renderer/src/components/bots/google/setup-cards/GoogleSetupBlockerPanel.tsx
  • src/renderer/src/components/bots/google/setup-cards/GoogleSetupChoiceCards.tsx
  • src/renderer/src/components/bots/google/setup-cards/GoogleSetupConnectCards.tsx
  • src/renderer/src/components/bots/google/setup-cards/GoogleSetupKeyImport.tsx
  • src/renderer/src/components/bots/google/setup-cards/GoogleSetupProgressCards.tsx
  • src/renderer/src/components/bots/google/use-google-client-file.ts
  • src/renderer/src/components/bots/google/use-google-sign-in.ts
  • src/renderer/src/components/native-chat/NativeChatAutomationCardDetails.tsx
  • src/renderer/src/components/native-chat/NativeChatBotCreateOfferCard.tsx
  • src/renderer/src/components/native-chat/NativeChatGoogleOfferCard.tsx
  • src/renderer/src/components/native-chat/NativeChatImportPlanCard.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatToolAddedCard.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptViewport.tsx
  • src/renderer/src/components/native-chat/antigravity-auth/native-chat-antigravity-auth.tsx
  • src/renderer/src/components/native-chat/automation-run/NativeChatAutomationRunBody.tsx
  • src/renderer/src/components/native-chat/automation-run/NativeChatWaitRow.tsx
  • src/renderer/src/components/native-chat/composer/NativeChatComposerPane.tsx
  • src/renderer/src/components/native-chat/composer/controls/NativeChatComposerPlanChip.tsx
  • src/renderer/src/components/native-chat/composer/submit/use-native-chat-composer-submit.ts
  • src/renderer/src/components/native-chat/conversation/projection/use-native-chat-context-clear-floor.ts
  • src/renderer/src/components/native-chat/conversation/projection/use-native-chat-conversation-key.ts
  • src/renderer/src/components/native-chat/conversation/slots/native-chat-transcript-slot-selection.ts
  • src/renderer/src/components/native-chat/conversation/turns/use-native-chat-transcript-thinking.ts
  • src/renderer/src/components/native-chat/drafts/use-native-chat-composer-recall.ts
  • src/renderer/src/components/native-chat/host-access/claude-account-sign-in-pending.ts
  • src/renderer/src/components/native-chat/host-access/native-chat-host-command-terminal.ts
  • src/renderer/src/components/native-chat/host-access/native-chat-host-setup.ts
  • src/renderer/src/components/native-chat/host-access/use-native-chat-host-outage-notice.ts
  • src/renderer/src/components/native-chat/host-access/use-native-chat-mobile-hold-notice.ts
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.ts
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-rewind.test.tsx
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-rewind.ts
  • src/renderer/src/components/native-chat/messages/disclosure/native-chat-disclosure-store.ts
  • src/renderer/src/components/native-chat/messages/disclosure/use-native-chat-expanded-turns.ts
  • src/renderer/src/components/native-chat/messages/notices/NativeChatAutoReviewDenialRow.tsx
  • src/renderer/src/components/native-chat/paired-server-asks/NativeChatPairedServerAskStack.tsx
  • src/renderer/src/components/native-chat/paired-server-asks/use-paired-server-ask-decisions.test.tsx
  • src/renderer/src/components/native-chat/paired-server-asks/use-paired-server-ask-decisions.ts
  • src/renderer/src/components/native-chat/pane/ownership/native-chat-view-memory.test.tsx
  • src/renderer/src/components/native-chat/pane/ownership/native-chat-view-memory.ts
  • src/renderer/src/components/native-chat/pane/routing/StructuredAgentSessionPaneOverlayLayer.tsx
  • src/renderer/src/components/native-chat/pane/routing/native-chat-closed-tab-release.test.ts
  • src/renderer/src/components/native-chat/pane/routing/native-chat-closed-tab-release.ts
  • src/renderer/src/components/native-chat/pane/routing/native-chat-view-retention.test.ts
  • src/renderer/src/components/native-chat/pane/routing/native-chat-view-retention.ts
  • src/renderer/src/components/native-chat/prompts/NativeChatApprovalCard.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatQuestionCard.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatQuestionCardParts.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatStructuredAsyncQuestion.test.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatStructuredAsyncQuestion.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatStructuredPromptCard.tsx
  • src/renderer/src/components/native-chat/prompts/NativeChatStructuredQuestionCard.tsx
  • src/renderer/src/components/native-chat/prompts/use-native-chat-approval-quiet-detail.ts
  • src/renderer/src/components/native-chat/prompts/use-native-chat-async-questions.ts
  • src/renderer/src/components/native-chat/prompts/use-native-chat-question-form.ts
  • src/renderer/src/components/native-chat/prompts/use-structured-prompt-response-hold.ts
  • src/renderer/src/components/native-chat/queue/editing/native-chat-queued-edit-kept.test.tsx
  • src/renderer/src/components/native-chat/queue/editing/native-chat-queued-edit-session.ts
  • src/renderer/src/components/native-chat/queue/editing/use-structured-agent-session-queued-edit.ts
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-queued-messages.ts
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-queued-reorder.test.tsx
  • src/renderer/src/components/native-chat/queue/use-structured-agent-session-queued-reorder.ts
  • src/renderer/src/components/native-chat/session/goals/use-structured-agent-session-thread-goal.ts
  • src/renderer/src/components/native-chat/session/native-chat-removed-tab-retirement.ts
  • src/renderer/src/components/native-chat/session/options/controls/NativeChatSessionOptionPickers.tsx
  • src/renderer/src/components/native-chat/session/structured/read/structured-agent-session-read-activity.ts
  • src/renderer/src/components/native-chat/session/structured/read/structured-agent-session-read-owner-create.ts
  • src/renderer/src/components/native-chat/session/structured/use-structured-agent-session.ts
  • src/renderer/src/components/native-chat/session/structured/use-structured-chat-live-session.ts
  • src/renderer/src/components/native-chat/session/structured/writes/use-structured-agent-session-command-write.test.tsx
  • src/renderer/src/components/native-chat/session/structured/writes/use-structured-agent-session-command-write.ts
  • src/renderer/src/components/native-chat/session/structured/writes/use-structured-agent-session-mutate.ts
  • src/renderer/src/components/native-chat/session/terminal/read/native-chat-live-session-contract.ts
  • src/renderer/src/components/native-chat/subagents/NativeChatSubagentSheetLayer.tsx
  • src/renderer/src/components/native-chat/subagents/native-chat-open-subagent.test.ts
  • src/renderer/src/components/native-chat/subagents/native-chat-open-subagent.ts
  • src/renderer/src/components/native-chat/subagents/use-structured-native-chat-subagents.tsx
  • src/renderer/src/components/native-chat/tools/tasks/dock/use-worker-dock-owner-actions.ts
  • src/renderer/src/components/native-chat/tools/tasks/dock/worker-dock-stack-fixture.tsx
  • src/renderer/src/components/native-chat/tools/tasks/use-structured-session-task-stop.ts
  • src/renderer/src/components/native-chat/usage/NativeChatAccountUsageCard.tsx
  • src/renderer/src/components/native-chat/usage/NativeChatInterruptedContinue.tsx
  • src/renderer/src/components/native-chat/usage/use-native-chat-usage-limit-auto-continue.ts
  • src/renderer/src/components/native-chat/viewport/find/NativeChatFindBar.tsx
  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-rail-jump-landing.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-reading-position.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-transcript-navigation.ts
  • src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.test.tsx
  • src/renderer/src/components/native-chat/viewport/new-rows/native-chat-new-rows-marker.ts
  • src/renderer/src/components/native-chat/viewport/scroll/native-chat-transcript-scroll-types.ts
  • src/renderer/src/components/native-chat/viewport/scroll/use-native-chat-transcript-scroll.ts
  • src/renderer/src/components/native-chat/viewport/virtualization/NativeChatTranscriptItems.tsx
  • src/renderer/src/components/native-chat/viewport/virtualization/use-native-chat-transcript-window.ts
  • src/renderer/src/components/native-chat/viewport/virtualization/use-native-chat-viewport-align.ts
  • src/renderer/src/components/native-chat/worker-approvals/NativeChatWorkerApprovals.tsx
  • src/shared/agent-session/lifecycle/rewind/agent-session-rewind-request.ts

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

…estores at most 3 history pages; Find's match and a Claude sign-in kept with the tab

@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

  • 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: 5af10919-5fb2-4b85-af0a-052f9e7d9f16
Commits

Reviewing files that changed from the base of the PR and between 2c99028 and 9ede7fd.

Files selected for processing: 15

  • src/renderer/src/components/native-chat/host-access/native-chat-host-setup.ts
  • src/renderer/src/components/native-chat/host-access/native-chat-managed-claude-sign-in.test.tsx
  • src/renderer/src/components/native-chat/host-access/native-chat-managed-claude-sign-in.ts
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-fork.ts
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-rewind.test.tsx
  • src/renderer/src/components/native-chat/messages/actions/use-native-chat-rewind.ts
  • src/renderer/src/components/native-chat/pane/ownership/native-chat-view-memory.ts
  • src/renderer/src/components/native-chat/viewport/find/native-chat-find-kept-match.ts
  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.test.tsx
  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.test.tsx
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-reading-position.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-transcript-navigation.ts
  • src/renderer/src/components/native-chat/viewport/virtualization/NativeChatTranscriptItems.tsx
Files with no reviewable changes: 1

  • src/renderer/src/components/native-chat/pane/ownership/native-chat-view-memory.ts

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

… Find waits for its kept match's row, and waiting rows carry a row key

@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: 2

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: fea7f286-9707-41d4-986d-8434cc220d1a
Commits

Reviewing files that changed from the base of the PR and between 9ede7fd and 021c084.

Files selected for processing: 7

  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.test.tsx
  • src/renderer/src/components/native-chat/viewport/find/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.test.tsx
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-history-jump.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-reading-position.ts
  • src/renderer/src/components/native-chat/viewport/navigation/use-native-chat-transcript-navigation.ts
  • src/renderer/src/components/native-chat/viewport/virtualization/NativeChatTranscriptItems.tsx

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

…nd keeps its anchor while waiting, and a row keeps its Find key when it leaves the queue
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: done on c32c51c37f3

  • QA on a test copy with about 1,900 workspaces, at 00cc9de026f. A remounted chat keeps its draft, scroll position, open sections, pending approvals and questions, the queued message being edited, and streaming output. Renderer memory at 150 visited chats: 764 MB (2,710 MB on main). Switching back to a chat: median 72 ms and p95 86 ms (main: 46 ms and 66 ms).
  • Since QA: guards are now held per conversation. A return reads at most 3 older pages of history. Find keeps its selected match, and a Claude sign-in that finishes while you're in another chat shows on return. Each fix has a test that fails without it.
  • Checks: pnpm check:changed passes on this head (45 checks), and CI is green.

Draft kept on return
Approval kept on return
Queued edit after return
Queued edit reopened
Streaming kept on return
Reading position before switch
Reading position after return

…h an import-free hook, ending the store import cycle
…itched away show on return; async skips survive a tab move; queued-edit, /clear-hold, Stop-join and recall-scope edge cases
…per tab; a kept dock failure keeps only its message, and a late refusal refills its address
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: done on 0cd0d9d19a9

  • QA at 9e91ed6d90d, on a Linux production build with 1,901 workspaces and 1,800 chat tabs, using real Claude (Opus 5.5, Medium) and Codex chats.
    • Renderer memory at 150 visited chats: 650 MB here, 2,710 MB on main.
    • Every flow passed for both agents:
      • draft, reading position, pending approval, streaming reply, Find with its selected match, queued-message edit, and /clear (Claude only), each across a switch
      • a chat left near the start of a 1,200-message history opens at the end after reading 3 older pages
  • Switch time (median / p95, 30 switches):
    • Here: 95.6 / 243 ms on a busy machine (load average about 7), then 74.2 / 99.6 and 72.9 / 84.2 ms.
    • Main: 49.8 / 63.6 and 43.5 / 54.7 ms.
  • Since QA: two later commits cap the kept errors per tab, keep the worker dock's Retry with the view that made it, refill a refused address that arrives late, and fix a test. None of them touches a QA flow.
  • Checks: pnpm check:changed passes on this head (45 checks), CI is green, and all review threads are resolved.

Draft after return, Claude
Reading position after return, Codex
Approval after return, Claude
Still streaming after return, Codex
Find keeps its match, Codex
Queued edit after return, Claude
After /clear, new conversation, Claude
Long history opens at the end, Claude

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf-scan on 0cd0d9d19a9: clean. It covers the last shipped changes, the per-tab caps on kept errors and the worker dock's Retry, plus the subscribe surface across the PR.

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