Skip to content

feat(terminal): inline images via @xterm/addon-image (perf-first) - #19512

Merged
nwparker merged 14 commits into
mainfrom
OrcaWin/np-inline-xterm-images
Sep 18, 2026
Merged

nwparker merged 14 commits into
mainfrom
OrcaWin/np-inline-xterm-images

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 34 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1603 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1601
Prod 37 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1241 $\color{#cf222e}{\Huge{\mathbf{−}}}$​76 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1165

What changed

Adds inline terminal images through the pinned @xterm/addon-image integration: SIXEL, iTerm2 IIP, and Kitty graphics. Terminal → Inline Images is enabled by default and can be toggled on a running pane. The addon is dynamically imported for enabled panes after renderer startup, keeping decoder code out of the static boot graph; idle panes allocate no decoded-image buffers.

Image bytes use the existing PTY stream, so local shells, daemon terminals, relay/SSH terminals, and WSL keep the same execution path. When enabled, Orca advertises SIXEL in DA1 and exports ORCA_IMAGE_PROTOCOL=kitty as an encoder hint. The hint is forwarded across the WSL boundary and does not add image support to older clients.

Resource limits and review fixes

  • Each protocol has an 8 MiB input limit (the addon’s encoded-capacity calculation includes base64 overhead); decoded/displayed image storage is capped at 32 MB per pane.
  • Unfinished Kitty uploads, retained encoded blobs, and pending decoder allocations have separate bounded accounting and eviction. The guard rejects decoder allocations whose worst-case capacity cannot fit the storage budget. These are per-pane resource budgets, not a process-wide RSS or whole-machine OOM guarantee.
  • Reset, detach, close, failed-load, and asynchronous generation paths release image resources. Font zoom reuses image storage instead of making enlarged full-image copies.
  • Kitty acknowledgements use the synthetic query-reply path, avoiding user-activity/viewport claims and ordinary remote-input debounce.
  • Lazy import attempts are capped at three and recover after a failed attempt without duplicate in-flight imports.

Why the pinned xterm patch is required

The upstream addon exposes image-size and cache options, but no public hooks to bound every memory path that matters for a long-lived terminal. An unfinished Kitty upload can retain a WASM decoder at its maximum capacity; compressed input can inflate before output budgeting; reset or disposal can race an asynchronous bitmap decode; and font zoom can create a full enlarged image copy. Kitty payloads waiting for placement also sit outside the decoded-image cache.

The Orca-local source patch adds those missing guardrails: a pending-decoder governor with an allocation-before-admission check, chunked decompression with an output limit, generation fencing and disposal cleanup for async bitmaps, byte-based Kitty payload eviction, PNG dimension validation, and zoom-time visible-tile scaling. The generated addon bundle is patched from the same source so shipped code and tests stay reproducible. This is deliberately an integration safety patch around addon internals, not a new wire protocol. It must be revalidated when the pinned addon version changes.

The accounting is per pane: 32 MB decoded storage, up to 32 MB retained encoded Kitty payloads, and one active plus up to two pending decoder capacities, plus transient browser buffers. It bounds the feature's known pools but is not a process-wide RSS or absolute OOM guarantee.

Validation

  • Focused unit/regression coverage, typecheck, lint, formatting, generated xterm patch reproducibility, and the full PR check suite pass at head 17a7868c088b005425f00dc958f9bc6e15b16fb2.
  • Fresh CI passes packaging on Windows, native smoke on macOS/Windows/Ubuntu, Linux X11 and Wayland IME checks, WSL terminal checks, cross-version wire compatibility, and the changed E2E suite. Those platform jobs validate the surrounding app/runtime; they do not by themselves prove image pixels on every OS.
  • Hidden Electron + Playwright CDP visual proof on the macOS renderer, using a real PTY and folder workspace, renders SIXEL, IIP, and Kitty images and verifies the runtime toggle: before/after proof.
  • The Docker SSH E2E lane verifies image pixels before and after transport drop/recovery and relay stall, shell/PTy survival, 100 unfinished-upload flood bounds, reset cleanup, and font-zoom storage invariance. A separate Orca CLI check used the connected Linux SSH host openclaw (Linux 7.0.0-30-generic x86_64) to create a disposable remote worktree, run a real PTY, and send an inline Kitty frame through the stream; the worktree was removed afterward.
  • Orca host inventory at review time: local macOS renderer; connected Linux SSH target openclaw; saved Windows environments awin and win-lowspec; saved macOS environment m4air. The live pixel proof is macOS, while remote-host transport coverage is Linux SSH. Windows/Linux renderer pixel proof and release-scale RSS/throughput remain CI/release validation gaps.

The image feature is user-toggleable per pane, including live disable/re-enable; disabling also removes SIXEL capability advertisement and prevents image decoding. This follows the established terminal-emulator pattern of making image support opt-in or configurable because image protocols carry decoder and cache cost.

No persisted image-state migration or new stream opcode was added. Historical images are not serialized in remote snapshots and are not promised to survive terminal serialization/recreation.

Cross-reference

PR #19201 overlaps this addon integration. Its later force-push rebased existing commits with xterm patch/lockfile updates; it does not remove the need for one coordinated loader/addon. This PR keeps the addon off the boot path and retains the snapshot caveat.

Credits

Built from first principles and cross-checked against related community work:

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

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
📝 Walkthrough

Walkthrough

Adds configurable inline image rendering for SIXEL, iTerm2 IIP, and Kitty graphics. The change introduces lazy @xterm/addon-image loading, pane lifecycle integration, runtime toggling, Sixel DA1 reporting, Kitty acknowledgement handling, PTY protocol propagation, and WSL forwarding. It patches image decoding, rendering, cancellation, and memory limits. Unit, contract, and end-to-end tests cover lifecycle cleanup, resource bounds, zoom, SSH recovery, and paired runtime recovery.

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 3c376

Relay sessions can lose the image protocol hint, and three transient chunk-load failures permanently disable inline images until the renderer restarts. Resolve these behavior gaps before merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 64 functions across 58 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely identifies the primary change: adding inline terminal images through @xterm/addon-image.
Description check ✅ Passed The description is detailed and covers the user impact, implementation, rationale, resource limits, testing, platform coverage, and known gaps. It does not reproduce every template heading and does no…
Full details: Docstring Coverage

Explanation

Docstring coverage is 21.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 64 functions across 58 files. (3 skipped: 3 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR

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

Comment @coderabbitai help to get the list of available commands.

@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

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 714aa42e-5439-433d-88f8-5971af290569

📥 Commits

Reviewing files that changed from the base of the PR and between 7adb5b3 and b47ed52f4ece76837cd4de17eeb359d31915202f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (46)
  • config/scripts/renderer-boot-graph.mjs
  • package.json
  • src/main/daemon/pty-subprocess/spawn-environment.ts
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/main/providers/local-pty-spawn-environment.ts
  • src/main/pty/wsl-orca-env.test.ts
  • src/main/pty/wsl-orca-env.ts
  • src/relay/pty-handler-spawn-environment.test.ts
  • src/relay/pty-handler.ts
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.test.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-container-listener-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.test.ts
  • src/renderer/src/lib/pane-manager/pane-drop-no-op.test.ts
  • src/renderer/src/lib/pane-manager/pane-fit-resize-observer.test.ts
  • src/renderer/src/lib/pane-manager/pane-initial-fit-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-manager-pane-creation.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-manager.ts
  • src/renderer/src/lib/pane-manager/pane-reveal-repaint.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.ts
  • src/renderer/src/lib/pane-manager/pane-split-scroll.test.ts
  • src/renderer/src/lib/pane-manager/pane-terminal-gpu-acceleration.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-reparent-frame.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.test.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-key-retention.test.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/terminal-image-protocol.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment thread src/relay/pty-handler.ts Resolved
@nwparker

nwparker commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Visual proof: real PTY output in an Orca folder workspace, captured through Playwright CDP with ORCA_BACKGROUND_LAUNCH=1. The Terminal → Inline Images setting suppresses all three protocols when disabled; iTerm2 PNG, SIXEL, and Kitty render when enabled.

Disabled:

Inline images disabled

Enabled:

Inline images enabled

This capture covers macOS local rendering. SSH/network-failure and native Windows/Linux rendering were not exercised. Readiness review and resource-limit fixes are in progress.

@pullfrog pullfrog 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.

Important

The DA1-authority ordering this PR relies on is only guaranteed once the addon chunk is already resolved. On the first image-enabled pane the addon attaches after Orca's c handler and its own _da1 handler wins, answering \x1b[?62;4;9;22c instead of Orca's \x1b[?1;2;4c. See the inline comment and the section below.

Reviewed changes

  • Deferred @xterm/addon-image loader — a lazy chunk (terminal-image-addon-loader.ts) with a 3-attempt cap, plus idempotent attach/detach/live-toggle plumbing (pane-inline-images.ts, pane-manager.ts).
  • DA1 Sixel advertisement — withSixelDa1Attribute appends ;4 to Orca's DA1 reply, resolved per query via a new sixelSupported callback so a live toggle changes the next response.
  • New setting — terminalInlineImages (default on), a Terminal → Inline Images switch, and i18n entries.
  • Agent hint — ORCA_IMAGE_PROTOCOL=kitty exported across local/daemon/relay spawn environments and forwarded into WSL via WSLENV.
  • Guard + tests — a boot-graph forbidden-payload signature for the addon and unit coverage for the above.

⚠️ Inline-image addon is never primed off the boot path, and the DA1-ordering fix is untested end-to-end

The PR description says the addon is "primed after first paint, only when the setting is on", and terminal-image-addon-loader.ts:7 repeats that claim. It is not. primeTerminalImageAddon is called only from the deferred branch of attachInlineImages, so nothing loads the chunk until the first image-enabled pane opens — and that first attach is always deferred, not synchronous. The WebGL addon gets a void primeTerminalWebglAddon() in main.tsx:85; this addon gets no equivalent, which is what actually enforces the "Orca's DA1 handler is registered after the addon's" ordering the fix depends on.

Separately, none of the new tests activate a real ImageAddon: pane-inline-images.test.ts mocks the module with an activate() that registers no parser handlers, and terminal-capability-replies.test.ts exercises Orca's handler in isolation. So the one behavior that is both load-bearing and order-dependent — Orca's DA1 handler winning over the addon's — is not pinned by any test.

Technical details
# Inline-image addon is not primed off the boot path; DA1 ordering is racy and untested

## Affected sites
- src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts:7 — comment claims "primed after first paint", but no caller does this
- src/renderer/src/lib/pane-manager/pane-inline-images.ts:37 — the only `primeTerminalImageAddon()` call, inside the deferred branch
- src/renderer/src/main.tsx:85 — primes the WebGL addon only; no image-addon equivalent
- src/renderer/src/lib/pane-manager/pane-inline-images.test.ts:4-16 — mock addon registers no CSI `c` handler, so ordering is never exercised

## Required outcome
- The first image-enabled pane must answer DA1 through Orca's handler (deterministic `\x1b[?1;2;4c`), not the addon's `\x1b[?62;4;9;22c`, regardless of whether the chunk was already loaded.
- A test that activates the real addon (or a faithful mock that registers a DA1 handler) and asserts the final DA1 reply, covering both the pre-primed and deferred paths.

## Suggested approach (optional)
- Prime the addon off the boot path in `main.tsx` (and `web/main.tsx`) like the WebGL addon, so `attachInlineImages` is synchronous for every pane; or
- Register Orca's capability-reply handlers again (or after) the deferred attach so Orca's handler is always last; or
- Disable the addon's DA1 handling if an option for it exists (none is exposed today in `IImageAddonOptions`).

## Open questions for the human (optional)
- Is "answer DA1 with the addon's `\x1b[?62;4;9;22c` on the first pane" acceptable, or does Orca need a stable DA1 identity across all panes?

ℹ️ Nitpicks

  • ORCA_IMAGE_PROTOCOL=kitty is exported unconditionally, even when terminalInlineImages is off, so image-capable agents on a disabled client still emit kitty sequences that get silently swallowed (wasted transfer, no garble). The PR documents this as intentional — flagging only so it's a conscious tradeoff, not an oversight.
  • openTerminal's third parameter defaults to false while the setting defaults to true; any future caller that forgets the argument silently disables images.
  • On ConPTY (da1Response: '\x1b[?61;4c') disabling inline images cannot remove the hardcoded ;4, so Windows still advertises Sixel while the addon is detached.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@nwparker

nwparker commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Readiness review/fix loop complete at 65632cbd9b8. Two review rounds, one fix round; both final architecture and reproduction lanes report no remaining proven actionable findings.

  • P0/P1: none validated. No revert.
  • P2, fixed: Kitty unfinished uploads and transmitted blobs bypassed the displayed-image cache budget. A reproducible upstream source patch now bounds both. The 100-upload reproduction dropped from approximately 406 MiB allocated WASM capacity to 8.1 MiB; this is not a physical-RSS claim.
  • P2, fixed: Kitty ACKs were classified as user input, causing viewport/activity handling and remote debounce. The existing shared reply classifier now handles them, with positive and negative regression tests.

Four counsel seats were attempted; three independently agreed on P2 and completed blind peer ratings. Grok could not participate because its weekly limit was exhausted. A later capability-hint concern was rechecked and dropped as actionable: ConPTY's Sixel advertisement predates this PR, and no changed consumer regression from the unconditional environment hint was demonstrated.

Validation: 152 tests pass, full typecheck passes, commit lint/React/format hooks pass, and generated source/CJS/ESM/sourcemaps plus lockfile hashes reproduce from the pinned upstream build. Before/after visual proof demonstrates all three protocols and the live toggle through a real PTY in a macOS folder workspace.

Residual gaps: native Windows/Linux, SSH/network failure/reconnect, mixed-version mobile rendering, and release-scale RSS/throughput were not exercised live. Delayed addon attachment can change DA1 identity; replay suppression still holds and no affected consumer was found. No persisted-state migration or stream opcode was introduced. No remaining proven issue requires a release-blocking action; broader live topology validation remains advisable.

@nwparker

nwparker commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Pushed in 8dacbb23f70.

Follow-up: real SSH + paired runtime validation and image-memory fixes.

  • SSH: disposable Linux sshd/Orca relay, real iTerm2/SIXEL/Kitty output and screenshot pixel assertions. Dropped the live SSH transport, verified the same PTY and shell survived, then verified fresh image output. Also paused/unpaused the target to exercise a silent TCP stall and sent 100 unfinished Kitty uploads.
  • Paired runtime: separate hidden Electron client + isolated runtime host, folder workspace. Restarted the host, verified the same terminal process/PTY survived, waited for actual terminal-input roundtrip, then verified all three protocol images rendered again.
  • Memory: two 12-terminal open/reset/close cycles. Image/blob/decoder state returns to zero after reset; managers disappear after close; forced-GC heap/backing storage stays within test thresholds. These are retained-resource checks, not a promise that total process RSS can never run out of memory.
  • Fixed: late IIP/Kitty/placeholder bitmap completion after cleanup; unbounded Kitty decompression; PNG pixel-limit validation before decode; whole-image canvas enlargement on font zoom. Single-image pixel limit now matches the 32 MB per-pane image setting. Dependency source/bundles/maps/lockfile regenerated and verified.

Known boundary: terminal snapshots do not preserve prior images. Fresh remote image output after reconnection is verified; restoring all historical images is not part of this change. First lazy addon load can also precede parser attachment; boot-time priming as in #19201 is a useful follow-up, not a guarantee by itself.

Cross-reference #19201: same addon/feature, so these implementations should not be merged independently. Its September 7 force-push (efee8751 → 23066c0) rebased the existing three commits; git range-diff shows only xterm patch-hash changes in the lockfile, no new feature-code changes. Its boot-prime/live-addon/web-import-handling work and explicit snapshot limitation are relevant review context. #19512 additionally supplies the settings toggle, lower budgets, and the resource fixes/tests above. Preserve one loader, one addon per pane, and the patched dependency when reconciling them.

SSH after transport recovery:
SSH after transport recovery

Paired runtime after host restart:
Paired runtime after host restart

Measured 12-terminal cycles: retained decoder capacity 102,236,160 bytes while loaded, zero after reset. After the second close cycle: JS heap 39,244,460 bytes (baseline 30,383,976), backing storage 10,374,183 bytes (baseline 10,170,640). All 24 created terminal managers were released. Font zoom also renders without retaining a full enlarged bitmap.

Final protocol regression: evicting an unfinished upload without an image ID no longer injects an unsolicited i=0 reply into the shell.

Validation: 24 focused tests, three real Electron scenarios, additional zoom/memory rerun, full application typecheck, changed-code quality gate, and pinned xterm patch reproduction all passed.

@pullfrog pullfrog 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.

ℹ️ No critical issues — the memory-bounding patch is sound for its primary goal, with two minor rough edges inline.

Reviewed changes

  • Bounded Kitty upload memory — a pnpm-applied source patch caps pending Kitty decoders by count (evicting the oldest and answering ENOMEM) and byte-evicts encoded blobs in KittyImageStorage.
  • Classified Kitty acknowledgements — terminal-query-reply.ts now routes \x1b_Gi=…;OK|E…:…\x1b\\ down the immediate query-reply path so image acks bypass remote input debounce.
  • Added a memory-contract test — xterm-image-memory-contract.test.mjs exercises the installed bundle with abandoned uploads, chunk continuation, and FIFO eviction.
  • Wired the patch into the build — xterm-upstream.json source-patch entry, pnpm patch hash, workspace patchedDependencies, and regeneration docs.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

ℹ️ No new issues in this commit — the decode/cleanup hardening is sound and well-tested. The earlier DA1-ordering and Kitty memory-patch findings are unchanged by this delta and remain open.

Reviewed changes

  • Bounded decompression — _decompress now streams through DecompressionStream and rejects output beyond min(kittySizeLimit, pixelLimit*4, storageLimit*1e6), closing the decompression-bomb vector.
  • Cancelled stale async decodes — generation counters in IIPHandler and KittyGraphicsHandler close bitmaps that finish after reset()/dispose().
  • Validated PNG dimensions — imageType() rejects oversize/invalid PNGs before native createImageBitmap.
  • Released handler resources on dispose — ImageAddon.dispose() resets every handler, and the placeholder bitmap is closed when replaced.
  • Fixed scaled rendering — ImageRenderer tiles from actualCellSize and skips full-enlarged zoom canvases.
  • Guarded the eviction reply — ENOMEM is now sent only when the evicted upload carried an id.
  • Added contract and e2e coverage — lifecycle/resize/memory contract tests plus memory, paired-runtime-restart, and SSH drop/stall/flood e2e specs.

Pullfrog  | Fix it ➔ | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 9e2e3d12-d44f-4841-a1e7-dd5670635e09

📥 Commits

Reviewing files that changed from the base of the PR and between b47ed52f4ece76837cd4de17eeb359d31915202f and 8dacbb23f70cea6d6c575b08f8ccdc9e0972bcae.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • config/patches/@[email protected]
  • config/patches/xterm-src/@[email protected]
  • config/patches/xterm-upstream.json
  • config/scripts/xterm-image-lifecycle-contract.test.mjs
  • config/scripts/xterm-image-memory-contract.test.mjs
  • config/scripts/xterm-image-resize-contract.test.mjs
  • docs/reference/xterm-patch-regeneration.md
  • pnpm-workspace.yaml
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-inline-images.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts
  • src/shared/terminal-query-reply.test.ts
  • src/shared/terminal-query-reply.ts
  • tests/e2e/helpers/terminal-inline-image-proof.ts
  • tests/e2e/terminal-inline-images-memory.spec.ts
  • tests/e2e/terminal-inline-images-paired-runtime.spec.ts
  • tests/e2e/terminal-inline-images-ssh.spec.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/i18n/locales/en.json

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from 8dacbb2 to d95e978 Compare September 8, 2026 05:16
@nwparker

nwparker commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Rebased onto main at 253fa43256a0; resolved the lockfile conflicts using current main's xterm patch hash and retaining the image-addon patch. git range-diff confirms the rebased commits differ only in lockfile hashes/context.

Addressed review feedback in d95e9784ca2:

  • DA1 ordering: re-register the existing Orca DA1 owner after image-addon attachment, including deferred loading and toggling back on. This preserves the existing replay guard and live capability setting without relying on boot timing. The real-addon regression test fails with the old ordering and passes with the fix.
  • Failed activation: dispose the partially activated addon before dropping its reference; cover cleanup and a later successful retry.
  • SSH environment precedence: assign the image protocol after renderer/augmenter merges, matching local/daemon behavior; test both override sources.
  • Zoom test: require non-null addon state before and after zoom before comparing storage.
  • FIFO eviction: documented that byte-budget eviction may remove visible images. Keeping visible payloads indefinitely would defeat the memory bound.

The two lower-storage-budget comments concern configurations Orca does not expose: its fixed 32 MB storage budget exceeds both the 8 MiB sequence limit and one decoder's reserved capacity. No unsupported configuration mode was added to this feature.

Validation: 81 focused tests, full application typecheck, changed-code quality checks, frozen install, and pinned xterm patch reproduction pass. Rebuilt Electron/CLI/relay against current main and reran real SSH drop/stall/zoom and paired-host restart rendering checks.

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from d95e978 to 2ff3fc5 Compare September 8, 2026 09:38
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 9ccd1ae5-b0f3-4b7c-a5a4-e5f1bed91365

📥 Commits

Reviewing files that changed from the base of the PR and between 12f53da and 2ff3fc5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (65)
  • config/patches/@[email protected]
  • config/patches/xterm-src/@[email protected]
  • config/patches/xterm-upstream.json
  • config/scripts/renderer-boot-graph.mjs
  • config/scripts/xterm-image-lifecycle-contract.test.mjs
  • config/scripts/xterm-image-memory-contract.test.mjs
  • config/scripts/xterm-image-resize-contract.test.mjs
  • docs/reference/xterm-patch-regeneration.md
  • package.json
  • pnpm-workspace.yaml
  • src/main/daemon/pty-subprocess/spawn-environment.ts
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/main/providers/local-pty-spawn-environment.ts
  • src/main/pty/wsl-orca-env.test.ts
  • src/main/pty/wsl-orca-env.ts
  • src/relay/pty-handler-spawn-environment.test.ts
  • src/relay/pty-handler.ts
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.test.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.test.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.ts
  • src/renderer/src/components/terminal-pane/terminal-cursor-inactive-style.test.ts
  • src/renderer/src/components/terminal-pane/terminal-inline-image-da1.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/components/terminal-pane/terminal-view-attributes-publisher.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-container-listener-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.test.ts
  • src/renderer/src/lib/pane-manager/pane-drop-no-op.test.ts
  • src/renderer/src/lib/pane-manager/pane-fit-resize-observer.test.ts
  • src/renderer/src/lib/pane-manager/pane-initial-fit-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-manager-pane-creation.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-manager.ts
  • src/renderer/src/lib/pane-manager/pane-reveal-repaint.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.ts
  • src/renderer/src/lib/pane-manager/pane-split-scroll.test.ts
  • src/renderer/src/lib/pane-manager/pane-terminal-gpu-acceleration.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts
  • src/renderer/src/lib/pane-manager/pane-tree-reparent-frame.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.test.ts
  • src/renderer/src/lib/pane-manager/terminal-da1-ownership.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-key-retention.test.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
  • src/shared/terminal-image-protocol.ts
  • src/shared/terminal-query-reply.test.ts
  • src/shared/terminal-query-reply.ts
  • tests/e2e/helpers/terminal-inline-image-proof.ts
  • tests/e2e/terminal-inline-images-memory.spec.ts
  • tests/e2e/terminal-inline-images-paired-runtime.spec.ts
  • tests/e2e/terminal-inline-images-ssh.spec.ts
🚧 Files skipped from review as they are similar to previous changes (55)
  • src/renderer/src/lib/pane-manager/pane-container-listener-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-renderer.test.ts
  • src/renderer/src/components/settings/setting-labels.ts
  • src/renderer/src/lib/pane-manager/terminal-scroll-intent-key-retention.test.ts
  • src/renderer/src/lib/pane-manager/pane-dom-creation.ts
  • src/shared/default-global-settings.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • config/scripts/renderer-boot-graph.mjs
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-fit-resize-observer.test.ts
  • src/main/daemon/pty-subprocess/spawn-environment.ts
  • src/shared/terminal-query-reply.test.ts
  • src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts
  • pnpm-workspace.yaml
  • src/renderer/src/lib/pane-manager/pane-tree-ops.test.ts
  • package.json
  • src/main/pty/wsl-orca-env.ts
  • src/renderer/src/lib/pane-manager/pane-split-scroll.test.ts
  • src/renderer/src/lib/pane-manager/pane-manager-pane-creation.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.ts
  • src/renderer/src/lib/pane-manager/pane-reveal-repaint.test.ts
  • src/shared/terminal-query-reply.ts
  • src/main/providers/local-pty-spawn-environment.ts
  • src/renderer/src/lib/pane-manager/pane-drop-no-op.test.ts
  • config/scripts/xterm-image-resize-contract.test.mjs
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/renderer/src/lib/pane-manager/pane-tree-reparent-frame.test.ts
  • src/main/pty/wsl-orca-env.test.ts
  • src/renderer/src/lib/pane-manager/pane-manager.ts
  • config/patches/xterm-upstream.json
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/lib/pane-manager/pane-terminal-gpu-acceleration.test.ts
  • src/shared/terminal-image-protocol.ts
  • tests/e2e/helpers/terminal-inline-image-proof.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • config/scripts/xterm-image-lifecycle-contract.test.mjs
  • src/shared/global-settings-types.ts
  • src/renderer/src/lib/pane-manager/pane-initial-fit-lifecycle.test.ts
  • tests/e2e/terminal-inline-images-memory.spec.ts
  • src/relay/pty-handler.ts
  • src/main/ipc/pty-spawn-env-terminal-basics.test.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-context-recovery.test.ts
  • tests/e2e/terminal-inline-images-paired-runtime.spec.ts
  • src/renderer/src/lib/pane-manager/pane-drag-reorder.test.ts
  • src/renderer/src/components/terminal-pane/terminal-capability-replies.test.ts
  • src/renderer/src/lib/pane-manager/pane-webgl-refresh-lifecycle.test.ts
  • tests/e2e/terminal-inline-images-ssh.spec.ts
  • config/patches/xterm-src/@[email protected]

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • DA1 authority re-registration — new terminal-da1-ownership.ts (registerTerminalDa1Owner / refreshTerminalDa1Owner) stores a per-terminal refresh and attachInlineImages re-registers Orca's c handler after the addon attaches, so Orca's \x1b[?1;2;4c wins on the first image-enabled pane instead of the addon's \x1b[?62;4;9;22c.
  • Sixel gated on real attachment — terminalRendersInlineImages (a WeakSet<Terminal>) makes sixelSupported report true only once the addon is actually attached, not while its chunk loads or after it fails.
  • End-to-end DA1 test — terminal-inline-image-da1.test.ts activates a real addon on both primed and deferred paths and asserts the final reply, pinning the previously-untested ordering.
  • Kitty eviction rework — KittyImageStorage.storeImage now evicts unplaced payloads before displayed ones and always stores the incoming image, eliminating both the false-OK-after-drop and visible-image-eviction rough edges.
  • PNG dimension sign fix — imageType() dimensions now require > 0, closing the signed-shift bypass where IHDR widths ≥ 0x80000000 read negative and passed the pixel-limit check.
  • Loader-drain hardening — per-pane try/catch in the deferred onLoaded drain so one failed attach does not strand the rest.
  • Unified setting read — resolveTerminalInlineImagesEnabled() replaces the mixed ?? true / !== false call sites.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Shared lazy addon loader — new terminal-lazy-addon-loader.ts (createLazyXtermAddonLoader) memoizes the dynamic import, exposes the resolved constructor synchronously to later panes, and adds an onFailed latch plus a rearm recovery boundary.
  • Image loader delegation — terminal-image-addon-loader.ts now routes prime / getConstructor / setHandlers through the shared loader; primeTerminalImageAddon keeps its 3-attempt cap and clears the memo on error so a later pane can retry.
  • WebGL loader delegation — terminal-webgl-addon-loader.ts drops its duplicate inline memo/attempt logic and uses the shared loader, preserving setTerminalWebglAddonLoadHandlers / primeTerminalWebglAddon / rearmTerminalWebglAddonLoad with the same exported surface.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog 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.

✅ No new issues found.

Reviewed changes

  • Named addon flags — openTerminal replaces its two adjacent optional positional booleans with a named { ligatures, inlineImages } options object, removing the silent-swap footgun flagged in earlier feedback; both callers (pane-manager-pane-creation.ts, pane-split-close.ts) and the wiring test were updated.
  • Pinned image limits — the addon-options test now asserts the exact pixelLimit (8_000_000) and iipSizeLimit / kittySizeLimit (8 * 1024 * 1024) values instead of the looser formula-derived check.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
config/patches/xterm-src/@[email protected] (1)

175-193: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Reject uploads that exceed the storage budget

With storageLimit: 0.5 and the default kittySizeLimit: 33554432, decoderCapacity is about 44.9 MB. The Math.max(1, ...) call still permits one unfinished Base64Decoder, whose initial buffer alone is 4 MB. Reject the transmission before allocation when the decoder capacity exceeds the effective storage budget.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: bb6ec7f9-7907-4e75-9cd1-7c3bae74a67c

📥 Commits

Reviewing files that changed from the base of the PR and between 2ff3fc5 and 28a175a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (24)
  • config/patches/@[email protected]
  • config/patches/xterm-src/@[email protected]
  • config/scripts/run-ssh-docker-e2e.mjs
  • src/renderer/src/components/settings/TerminalRenderingSection.tsx
  • src/renderer/src/components/terminal-pane/pty-connection/pty-input-recovery.ts
  • src/renderer/src/components/terminal-pane/terminal-appearance.ts
  • src/renderer/src/components/terminal-pane/terminal-inline-image-da1.test.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/lib/pane-manager/pane-inline-images.test.ts
  • src/renderer/src/lib/pane-manager/pane-inline-images.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-lifecycle.ts
  • src/renderer/src/lib/pane-manager/pane-manager-pane-creation.ts
  • src/renderer/src/lib/pane-manager/pane-split-close.ts
  • src/renderer/src/lib/pane-manager/terminal-da1-ownership.ts
  • src/renderer/src/lib/pane-manager/terminal-image-addon-loader.ts
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts
  • src/renderer/src/lib/pane-manager/terminal-lazy-addon-loader.ts
  • src/renderer/src/lib/pane-manager/terminal-webgl-addon-loader.ts
  • src/shared/terminal-inline-images-settings.ts
  • tests/e2e/helpers/terminal-inline-image-proof.ts
  • tests/e2e/terminal-inline-images-memory.spec.ts
  • tests/e2e/terminal-inline-images-ssh.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/lib/pane-manager/terminal-inline-image-options.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.

@nwparker

nwparker commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Re-reviewed the pushed updates at 28a175a against the readiness checklist, including affected appearance/WebGL consumers. No new runtime defect proven; this is not an OOM guarantee or a complete platform/network certification.

Fresh validation:

  • 930 tests passed (one skipped), plus 42 CI ownership contract tests.
  • Full app typecheck, frozen install, patch regeneration, changed code quality, localization catalog, and fresh app/relay/CLI builds passed.
  • Hidden Electron: all three live specs passed (55s): Docker Linux SSH drop/stall/flood/zoom, paired host restart on the same PTY in a folder workspace, and 12 terminals across two reset/close cycles.
  • Reset cleared all tracked images, Blobs, and decoders. Backing storage: 10.18 MB baseline → 10.19 MB after second close. This measures cleanup, not process RSS.
  • Signed/zero PNG dimension probes rejected before native decode.

The other agent caught real gaps in my previous review: DA1 ordering was tested without enforcing actual decoder readiness; byte caps were checked without preserving visible images ahead of unused uploads; PNG tests missed signed parser boundaries; affected appearance mocks and SSH CI ownership were omitted; zoom/backing-storage assertions and test ordering were too weak. My earlier completion language was broader than that evidence justified.

Shared loader/named flags are useful refactors. The commit's null-setting rationale is inaccurate for boolean/null/undefined (?? true and !== false agree); localization cleanup fixes inherited main drift.

Memory remains additive across panes, with transient/native/GPU allocations outside simple pool accounting. Neither 32 MB nor the approximate 98 MB comment is a total-memory ceiling. Windows/WSL/Windows SSH, mobile, physical sleep/DNS faults, and a long-duration saturation soak were not exercised here. Historical images still are not serialized/replayed.

Fresh rendered proof after SSH recovery, flooding/reset, and font zoom (IIP red, Sixel green, Kitty blue):

after-font-zoom.png

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from 28a175a to 3c376f9 Compare September 18, 2026 09:29

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Preserve the forced image protocol after deletions. · pty-handler.ts:820-843

src/relay/pty-handler.ts:820-843
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Preserve the forced image protocol after deletions.

sanitizeEnvToDelete accepts ORCA_IMAGE_PROTOCOL, and pty.spawn passes it to buildSpawnEnv. The deletion loop can therefore remove the forced kitty value. Image-capable tools may miss the relay’s protocol hint and not enable the expected encoder.

Move the ORCA_IMAGE_PROTOCOL assignment after the deletion loop. buildSpawnEnv owns the final environment for both spawn and revive.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 09762c27-7269-4ece-8daf-98b9a40cbb34

📥 Commits

Reviewing files that changed from the base of the PR and between 28a175a and 3c376f9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • config/scripts/run-ssh-docker-e2e.mjs
  • package.json
  • pnpm-workspace.yaml
  • src/relay/pty-handler-spawn-environment.test.ts
  • src/relay/pty-handler.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/pane-manager/pane-lifecycle.test.ts
  • src/renderer/src/lib/pane-manager/pane-manager-types.ts
  • src/shared/default-global-settings.ts
  • src/shared/global-settings-types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/i18n/locales/en.json
  • pnpm-workspace.yaml

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

@nwparker

Copy link
Copy Markdown
Contributor

Rebased and pushed the PR onto current origin/main.

  • New head: 7705143cc32419febd33cbba457ca6b32758800e
  • Base: 593141590e73bd971c1678777bed56f48dbbf6f4
  • Local branch: 10 PR commits ahead, 0 behind
  • Local validation: 956 tests passed (1 skipped), full typecheck passed, changed-code quality passed with 0 findings, patch regeneration passed, targeted SSH/paired-runtime/memory proof remains green from the prior head.
  • Provider checks on this head: static analysis, typecheck, patch sync, compatibility, all 8 test shards, Linux package, native smoke, WSL, IME, and Pullfrog passed.

One provider failure is unrelated to this PR: Windows packaging fails while installing the current mobile/patches/[email protected] (ERR_PNPM_INVALID_PATCH: invalid char in unquoted filename). The PR does not touch that patch. Changed E2E and SSH watcher jobs are still running without a result.

The memory caveat remains: image allocations are bounded per pane and cleaned up on reset/close, but there is no process-wide cross-pane governor or absolute RSS/OOM guarantee.

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from 7705143 to b90a864 Compare September 18, 2026 10:47
@nwparker

Copy link
Copy Markdown
Contributor

Rebased again onto the latest origin/main while CI was running, then pushed:

  • Current head: b90a8645806
  • Current base: latest main at rebase time
  • Branch is 12 commits ahead and 0 behind
  • Local verification on this exact head: 956 tests passed (1 skipped), full typecheck passed, xterm patch regeneration passed.
  • Current provider results: static analysis, typecheck, all test shards, Windows/Linux package, WSL, IME, compatibility, native smoke, Pullfrog, verify, and patch sync are passing.
  • Only changed E2E and SSH Docker watcher jobs remain in progress; no failure reported.

The feature remains bounded per pane with reset/close cleanup proof. It does not provide a process-wide image-memory governor or absolute RSS/OOM guarantee; that remains a documented residual risk rather than an unproven release blocker.

@MikhailGA

Copy link
Copy Markdown

Data point from a now-closed duplicate (#21430), in case it helps: verified on macOS arm64 (WebGL renderer) that oh-my-pi running inside Orca with PI_FORCE_IMAGE_PROTOCOL=iterm2 shows images inline once @xterm/[email protected] is loaded — which covers the OMP report in #11668. Also confirmed that beta.301 renders nothing on xterm beta.303 (BufferLine.getExtended is beta.304+), so the beta.300 pin matters until xterm is bumped.

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from b90a864 to 280b4df Compare September 18, 2026 11:10
@nwparker

Copy link
Copy Markdown
Contributor

Rebased onto the latest origin/main and force-pushed as 280b4df5d58.

Local verification after the rebase:

  • inline-image lifecycle/DA1 tests: 45 passed
  • xterm image lifecycle/memory/resize contracts: 20 passed
  • full typecheck passed
  • targeted oxlint passed

The fresh PR Checks and computer-use E2E workflows are queued/running for the rebased head.

@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from 280b4df to e71ad7d Compare September 18, 2026 11:44
@nwparker

Copy link
Copy Markdown
Contributor

origin/main advanced during the prior CI run, so I rebased again onto the current base and force-pushed final head e71ad7d5c61.

Post-rebase verification:

  • inline-image lifecycle, DA1, xterm image lifecycle/memory/resize contracts: 65 passed
  • full typecheck passed

The previous run was left untouched while active; a fresh CI cycle is now running for this final rebased head.

…limits

Two adjacent optional booleans could be swapped without a type error once
inline images added the second one.
…ring dependency

storageLimit:32 reads like the pane's budget but keys three pools — decoded
pixels, retained encoded Kitty blobs, and pending WASM decoders — so the worst
case is ~98 MB per pane with no cross-pane governor. Say so at the constant.

pane-inline-images.test.ts's deferred case needed to run first; it now takes a
fresh module instead, and the rest prime in beforeAll. Verified by running the
file with that test moved last.
@nwparker
nwparker force-pushed the OrcaWin/np-inline-xterm-images branch from 4f7aa92 to 17a7868 Compare September 18, 2026 14:02
@nwparker
nwparker merged commit 0907308 into main Sep 18, 2026
41 checks passed
@nwparker
nwparker deleted the OrcaWin/np-inline-xterm-images branch September 18, 2026 23:32
petrroll pushed a commit to earendil-works/pi that referenced this pull request Oct 29, 2026
## Summary

Treat `TERM_PROGRAM=Orca` as Kitty-image capable in `pi-tui`'s terminal
capability detection, so image components render inline instead of
falling back to text when running inside Orca.

- Recognize Orca as supporting Kitty inline images, true color, and OSC
8 hyperlinks.
- Preserve the existing tmux and screen precedence guards.
- Gate images on Orca's capability advertisement: require both
`TERM_PROGRAM=Orca` and Orca's `ORCA_IMAGE_PROTOCOL=kitty` signal before
enabling Kitty output, so existing Orca releases that do not yet
advertise image support safely keep the text fallback.
- Add a regression test and the package/CLI changesets.

## Related

- Requested by maintainer approval in
[#7357](#7357)
(lgtm).
- Depends on the Orca-side capability advertisement, which has landed:
[stablyai/orca#19512](stablyai/orca#19512)
(merged 2026-09-18, `09073086a8`) exports `ORCA_IMAGE_PROTOCOL=kitty` on
the daemon, local, and relay PTY paths, and forwards it across the WSL
boundary. Supersedes
[stablyai/orca#11706](stablyai/orca#11706),
which was closed in favor of #19512.

## Testing

- `pnpm --filter @moonshot-ai/pi-tui test` — focused regression suite
passes.
- `pnpm --filter @moonshot-ai/pi-tui typecheck` — passes.
subimpact pushed a commit to subimpact/e that referenced this pull request Oct 31, 2026
…s#9329)

## Summary

Treat `TERM_PROGRAM=Orca` as Kitty-image capable in `pi-tui`'s terminal
capability detection, so image components render inline instead of
falling back to text when running inside Orca.

- Recognize Orca as supporting Kitty inline images, true color, and OSC
8 hyperlinks.
- Preserve the existing tmux and screen precedence guards.
- Gate images on Orca's capability advertisement: require both
`TERM_PROGRAM=Orca` and Orca's `ORCA_IMAGE_PROTOCOL=kitty` signal before
enabling Kitty output, so existing Orca releases that do not yet
advertise image support safely keep the text fallback.
- Add a regression test and the package/CLI changesets.

## Related

- Requested by maintainer approval in
[earendil-works#7357](earendil-works#7357)
(lgtm).
- Depends on the Orca-side capability advertisement, which has landed:
[stablyai/orca#19512](stablyai/orca#19512)
(merged 2026-09-18, `09073086a8`) exports `ORCA_IMAGE_PROTOCOL=kitty` on
the daemon, local, and relay PTY paths, and forwards it across the WSL
boundary. Supersedes
[stablyai/orca#11706](stablyai/orca#11706),
which was closed in favor of #19512.

## Testing

- `pnpm --filter @moonshot-ai/pi-tui test` — focused regression suite
passes.
- `pnpm --filter @moonshot-ai/pi-tui typecheck` — passes.

(cherry picked from commit f09d01b)
@s546126 s546126 mentioned this pull request Nov 4, 2026
8 tasks
oskarfreye pushed a commit to draht-dev/draht that referenced this pull request Nov 4, 2026
…endil-works/pi#9329)

## Summary

Treat `TERM_PROGRAM=Orca` as Kitty-image capable in `pi-tui`'s terminal
capability detection, so image components render inline instead of
falling back to text when running inside Orca.

- Recognize Orca as supporting Kitty inline images, true color, and OSC
8 hyperlinks.
- Preserve the existing tmux and screen precedence guards.
- Gate images on Orca's capability advertisement: require both
`TERM_PROGRAM=Orca` and Orca's `ORCA_IMAGE_PROTOCOL=kitty` signal before
enabling Kitty output, so existing Orca releases that do not yet
advertise image support safely keep the text fallback.
- Add a regression test and the package/CLI changesets.

## Related

- Requested by maintainer approval in
[earendil-works/pi#7357](earendil-works/pi#7357)
(lgtm).
- Depends on the Orca-side capability advertisement, which has landed:
[stablyai/orca#19512](stablyai/orca#19512)
(merged 2026-09-18, `09073086a8`) exports `ORCA_IMAGE_PROTOCOL=kitty` on
the daemon, local, and relay PTY paths, and forwards it across the WSL
boundary. Supersedes
[stablyai/orca#11706](stablyai/orca#11706),
which was closed in favor of badlogic/pi-mono#19512.

## Testing

- `pnpm --filter @moonshot-ai/pi-tui test` — focused regression suite
passes.
- `pnpm --filter @moonshot-ai/pi-tui typecheck` — passes.

(cherry picked from commit f09d01b85e0384647fcab6779d35ab9dabe04be3)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
sherocktong pushed a commit to roam-agent/roam that referenced this pull request Nov 12, 2026
…s#9329)

## Summary

Treat `TERM_PROGRAM=Orca` as Kitty-image capable in `pi-tui`'s terminal
capability detection, so image components render inline instead of
falling back to text when running inside Orca.

- Recognize Orca as supporting Kitty inline images, true color, and OSC
8 hyperlinks.
- Preserve the existing tmux and screen precedence guards.
- Gate images on Orca's capability advertisement: require both
`TERM_PROGRAM=Orca` and Orca's `ORCA_IMAGE_PROTOCOL=kitty` signal before
enabling Kitty output, so existing Orca releases that do not yet
advertise image support safely keep the text fallback.
- Add a regression test and the package/CLI changesets.

## Related

- Requested by maintainer approval in
[earendil-works#7357](earendil-works#7357)
(lgtm).
- Depends on the Orca-side capability advertisement, which has landed:
[stablyai/orca#19512](stablyai/orca#19512)
(merged 2026-09-18, `09073086a8`) exports `ORCA_IMAGE_PROTOCOL=kitty` on
the daemon, local, and relay PTY paths, and forwards it across the WSL
boundary. Supersedes
[stablyai/orca#11706](stablyai/orca#11706),
which was closed in favor of #19512.

## Testing

- `pnpm --filter @moonshot-ai/pi-tui test` — focused regression suite
passes.
- `pnpm --filter @moonshot-ai/pi-tui typecheck` — passes.
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.

3 participants