Files
orca/src/shared
Jinwoo Hong 4c949cd111 fix(session-tabs): a confirmed close of a pinned tab in a server workspace closes it instead of snapping back (#31791)
* fix(session-tabs): a confirmed close of a pinned server tab closes it instead of snapping back

A paired desktop sent its confirmed close of a pinned terminal tab in a
server workspace over session.tabs.close, which had no force, so the
server refused it (terminal_tab_pinned) and the tab came back.

- session.tabs.close takes an optional `force: true`, honoured only with
  an explicit `reason: 'user'` and passed to the server's existing forced
  close (the same path worktree stop uses), in both builds.
- The server advertises `session-tabs.close-force.v1` in both builds. The
  desktop sends force only after the pinned-tab confirmation and only to
  a server advertising it; an older server keeps today's refusal.
- A forced close the server never received keeps its force in the held
  replay record, so the replay is still the confirmed close.
- Moves the undelivered-close hold helpers into
  web-session-undelivered-close.ts unchanged, to keep the lifecycle
  module under the line limit.

* fix(session-tabs): a pinned server tab closes when the pin confirmation is turned off

A local pinned tab closes at once when confirmClosePinnedTab is off, so the
close itself is the user's consent. A server workspace's pinned tab now
sends that consent as force too (still only to a server advertising
session-tabs.close-force.v1). Lifecycle closes (pty-exit), rejectPinned
callers and bulk closes are unchanged.

* test(session-tabs): load the forced-close server test once; cover held and probe-failed forced closes

- session-tab-close-force.test.ts imports the runtime once and flips the
  layout-owner switch per case through the mock's getter, instead of
  resetting modules and re-importing the runtime for every case; drops
  the 120 s timeouts.
- A forced close held while the session is inactive, and one whose
  capability probe failed, keep their force for the replay.
- A pinned lifecycle (pty-exit) close never forces, even with the pin
  confirmation turned off.
2026-10-22 00:00:51 -04:00
..
…
…