Skip to content

Avoid local scrollback serialization on shutdown - #1821

Merged
nwparker merged 1 commit into
mainfrom
nwparker/perf-scan2-scrollback-persistence
May 14, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/perf-scan2-scrollback-persistence

Conversation

@nwparker

Copy link
Copy Markdown
Contributor

Category: Scrollback persistence

Symptom: Clean app shutdown still walked every mounted terminal pane and synchronously serialized local scrollback, even though local/floating buffers are pruned from the workspace-session payload immediately afterward. Large local scrollback could make quit/beforeunload stall on renderer-main-thread work.

Wasted resource: Renderer CPU and memory churn from SerializeAddon.serialize() plus the 512 KB binary-search trimming path for local buffers that are never persisted.

Measurement: Added a focused shutdown-capture regression test that sets a 50k-row local pane and asserts the capture path does not flush or call serialize() when buffer capture is disabled, while preserving PTY IDs and titles. Existing payload byte-shape tests still assert local/floating buffers are pruned and SSH buffers are preserved.

Fix: Shared the local-vs-SSH scrollback preservation classifier, and made beforeunload invoke terminal capture with includeLocalBuffers: false. SSH and unknown repos still capture renderer buffers; worktree sleep keeps the previous include-local behavior for defense-in-depth.

Verification:

  • pnpm exec vitest run --config config/vitest.config.ts src/shared/workspace-session-terminal-buffers.test.ts src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.test.ts src/renderer/src/lib/workspace-session.test.ts
  • pnpm exec tsgo --noEmit -p config/tsconfig.tc.web.json
  • pnpm exec oxlint src/renderer/src/App.tsx src/renderer/src/components/terminal-pane/shutdown-buffer-captures.ts src/renderer/src/components/terminal-pane/TerminalPane.tsx src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.ts src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.test.ts src/shared/workspace-session-terminal-buffers.ts src/shared/workspace-session-terminal-buffers.test.ts
  • pnpm exec oxfmt --check src/renderer/src/App.tsx src/renderer/src/components/terminal-pane/shutdown-buffer-captures.ts src/renderer/src/components/terminal-pane/TerminalPane.tsx src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.ts src/renderer/src/components/terminal-pane/terminal-shutdown-layout-capture.test.ts src/shared/workspace-session-terminal-buffers.ts src/shared/workspace-session-terminal-buffers.test.ts
  • git diff --check

