Skip to content

Drop Terminal feedback for retired views instead of ending the session - #49

Closed
jsegaran wants to merge 2 commits into
mainfrom
fix/terminal-stale-view-feedback
Closed

jsegaran wants to merge 2 commits into
mainfrom
fix/terminal-stale-view-feedback

Conversation

@jsegaran

@jsegaran jsegaran commented Oct 7, 2026 •

Copy link
Copy Markdown

A Terminal view retires as soon as its terminal closes or exits. The client can still send FRAME_ACK (or INPUT/MOUSE/WHEEL/WHEEL_AT) for that view if it hasn't seen the retirement yet. update_terminal_feedback treated the unknown view_id as a protocol error, so the dispatch loop ended the whole native session:

native YAS session exit: reliable frame handler failed: class=Event family=16 kind=34 request_id=None

(family 16 / kind 34 = yas.terminal FRAME_ACK). Any other request in flight on that connection then fails with write EPIPE / read ECONNRESET.

docs/design/yas.md already says "Stale feedback is ignored", and Surfaces already tolerate this via retired_views. Now a missing view returns None and the event is dropped. Malformed payloads and out-of-window feedback on live views are still errors.

Impact on Indent sandboxes. Every short-lived bash command on a Yas box is a terminal that exits and gets closed, so parallel commands hit this race:

  • Prod ComputerRpcRemoteError over 7d: write EPIPE 215 calls / 178 sessions / 13 orgs, and read ECONNRESET 63 / 57 / 5.
  • All of them are on remoting_runtime = yas computers. It started with the Yas-for-all rollout on 2026-09-30.
  • The affected command often still ran; only its result was lost.

Repro. neo's real BlitShell runs 20 concurrent bash.run commands (300 lines of output each) against a private server:

server failed / total
yas 0.3.0 (prod) 14/200
main 5/200
this branch 0/400 (×4 runs)

Every failure in the stock runs matches the exit line above.

Test. terminal_feedback_for_a_closed_view_does_not_end_the_session acks a frame after CLOSE, then checks the session still answers a request. Without the fix it fails with the same class=Event family=16 kind=34 exit.

With this alone, the SDK's fire-and-forget setFocus on a retired view now resolves to an unhandled NOT_FOUND more often, and Node exits on that. Ship it together with #50.

View in Indent View in Slack
Tag @indent to continue the conversation here.

A Terminal view retires when its terminal closes or exits. FRAME_ACK,
INPUT, MOUSE, WHEEL, and WHEEL_AT the client sent before it saw that still
name the view, and update_terminal_feedback treated the unknown view_id as a
protocol error. The dispatch loop then ended the whole native session
("reliable frame handler failed: class=Event family=16 kind=34"), so every
other in-flight request on the connection failed with EPIPE/ECONNRESET.

The spec already says stale feedback is ignored. Return None for a missing
view and drop the event.
@indent

indent Bot commented Oct 7, 2026

Copy link
Copy Markdown

Superseded by yas-run#100 (opened upstream).

@indent indent Bot closed this Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Coverage

Crate Lines Functions Regions
alacritty-driver 85.6% (1081/1263) 89.4% (84/94) 89.3% (1746/1955)
browser 25.5% (309/1212) 30.4% (34/112) 27.7% (605/2183)
cli 32.4% (6661/20544) 33.6% (615/1831) 33.4% (9793/29330)
client 66.9% (4968/7425) 68.1% (627/921) 65.1% (6423/9873)
composite-transport 96.3% (526/546) 98.4% (60/61) 96.2% (884/919)
compositor 54.9% (11397/20763) 66.0% (832/1261) 54.7% (15782/28844)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 62.9% (798/1268) 50.9% (82/161) 57.7% (1038/1799)
fonts 77.3% (1257/1626) 82.7% (129/156) 78.9% (2424/3071)
fssync 86.0% (1609/1872) 85.8% (182/212) 87.0% (2833/3255)
git 70.4% (4462/6334) 68.5% (337/492) 67.2% (6311/9386)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 78.7% (3573/4542) 80.8% (336/416) 76.7% (5408/7054)
proxy 63.3% (1899/3000) 56.6% (184/325) 63.5% (2929/4613)
runtime-dir 93.6% (117/125) 100.0% (14/14) 94.8% (218/230)
sd-notify 73.9% (68/92) 100.0% (6/6) 83.2% (109/131)
server 70.8% (84536/119432) 73.3% (6135/8370) 68.8% (113180/164575)
ssh 67.2% (708/1054) 75.9% (85/112) 67.2% (1105/1645)
terminal-model 49.9% (314/629) 62.3% (38/61) 50.3% (505/1004)
uplink 94.2% (582/618) 92.6% (50/54) 93.1% (1062/1141)
webrtc-forwarder 33.6% (1321/3932) 44.9% (146/325) 36.0% (2279/6336)
webserver 80.7% (1490/1846) 81.1% (193/238) 83.2% (2551/3067)
website 35.1% (355/1012) 34.4% (53/154) 35.8% (607/1694)
xtask 0.0% (0/5149) 0.0% (0/131) 0.0% (0/9157)
yas 88.9% (28010/31522) 93.9% (2146/2286) 84.0% (43994/52388)
Total 66.5% (167330/251645) 69.5% (13249/19070) 64.9% (236932/365333)

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