Files
orca/tests
Jinwoo Hong f27ef42aa0 fix(runtime): build the host terminal model when a phone opens an idle terminal (#25780)
* fix(runtime): hydrate the host model on a phone subscribe to an idle PTY

After a relaunch the reattach leaves the host model empty and an idle TUI
never paints the byte that hydrates it. A phone subscribing then got the
hidden desktop pane's screen at desktop size, missed its viewport on every
resubscribe, and gave up with "Couldn't fit the terminal to this screen".

The subscribe now runs the existing renderer hydrate after the phone fit,
so the pane's screen is reflowed onto the PTY grid, and serves the phone
from that model instead of adopting the pane's desktop-sized screen.

Claude-Session: lane-host-hydrate

* test(e2e): phone subscribe to an idle relaunched terminal fits the phone

Relaunches the app over a live daemon PTY running an idle program, hides
its pane behind another tab, and subscribes as a mobile client at 47x40.
Before the host-side hydrate the first snapshot came back at the hidden
pane's size (135x60 here).

Claude-Session: lane-host-hydrate

* fix(runtime): join a renderer seed the resize repaint already started

A TUI answering the phone fit's SIGWINCH can deliver a byte before the
subscribe reaches its hydrate. That byte runs the same renderer seed, so
the subscribe saw "already hydrating", fell back to adopting the pane's
desktop-sized screen and seeded the model at desktop size again. Keep the
model's renderer seed beside it so the subscribe joins that result.

Claude-Session: lane-host-hydrate

* fix(runtime): join the resize repaint's seed without per-PTY seed state

Replaces the rendererSeedsByPtyId map with a check over existing state. If
an on-data seed was already considered before the subscribe's hydrate, the
subscribe awaits the model's write chain and reads the outcome from the
hydration state, the installed model and the provider-preferred flag.

Claude-Session: lane-host-hydrate

* fix(runtime): serve on-demand tab mounts to the phone from the PTY-grid model

A phone opening a tab not mounted since relaunch makes the desktop mount
it. The freshly mounted pane is hidden, so it answers at desktop size, and
both the mount-wait snapshot and the late renderer-mount-ready recovery
published that raw screen and seeded the model at that size.

The recovery seed now reflows the model onto the PTY grid, and both sites
publish the model's snapshot through one shared step, so the phone is only
served from the host model. A late recovery whose model moved past the
renderer high-water while it was rebuilt is still withheld.

Claude-Session: lane-host-hydrate

* fix(runtime): seed the model when a buffer read falls back to the pane

With no host model, a terminal buffer read answered with the desktop
pane's screen at the pane's size. The phone's resize restream and
pending-output recovery read through it, so a hidden pane could still
hand the phone a desktop-sized screen.

The fallback now seeds the model from that screen onto the PTY grid and
answers from the model, unless output landed during the read. The
desktop's own hidden-output recovery keeps the raw renderer fallback.

Claude-Session: lane-host-hydrate

* revert: drop the race join, on-demand mount and buffer-fallback rounds

Reverts 09f37efd0d, 5782bb5888, 67701cf87d and 944b57b8d8. The resize
repaint race and the on-demand tab mount are unreachable in production
(the PTY resize is fire-and-forget, and a tab mounted after the phone fit
replays the phone-grid daemon snapshot), and the buffer fallback only
reaches the phone with no model, which the subscribe hydrate now seeds.

Claude-Session: lane-host-hydrate

* fix(runtime): land the recovery seed on the PTY grid

A renderer recovery seed built the host model at the pane's size, which a
hidden desktop pane keeps after a phone fit resized the PTY. Reflow the
seeded model onto the PTY grid before replaying trailing output, and call
maybeHydrateHeadlessFromRenderer directly from the subscribe instead of
through a wrapper.

Claude-Session: lane-host-hydrate

* test(e2e): retry terminal.list while the new tab's PTY binds
2026-10-06 14:09:43 -04:00
..