Files
orca/src/shared
Neil 6aaf0e683d fix(terminal): a paired-server file link opens in the workspace it was clicked in (#38072)
* fix(terminal): a paired-server file link opens in the workspace it was clicked in

Clicking a server terminal link to a file another workspace holds switched to
that workspace: the client asked the host for the holding workspace
(crossWorkspace), and the editor loader moved any absolute-path tab -
including one already holding a grant - to that workspace. Anyone who can
open a tab can already run anything on the host, so the holding workspace
guards nothing. On hosts that save granted files, the link now opens through
a grant in the clicked workspace, and restored tabs re-grant in place. Hosts
that can't (older hosts, their own SSH workspaces) and folders keep opening in
the holding workspace.

* fix(runtime): a desktop client reads and saves a granted file as large as a workspace one

Hosts advertise files.resolve-terminal-path.in-place-files.v1, give desktop
clients a 2 MB grant budget (phones keep 512 KB), and report a grant's size,
so the clicked workspace opens a file another workspace holds in place and
falls back to the holding workspace only where a grant can't serve it.

* fix(terminal): open in place only what a grant can read and save

Review: a grant save must fit one request frame and grants serve no bytes
editors, so the 2 MB budget would open files that can't be saved. Hosts now
report a grant's size and binary content instead, the client opens in place
only text within 512 KB, and only the SSH-workspace refusal moves a restored
tab; other host errors stay retryable.

* docs(terminal): describe the in-place files probe

* fix(terminal): ask the holder first and keep downloads, HTML and missing paths unchanged

Review: the holder answers first, as before, so missing paths, folders, this
computer's files, downloads and HTML previews resolve exactly as they did; only
an existing text file another workspace holds asks again for a grant here.
In-place opens are capped at 256 KB so edits stay within the grant's save limit.

* test(editor): mark the placement test's store stub as a sound cast
2026-11-04 01:35:57 -08:00
..
…