Skip to content

Persist Codex typed delivery receipts - #237

Closed
myobie wants to merge 3 commits into
agent/native-delivery-codex-deliveryfrom
agent/native-delivery-codex-receipt
Closed

Persist Codex typed delivery receipts#237
myobie wants to merge 3 commits into
agent/native-delivery-codex-deliveryfrom
agent/native-delivery-codex-receipt

Conversation

@myobie

@myobie myobie commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Stack hold — do not restack or force-push

This pull request currently conflicts with its base because #236 advanced from exact 74fe7bc to exact ea1d0a3. The mechanical fix is to restack this branch onto the updated #236 head.

That restack is deliberately not done. #239 is based on this branch at exact head 1d06c4b, so moving or force-pushing this branch would move the ground under another author's active pull request. This draft is blocked on Nathan coordinating the stack choice; it is not stale or abandoned. Until then, keep agent/native-delivery-codex-receipt frozen at 1d06c4b.

Summary

  • persist one stable client user-message ID before native Codex transport
  • accept only the exact typed userMessage receipt, or the same typed item recovered from resumed thread history
  • suppress replay across control replacement and wrapper restart until normal inbox archival removes the receipt
  • activate a fresh thread binding directly from its owning thread/started notification

This is Task 13 of the Codex native-delivery plan and implements the duplicate-control boundary from #233. It is stacked on draft #236.

Contract

  • JSON-RPC success remains only an attempted submission
  • malformed or ambiguous durable state fails closed
  • a saved binding reconciles typed thread history before the same stable ID may be retried
  • accepted state survives a new runtime incarnation
  • native delivery never reads, replies to, archives, or deletes the inbox message
  • normal archive precedence removes obsolete delivery state

Verification

  • cargo check --locked
  • cargo test --locked --lib --no-fail-fast: 7 + 276 + 5 passed
  • cargo test --locked --test codex_app_server --no-fail-fast: 3 passed
  • cargo clippy --locked --all-targets --no-deps: passed with inherited warnings only
  • rustfmt --edition 2024 --check src/codex_app_server.rs
  • git diff --check

Live acceptance

A private real Codex CLI 0.145.0 session accepted one stable native client ID. A controlled interruption retained both the unread inbox file and the attempted receipt. The replacement wrapper resumed the same thread, found the exact typed userMessage in authoritative history, promoted the receipt to accepted under its new runtime incarnation, and emitted no second native input. Normal resume-safe archival then removed the inbox item and receipt; the stable client ID and reply each occurred exactly once. The private wrapper and app server were cleanly stopped.

Not covered

The Claude native-delivery half remains parked. This stack creates no deliver mcp agent and does not claim that Claude delivery works.

myobie commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Folded into the reviewable implementation replacement #241 at exact head d8269638bc6a82e4b2f9ce29b2e8509be5bd2337. The replacement preserves this draft’s relevant history and has exact-head hosted Nix green. Closing this superseded draft; its branch is intentionally retained.

@myobie myobie closed this Aug 11, 2026
@schickling schickling added area:ding DING delivery: inbox notice into a running agent · Set: manual area:driver Harness drivers: launch, MCP, app-server, native delivery · Set: manual harness:codex Codex-specific behavior · Set: manual origin:agent Filed or primarily produced by an AI agent · Set: manual state:blocked Blocked on an external dependency or decision · Set: manual type:feature New user-visible or system capability · Set: manual labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ding DING delivery: inbox notice into a running agent · Set: manual area:driver Harness drivers: launch, MCP, app-server, native delivery · Set: manual harness:codex Codex-specific behavior · Set: manual origin:agent Filed or primarily produced by an AI agent · Set: manual state:blocked Blocked on an external dependency or decision · Set: manual type:feature New user-visible or system capability · Set: manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants