Add declared Codex app-server delivery - #241
Closed
myobie wants to merge 23 commits into
Closed
Conversation
This was referenced Aug 11, 2026
This was referenced Aug 12, 2026
Contributor
Author
|
Closing this in favour of #254, which is the same work plus the Claude half, in one pull request as Nathan asked. #254's branch already contained every commit on this one. I confirmed that with Nothing is lost by closing this. The branch stays. One thing I found while folding, and it applies to this branch too: three tests fail on macOS and they fail here as well, before the merge. CI is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dinguserMessageacceptance and reconcile ambiguous attempts without replaythread/loaded/list, durably trace that gate, then bind and reconcile from the exact successful controlthread/resumeresponse--Review order
The branch contains the original implementation commits in build order:
tuiThreadLoadedtrace acknowledged before control resumeThis additive branch starts at current
main. It restacks the #237 receipt commits on the corrected #236 tree without moving any existing branch.Relationship to #239
agent/native-delivery-codex-receiptremains frozen at exact1d06c4b, so #239 keeps its existing base. #239 is not part of this pull request and owns the bounded body renderer layered over this transport.Provider compatibility
The original live acceptance used Codex CLI 0.145.0. The first Silber scratch precondition then found Codex CLI 0.146.0 and stopped before creating a worktree, build, declaration, or process.
I generated both exact app-server v2 schema sets. The delivery-critical methods remain compatible:
turn/steer,thread/status/changed,contextCompacted, and review-start inputs are byte-identicalThe version gate now has a hermetic regression that accepts exactly 0.145.0 and 0.146.0 and rejects 0.147.0. The allowlist comment requires the next version to repeat both the critical-path schema comparison and live remote-TUI acceptance; semantic-version proximity is not evidence. The resumed Silber scratch proved real reconcile with no DING sidecar, idle typed wake, and agent-owned archive settlement. A message sent during an observed foreground busy window was replied to after the wait with no visible composer corruption or duplicate turn, but the first evidence packet looked only at the PTY record and did not capture the adapter's hash-keyed control state. Exact same-turn identity remains an evidence gate.
Validation
At exact head
b97ea8f:git diff --check origin/main..HEADrustfmt --edition 2024 --check src/codex_app_server.rscargo check --lockedcargo test --locked --lib --no-fail-fast -- --test-threads=1: 298 passed across workspace librariescargo test --locked --test codex_app_server --test doctor --test validate --test reconcile --test run --no-fail-fast: 133 passedcargo clippy --locked --all-targets --no-deps: exit 0 with inherited warnings onlythread/loaded/listuntil it sees the preserved thread; records and acknowledgestuiThreadLoadedbefore sending controlthread/resume; then binds from the exact response, reconciles history before delivery, and leaves a missing-rollout binding on its prior incarnationhooks/listpreflight, projects only exactuntrusted/modifiedprovider key+hash pairs into final app-server session flags, and fails closed on response drift without logging or persisting trust datatrusted; the probe leavesconfig.tomlwithout hook trust stateA parallel full-lib run on the prior head exposed one existing owner-lock timing failure; the complete suite passes serially, including that exact test. The prior
ef9e2e8head passed hosted Nix in run 31534396593. The corrected config-forwarding head65206bcpassed hosted Nix in run 31538400622 (9m 34s). The diagnostic head5f8d601passed hosted Nix in run 31540650233 (11m 48s). Exact-headd28005fpassed hosted Nix in run 31542574907 (12m 05s; job 93948092773, 2026-08-11 22:28:43Z–22:40:48Z). Exact-head6cd52a0passed hosted Nix in run 31545093692 (9m 18s; job 93955745681, 2026-08-11 23:05:21Z–23:14:39Z). Exact-head4c1451bpassed hosted Nix in run 31546501495 (11m 42s; job 93960047096, 2026-08-11 23:26:51Z–23:38:33Z). Exact-head2b06652passed hosted Nix in run 31548731523 (12m 48s; job 93966600692, 2026-08-12 00:02:18Z–00:15:06Z). The final authorization-safe headb97ea8fpassed hosted Nix in run 31549791361 (12m 52s; job 93969808942, 2026-08-12 00:19:34Z–00:32:26Z). The live Codex 0.146 scratch passed reconcile selection, idle wake, behavioral busy-window delivery, agent-owned settlement, and checked teardown; all seven Silber controls and all three independently observed Hetz DING process trees remained unchanged. The exact active turn ID and client receipt were not captured from the adapter state directory, so the stronger same-turn provider condition is still open. The scratch workspace was also untrusted because the wrapper dropped its authored trust override when starting app-server, so Codex disabled project-local hooks. The corrected r2 scratch reproduced the literal declaration and CAS preconditions, then timed out after publishing a new runtime incarnation but before any thread binding. It restored the original declaration, left no process, and preserved every control. The exact5f8d601diagnostic trace recordedresumeSelected=true, connected and initialized the control socket, started the TUI, then expired only atwaitingForThreadBindingafter 30 seconds. That eliminates socket setup and proves the observer waited for a resume notification the provider does not promise. This head sends the control client's exactthread/resumeonly after the TUI-start gate and binds the new incarnation from its successful response. Production-parity hook loading and exact same-turn/client evidence remain held for a new exact-head scratch. A separate inert closure issue is held: external catalog synchronization rematerialized the scratchagent.kdlafter a local move, with no matching process or runnable Silber task. It requires a sync-aware cleanup plan.R3 proved the response-driven control bind at the preserved thread and new runtime incarnation, with no failure record and correct shared trust configuration. It did not produce READY-BOOT or the SessionStart canary. Exact Codex 0.146 source and the current Codex manual show that resumed TUI startup does consume the authored prompt and emits
SessionStartwith sourceresume, so those absences are not intended resume semantics. This head closes the remaining cold-resume race by waiting for the TUI-loaded inventory before the redundant control resume, and makes that ordering live-observable. R4 then exposed an observability defect: the inner loaded-thread wait and outer binding wait both used 30 seconds, so the outer generic error won and the three provider-specific outcomes were practically unreachable. R4 restored the catalog exactly, left zero processes, preserved every binding/control invariant, and its zero-byte app-server log change is explicitly not trust evidence. This head makes the inner deadline 15 seconds and keeps the outer at 30 seconds. R5 proved that correction: it emitted the specific loaded-thread timeout before the outer wait, and a read-only PTY capture showed the owning TUI blocked atHooks need review. Exact Codex 0.146 source intentionally suppresses the authored bypass for every persistent remote resume; current upstream main retains that behavior. Exact implementation head2b06652then passed startup-only R6: preflight projected four hooks, its owned PID and socket were gone before final launch,tuiThreadLoaded,threadBound, READY-BOOT, and the SessionStart canary all appeared, and runtime, binding, and subscribed control state shared one new incarnation on the preserved thread. The global Codex config remained byte-identical with no persisted hook trust; checked teardown and CAS restore were green. The R6 packet's later hold crossed teardown after this pass. A post-release walk had found that the authorization detector also scanned prompt bytes after--; the tested declaration genuinely authored the root flag before its prompt, so both heads take the same true-positive path and the mechanism evidence remains valid. Final headb97ea8frestricts authorization to the parsed root-option prefix and adds a rejecting regression; its exact hosted gate is green. A duplicate live catalog mutation would not exercise changed true-positive behavior, so no repeat was run. C2 and production stay held.This pull request remains draft for Nathan's review.