Refuse a chat create whose close came first (dark, build switch off by default) (#29659)

* Refuse a chat create whose close came first, behind the layout-owner switch

With ORCA_LAYOUT_OWNER=main, main remembers a close that reaches it before
the chat's create and refuses that create, or closes the chat as it lands.
The window then tells this machine's host about a cancel instead of
keeping a cancel tombstone; a host it cannot tell still gets the
tombstone. Paired hosts keep the tombstones, whose fence module moves to
lib/launch-cancel-tombstones-compat/.

* Close a chat whose create a cancel beat, on any create outcome

The local cancel now retires the chat on main (close and host-tab close),
so a create that landed first leaves no tab behind; a tab_not_found answer
means the create had not landed. Main closes the chat for any create
answer once a close was noted, including a refusal or a throw past commit,
and publishes no tab for it. The tombstone fallback notifies listeners.

* Keep the switched-off create path byte-identical

* Log, not throw, a failed close of a chat closed before create

* Run the close-before-create test in the Node SQLite project
This commit is contained in:
Jinwoo Hong
2026-10-16 05:41:33 -07:00
committed by GitHub
parent 469ae09c97
commit 18df97a7bc
14 changed files with 625 additions and 27 deletions
@@ -253,6 +253,7 @@ export const SQLITE_RUNTIME_INCLUDE = [
'src/main/runtime/rpc/methods/agent-launch-session-reservation.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-adoption-replay.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-at-rest.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-close-before-create.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-create-message.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-hold.test.ts',
'src/main/runtime/rpc/methods/structured-agent-session-options-workspace-scope.test.ts',