Skip to content

Make mobile terminals load faster#1147

Merged
boudra merged 2 commits into
mainfrom
perf/terminal
May 23, 2026
Merged

Make mobile terminals load faster#1147
boudra merged 2 commits into
mainfrom
perf/terminal

Conversation

@boudra
Copy link
Copy Markdown
Collaborator

@boudra boudra commented May 23, 2026

Linked issue

None.

Type of change

  • Bug fix
  • New feature (with prior issue + design alignment)
  • Refactor / code improvement
  • Docs

What does this PR do

Terminal attach now restores only the visible terminal content plus a bounded amount of recent scrollback when the host supports the new restore mode. That makes terminals faster to load on mobile and avoids sending a full structured scrollback snapshot for every attach.

Older clients keep using the legacy snapshot path. New clients detect the host capability before requesting the bounded restore path.

How did you verify it

Local verification passed:

  • npx vitest run packages/server/src/shared/messages.terminal-restore.test.ts --bail=1
  • npx vitest run packages/app/src/terminal/runtime/terminal-restore-options.test.ts packages/app/src/terminal/runtime/terminal-stream-controller.test.ts --bail=1
  • npx vitest run packages/app/src/terminal/runtime/terminal-emulator-runtime.test.ts --bail=1
  • npx vitest run packages/server/src/client/terminal-stream-router.test.ts packages/server/src/terminal/terminal-restore.test.ts packages/server/src/terminal/terminal-session-controller.test.ts --bail=1
  • npx vitest run packages/server/src/server/daemon-client.e2e.test.ts --maxWorkers=1 --bail=1 -t "receives server_info on websocket connect"
  • npx vitest run packages/server/src/server/daemon-e2e/terminal.e2e.test.ts --maxWorkers=1 --bail=1
  • npm run build:terminal-webview --workspace=@getpaseo/app
  • npm run build:daemon
  • npm run typecheck
  • npm run lint
  • git diff --check

Before merge, the main manual smoke worth doing is opening a long-running terminal from the mobile app and confirming the screen appears quickly with recent output intact.

Risk surface

  • Terminal attach now has two restore paths: legacy structured snapshots and capability-gated ANSI restore frames.
  • The daemon/client ordering around restore plus live output is sensitive; e2e and controller tests cover restore-before-output ordering.
  • The mobile WebView terminal runtime now has a restore-specific write path, so mobile terminal attach is the main platform surface to smoke manually.

Checklist

  • One focused change. Unrelated cleanups split out.
  • npm run typecheck passes
  • npm run lint passes
  • npm run format ran (Biome)
  • UI changes include screenshots or video for every affected platform
  • Tests added or updated where it made sense

@boudra boudra merged commit 846c9b9 into main May 23, 2026
14 checks passed
@boudra boudra deleted the perf/terminal branch May 23, 2026 10:41
boudra added a commit that referenced this pull request May 27, 2026
Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split
shared/ paths that this branch moves into @getpaseo/protocol. Redirect
those imports to the protocol package so typecheck stays green after the
rebase.
boudra added a commit that referenced this pull request May 27, 2026
Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split
shared/ paths that this branch moves into @getpaseo/protocol. Redirect
those imports to the protocol package so typecheck stays green after the
rebase.
boudra added a commit that referenced this pull request May 27, 2026
Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split
shared/ paths that this branch moves into @getpaseo/protocol. Redirect
those imports to the protocol package so typecheck stays green after the
rebase.
boudra added a commit that referenced this pull request May 27, 2026
* Extract client SDK package

* Polish SDK client identity defaults

* Build client before dependent CI jobs

* Restore daemon client server export

* Extract protocol and client SDK packages

* Fix provider override schema validation

* Fix app test daemon client imports

* Simplify workspace build targets

* Fix CLI test server build bootstrap

* Run SDK package tests in CI

* Fix rebase package split drift

* Restore lockfile registry metadata

* Update SDK config test for prompt default

* Move terminal stream router test to client package

* Fix rebase drift for protocol imports

* Fix SDK agent capability fixture

* Restore legacy server client exports

* Fix server export compatibility test

* Advertise custom mode icon client capability

* Remove server daemon-client exports

* Format rebased mode control import

* Fix rebase drift for protocol imports

Files added by upstream PRs (#893, #1147, #1154) referenced the pre-split
shared/ paths that this branch moves into @getpaseo/protocol. Redirect
those imports to the protocol package so typecheck stays green after the
rebase.
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