Returning a Codex session from structured chat to its terminal always failed
with "did not prove the expected Codex rollout". Adoption stops the pane's
Codex, so `launchAdoptedStructuredTui` typed a resume command into a bare shell
and went straight to the proof, which pasted `/status` and scraped the tail for
15s. The probe landed before Codex was up, and it read kittyKeyboardFlags from
the mode tracker before the new process negotiated, submitting a bare CR.
A `tui-idle` wait would not fix it: that resolves on a shell prompt preview and
on the pre-adoption `lastAgentStatus`. Nothing on screen separates a ready shell
from a ready Codex.
The resumed CLI can answer for itself. Orca already installs Codex SessionStart
hooks, and the payload carries session_id, transcript_path and source=resume.
The hook now also echoes back a one-shot nonce Orca stamps into the single
resume invocation it types, so a stale SessionStart from an earlier process in
the same pane cannot pass for the new one. The nonce is a new env var rather
than `launchToken`, which is pane-lifetime identity that authority attestation
matches against. Nothing is pasted at the pane any more, so the submit-key
question disappears with the probe.
An installed hook script predating this omits the nonce; pane + thread still
bind, so that degrades instead of stranding the path. With agent status hooks
off there is no proof to wait for, and the launch says so up front.