Skip to content

Settle fire-and-forget Terminal requests in the native workspace connection - #50

Closed
jsegaran wants to merge 2 commits into
mainfrom
fix/sdk-terminal-fire-and-forget-rejections
Closed

jsegaran wants to merge 2 commits into
mainfrom
fix/sdk-terminal-fire-and-forget-rejections

Conversation

@jsegaran

@jsegaran jsegaran commented Oct 7, 2026

Copy link
Copy Markdown

Several requests in YasNativeWorkspaceConnection are fire-and-forget: restartSession, killSession, focusSession, resizeSession, the scroll request, and the focus refresh after OPEN_VIEW. They dropped the request promise with void. When one races its terminal's exit or close, the server answers NOT_FOUND; when the link drops, it rejects with YasDisconnectedError. Nothing handled either rejection, so a Node embedder hit an unhandled rejection and exited.

Indent's computer client exits the process on unhandled rejections. Over 7d in prod, observability.boot.unhandled_rejection with YasResultError: YAS request failed with status 3 killed indent-computer on 15 sandboxes. Each crash restarts the client along with Chrome and background processes.

settleTerminalRequest drops those two expected failures and console.errors anything else, matching the existing .catch(console.error) pattern in this file.

Verified with neo's BlitShell running 20 concurrent bash.run commands against the #49 server. Without this change, a stale setFocus (focusSession ← recomputeSnapshot ← applyTerminalCatalog) produced an unhandled NOT_FOUND about once per 400 commands and crashed the process. With it: 1200/1200 OK and no unhandled rejections. Typecheck passes.

No unit test: a vitest that leaves the rejection unhandled still passes under this config, so it can't pin the contract.

Pairs with #49; neo needs both in the same release.

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

…ection

restartSession, killSession, focusSession, resizeSession, scroll and the
focus refresh after OPEN_VIEW dropped their request promises with void. A
request that races the terminal's exit or close comes back NOT_FOUND, and a
dropped link rejects with YasDisconnectedError. Nothing handled either, so a
Node embedder saw an unhandled rejection and exited.
@indent

indent Bot commented Oct 7, 2026

Copy link
Copy Markdown

Superseded by yas-run#101 (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% (9789/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% (11396/20763) 65.9% (831/1261) 54.7% (15780/28844)
desktop 78.4% (4460/5691) 71.6% (393/549) 75.1% (6211/8267)
edge 62.8% (796/1268) 50.9% (82/161) 57.4% (1033/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.3% (6313/9386)
guest 67.3% (6829/10148) 67.0% (488/728) 66.6% (8935/13416)
lsp 78.6% (3571/4542) 80.8% (336/416) 76.6% (5405/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 72.8% (67/92) 100.0% (6/6) 82.4% (108/131)
server 70.8% (84421/119305) 73.3% (6132/8366) 68.8% (113084/164459)
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% (28011/31522) 93.9% (2146/2286) 84.0% (43995/52388)
Total 66.5% (167210/251518) 69.5% (13245/19066) 64.8% (236824/365217)

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