@nwparker
nwparker force-pushed the nwparker/perf-scan2-scrollback-persistence branch from bdd1fcc to 7f8fa7b Compare May 14, 2026 07:43
@nwparker
nwparker merged commit 4c7f5e3 into main May 14, 2026
2 checks passed
@nwparker
nwparker deleted the nwparker/perf-scan2-scrollback-persistence branch May 14, 2026 08:22
Jinwoo-H pushed a commit to thomaszdxsn/orca that referenced this pull request Jun 18, 2026
Jinwoo-H added a commit that referenced this pull request Jun 18, 2026
* Revert "fix(terminal): add proportional scroll fallback for sidebar resize" (#937)

* fix(sidebar): smoothly animate off-screen worktree reveal on click (#1302)

Clicking a worktree card whose row lies outside the sidebar viewport
caused an instant jump when scrolling it into view. Switching
`scrollToIndex` to `behavior: 'smooth'` turns that minimum-distance
scroll into an animated slide while keeping `align: 'auto'` so visible
cards still no-op (no re-centering).

Co-authored-by: Orca <help@stably.ai>

* Avoid local scrollback serialization on shutdown (#1821)

* Fix PR refresh coordinator test arguments (#2545)

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* ci: gate release-cut to the canonical repo so it skips forks (#4815)

The cut job checks out main, bumps package.json's version, and
fast-forwards main. On a fork with Actions enabled, the scheduled RC
cut runs against the fork's main and diverges it on the version line
every slot, so that contributor's PRs back to upstream conflict on
package.json even when their change never touches it.

Gate the job to github.repository == 'stablyai/orca' so it (and the
jobs that depend on it) no-op on forks. Canonical scheduled and manual
cuts are unaffected.

* feat(hooks): install Devin managed status hooks

* feat(devin): address hook review, resume, and UI polish

- Parse Devin config.json as JSONC; warn on read_config_from overlap
- Windows hook command uses forward slashes; APPDATA fallback
- Add devin to sleeping-agent resume and UI registries (plan 003/004)
- Add hook-service and hook-config-json tests

Closes follow-up for plans 002–004 on feat/add-devin-agent.

* feat(devin): scan ATIF transcripts for AI Vault

Register devin in AI_VAULT_AGENTS, discover ~/.local/share/devin/cli/transcripts
(or DEVIN_HOME), parse ATIF JSON sessions, and build devin --resume commands.

* docs(devin): clarify stdin-after-start vs bracketed paste

* fix(devin): use JSONC for remote install, add partial+APPDATA tests

- installRemote: replace readHooksJsonRemote (JSON.parse) with
  readTextFileRemote + parseJsonc for JSONC compatibility on SSH
- Add partial status test (some hooks missing → state:'partial')
- Add Windows APPDATA config path test with fallback

* fix(devin): address CodeRabbit review — sessionId fallback, parseJsonc errors, comment, i18n

* Fix Devin integration edge cases

Co-authored-by: Orca <help@stably.ai>

* Package Devin JSONC parser dependency

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Trevin Chow <trevin@trevinchow.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
* Revert "fix(terminal): add proportional scroll fallback for sidebar resize" (stablyai#937)

* fix(sidebar): smoothly animate off-screen worktree reveal on click (stablyai#1302)

Clicking a worktree card whose row lies outside the sidebar viewport
caused an instant jump when scrolling it into view. Switching
`scrollToIndex` to `behavior: 'smooth'` turns that minimum-distance
scroll into an animated slide while keeping `align: 'auto'` so visible
cards still no-op (no re-centering).

Co-authored-by: Orca <help@stably.ai>

* Avoid local scrollback serialization on shutdown (stablyai#1821)

* Fix PR refresh coordinator test arguments (stablyai#2545)

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.31

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* release: v1.4.36-rc.6

* ci: gate release-cut to the canonical repo so it skips forks (stablyai#4815)

The cut job checks out main, bumps package.json's version, and
fast-forwards main. On a fork with Actions enabled, the scheduled RC
cut runs against the fork's main and diverges it on the version line
every slot, so that contributor's PRs back to upstream conflict on
package.json even when their change never touches it.

Gate the job to github.repository == 'stablyai/orca' so it (and the
jobs that depend on it) no-op on forks. Canonical scheduled and manual
cuts are unaffected.

* feat(hooks): install Devin managed status hooks

* feat(devin): address hook review, resume, and UI polish

- Parse Devin config.json as JSONC; warn on read_config_from overlap
- Windows hook command uses forward slashes; APPDATA fallback
- Add devin to sleeping-agent resume and UI registries (plan 003/004)
- Add hook-service and hook-config-json tests

Closes follow-up for plans 002–004 on feat/add-devin-agent.

* feat(devin): scan ATIF transcripts for AI Vault

Register devin in AI_VAULT_AGENTS, discover ~/.local/share/devin/cli/transcripts
(or DEVIN_HOME), parse ATIF JSON sessions, and build devin --resume commands.

* docs(devin): clarify stdin-after-start vs bracketed paste

* fix(devin): use JSONC for remote install, add partial+APPDATA tests

- installRemote: replace readHooksJsonRemote (JSON.parse) with
  readTextFileRemote + parseJsonc for JSONC compatibility on SSH
- Add partial status test (some hooks missing → state:'partial')
- Add Windows APPDATA config path test with fallback

* fix(devin): address CodeRabbit review — sessionId fallback, parseJsonc errors, comment, i18n

* Fix Devin integration edge cases

Co-authored-by: Orca <help@stably.ai>

* Package Devin JSONC parser dependency

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
Co-authored-by: Brennan Benson <79079362+brennanb2025@users.noreply.github.com>
Co-authored-by: Orca <help@stably.ai>
Co-authored-by: Jinjing <6427696+AmethystLiang@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Trevin Chow <trevin@trevinchow.com>
Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
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