Complete the Codex host initialization handshake once

This commit is contained in:
2026-11-05 15:49:44 +00:00
parent 46f85556af
commit 1e886faa41
6 changed files with 62 additions and 9 deletions
+2 -1
View File
@@ -82,7 +82,8 @@ changes Codex settings. Helpers are scoped by database path and upstream socket,
with mode-0600 Unix sockets and singleton locks under the mode-0700 directory
`<user cache dir>/pipelines/codex-hosts/<database hash>/`.
On reconnect the helper returns its cached initialization handshake and replays
The helper completes upstream initialize -> initialized exactly once before
accepting clients. On reconnect it returns the cached initialization result and replays
only unanswered server requests, preserving exact callback IDs and parameters.
Responses and `serverRequest/resolved` remove pending entries. Old/new client RPC
IDs are remapped so a delayed response for an old Pipelines process cannot answer
@@ -47,3 +47,9 @@ The initial deployment cannot rescue callbacks already owned by the old direct
connection; pending interactions must settle before that first replacement.
A helper crash, upstream App Server restart, or expiry breaks callback identity
and remains an explicit limitation. No disk reconstruction is claimed.
Handshake follow-up: the bridge now sends the upstream `initialized` notification
once after a successful initialize response and before declaring readiness.
Downstream initialized notifications remain suppressed on every attach. A real
socket fixture verifies initialize -> initialized ordering and exactly one of
each across client replacement, and the adapter integration checks both counts.