Codex client-tool continuation: Family A suspended turn + worker protocol v3 (D-062, #137) #159
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
P1
P2
P3
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Creatidy/scarcity-router!159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "gateway/codex-client-tools"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #137 (child E of program #132). Security-critical — the mandatory
gpt-daybreak-blue-latestsecurity review applies on the exact head before any merge; this PR is open for human review and is NOT merged by agents.What this implements
The D-062 client-tool continuation for the Codex execution source — Family A, the protocol-native suspended-turn design selected by #137's TOOL_BRIDGE_VIABLE investigation. Numbered D-062 (D-060 reserved by issue #156; D-061 taken by #157 mid-flight).
execute_tool_call/execute_tool_result. Rolling upgrade: v1/v2 workers negotiate as before, are never tool-continuation-capable, keep ordinary execution; a v1/v2 session carrying v3 frames is fatal.item/tool/callis held and relayed to the harness as a normal OpenAItool_callsresponse; the harness's ordinaryrole:"tool"request is correlated to the SAME turn. The round trip deliberately does NOT complete — see the STOP below.successSTOP (review round 2, finding 1): upstream (openai/codex @ 36650394) defines the answer'ssuccessas "Whether the tool call succeeded" — a required bool the generic text-onlyrole:"tool"message cannot express. The adapter REFUSES to fabricate it: delivery fails typed (tool_result_success_unresolved),tool_resultsstays UNSUPPORTED, and an owner decision packet (issue #137, options a/b/c) resolves the mapping. No compatibility rule was invented.gateway_continuation.py): opaquesrct-tool_call ids; single-subscriber exactly-once claims; digest-only retention (no raw arguments/results/prompts); bounded pending count (64) + client-scoped replay tombstones; shape-aware detection (only a finalrole:"tool"message triggers continuation logic — follow-up turns are never poisoned; a dangling gateway-issued token is a typed 404, never a fresh completion).worker_continuation_unavailable); v2/v3 same-identity routes select v3; no fact ⇒ 503; non-tool requests unaffected; the D-043 matrix key untouched.unauthorized_target+ turn cancelled; no scarcity/campaign rerun (D-059 non-authoritative for live turns).Evidence changes (conservative)
tool_calls: UNSUPPORTED → PARTIAL (mechanism evidence 2026-09-28 oncodex-cli 0.155.0-alpha.16.3, upstream re-pinrust-v0.157.1; declarations/suspension/relay test-verified; live signed-in acceptance pending).tool_results: STAYS UNSUPPORTED (the answer-point STOP).CODEX_SURFACE_CAPABILITIES.tool_calls→ true. Decision: D-062.Gates (exact head
e232e39)basedpyright0/0/0; guardrails OK;git diff --checkclean; rebased onorigin/develop=59538e9; 5 commits, no merges.test_scenario_11cancellation flake fired once under full-suite load (pre-existing, passes on rerun; not folded in).Remaining gates (open at the human decision point)
SECURITY_REVIEW_BLOCKED— unavailable in this environment; no substitute closes the gate.success— (a) documented compatibility rule, (b) keep the STOP until a structured surface, (c) hybrid. Option (b) is shipped.LIVE_TOOL_BRIDGE_NOT_VERIFIED(#141 owns layered acceptance).Codex client-tool continuation: Family A suspended turn + worker protocol v3 (D-060, #137)to Codex client-tool continuation: Family A suspended turn + worker protocol v3 (D-062, #137)Cross-reference for your human merge gate: PR #160 (reasoning output semantics, #158, head
7390277, opened 19:02 after this PR) independently reserved decision number D-062 from the same reservation logic (D-060 → #156, D-061 → #157) before this PR became visible to that session, and also bumpsWORKER_PROTOCOL_VERSIONto 3 — with a disjoint member set (optional conversation-messagereasoningmember vs this PR'sexecute_tool_call/execute_tool_resulttypes). Both heads are reviewed/frozen artifacts, so neither renumbered unilaterally; the conflict is recorded with the proposed D-057/D-058-style resolution (second-merged PR renumbers and reconciles the protocol v3 section) in PR #160 comment. No action requested from this branch's review; this is the AGENTS.md conflict record so the owner sees both claims at merge time.f54f037916babf3f9217The owner resolves the D-062 decision packet with option (a): an explicit, owner-accepted LOSSY protocol translation for the generic Chat Completions execution surface. A syntactically valid role:tool message with the expected tool_call_id is represented on the Codex side as DynamicToolCallResponse {success: true, contentItems:[inputText]} with the verbatim message content. - The adapter answers with the owner-approved mapping after ALL continuation validation (the tool_result_success_unresolved STOP is superseded and removed). success=true is NOT the native upstream meaning and NOT proof the external operation succeeded; content is never inspected, parsed or reinterpreted; success=false is never inferred; no client-specific branch exists. - Evidence: tool_calls and tool_results both PARTIAL (live acceptance still outstanding; no PASS claim). Cells, module docstring, surface comment, execution-surface rows/section, and the stage1 addendum heading/intro/mapping/cell-state all tell the one story. - D-062 pt 6 rewritten as the owner decision (upstream richer semantic recorded; lossiness explicit; content opaque; generic rule); pt 8 and Confidence reconciled; Reconciliation records the amendment provenance. - Tests: full deterministic round trip restored and pinned for non-streaming AND streaming; error-like result text ("ERROR: lookup failed") is forwarded verbatim under the same mapping with success=false never inferred. Gates on this head: full suite 2320 tests OK; basedpyright 0/0/0; guardrails OK; git diff --check clean; base origin/develop =59538e9.