Repository navigation
fix: surface Codex input prompts across runtimes - #126387
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex structured input now reaches bounded Gateway questions in native and ACP runs, with exact turn ownership, explicit unsupported outcomes, and cancellation fencing. Consume the published ACPX elicitation support.
|
Codex review: found issues before merge. Reviewed August 19, 2026, 3:47 PM ET / 19:47 UTC. ClawSweeper reviewWhat this changesAdds bounded structured-input prompts for Codex native and ACP runs, using Gateway questions and turn-scoped response handling. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked by patch quality or review findings - 11 items remain Keep open: this PR exposes secret schema defaults in prompt text and can collide with retained Gateway question IDs during ACP recovery retries. Likely related people: steipete (low-confidence routing from exact-head blame). Priority: P1 Review scores
Verification
How this fits togetherCodex and ACP runtimes can request operator input during an agent turn. The adapters compile supported requests into Gateway questions or transient secret prompts, then return answers to the originating runtime. flowchart LR
A[Codex or ACP runtime] --> B[Turn-owned input adapter]
B --> C[Structured input compiler]
C --> D[Gateway question or secret prompt]
D --> E[Operator response]
E --> F[Lifecycle and cancellation fence]
F --> G[Protocol response]
Decision needed
Why: The review environment could not inspect the authoritative dependency or sibling Codex sources, while this PR advertises new protocol capabilities and handles secret-marked fields. Before merge
Findings
Agent review detailsSecurityNeeds attention: A secret-marked schema default is exposed in visible prompt text. PR surfaceSource +2246, Tests +1410, Docs +58, Config 0, Other +4. Total +3718 across 61 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Make secret defaults non-disclosing, make ACP recovery reuse an answer or generate attempt-safe question IDs, add boundary regressions for both paths, then complete direct acpx and Codex contract review before merge. Do we have a high-confidence way to reproduce the issue? Yes, from source: a secret field with a default reaches the delivery formatter, and an answered ACP elicitation followed by a recoverable pre-output retry deterministically reuses its retained question ID. These paths were not executed because this review is read-only and the needed dependencies are absent. Is this the best way to solve the issue? No: the shared owner boundary is appropriate, but secret-default presentation and retry identity must be repaired before this is a safe solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5eda48ed9996. LabelsLabel changes:
Label justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Use protocol-specific helper names required by current main and update the reservation regression to the generalized input owner.
e3cb51e to
3644ed2
Compare
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
Expose one documented, frozen agent-harness structured-input contract with runtime and subpath coverage, replacing the accidental function-property API.
Land-ready proofCurrent head: The root cause is repaired at one shared owner: native Codex and ACP protocol adapters translate into the bounded structured-input compiler/executor; ACP channel dispatch and manual ClawSweeper's August 19 finding and both Proof
Exact-head pull-request CI is green: run 32294264125.
Live behavior
The isolated Control UI remained at “Control UI did not start” / “Loading chat”, so no misleading screenshot/video is attached. The live Review and risk stateProduction LOC is raw +2,375/−282 (net +2,093), judged net +2,079 after discounting type-relocation formatting; tests/support +1,823/−260; docs +70/−12; tooling +6/−2; dependency net 0. The production growth is the generic bounded capability, native/ACP adapters, missing manual-spawn owner, and suppression-free hostile-input validation. The required |
Register the real-process ACPX fixture as an executable test root and move shared structured-input types into the boundary leaf to keep Knip and Madge clean.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Preserve the rejected control and invisible-character ranges with an explicit code-point check so the production suppression inventory stays closed.
|
@openclaw/openclaw-secops — could someone review the current head for the required CODEOWNERS approval? The lockfile change only moves the bundled ACPX plugin to published Land-ready evidence and the ClawSweeper finding/rank-up disposition are recorded above: #126387 (comment) |
* fix: surface Codex input prompts across runtimes Codex structured input now reaches bounded Gateway questions in native and ACP runs, with exact turn ownership, explicit unsupported outcomes, and cancellation fencing. Consume the published ACPX elicitation support. * chore: align elicitation helpers with current guards Use protocol-specific helper names required by current main and update the reservation regression to the generalized input owner. * fix: formalize structured input SDK surface Expose one documented, frozen agent-harness structured-input contract with runtime and subpath coverage, replacing the accidental function-property API. * fix: satisfy elicitation architecture gates Register the real-process ACPX fixture as an executable test root and move shared structured-input types into the boundary leaf to keep Knip and Madge clean. * fix: remove structured input lint suppression Preserve the rejected control and invisible-character ranges with an explicit code-point check so the production suppression inventory stays closed.
AI-assisted: yes. I reviewed the complete change, its runtime ownership, upstream contracts, and proof results.
What Problem This Solves
Fixes an issue where Codex could ask for structured user input but OpenClaw would either decline ordinary MCP forms or silently return empty answers in ACP sessions. Native app-server handling only routed approval-shaped elicitations, while ACPX did not advertise or forward elicitation and the manual
sessions_spawn(runtime="acp")path omitted the handler even after channel auto-reply dispatch had one.Why This Change Was Made
This adds one generic, bounded structured-input compiler/executor under the agent harness and keeps the native Codex and ACP adapters protocol-thin. Requests retain exact request/session/turn correlation, share one per-turn interactive queue, fence late answers after cancellation, keep explicitly secret fields out of durable Gateway question records, and produce visible unsupported outcomes instead of empty answers.
Both ACP owners now pass the same turn-owned handler: channel auto-reply dispatch and manual-spawn ACP execution. The Codex plugin also consumes the published ACPX elicitation contract from openclaw/acpx#508, released as v0.13.1. The obsolete duplicate Codex-local secret claim/steering path is removed.
Raw production growth is +2,375/−282 (net +2,093); the judged production delta is net +2,079 after discounting 14 formatting-only lines from moving shared types into the boundary leaf. It is justified by the new generic bounded structured-input capability, current native/ACP protocol adapters, the missing manual-spawn owner boundary, and the explicit suppression-free control/invisible-character validator. Tests/support are +1,823/−260 (net +1,563), docs are +70/−12 (net +58), tooling is +6/−2 (net +4), and the dependency diff is net zero.
User Impact
Operators can answer supported Codex and ACP form or URL requests through transient Gateway questions. Standard primitive fields, bounded choices, multi-select, defaults, validation, explicit secrets, and literal HTTP(S) URL confirmation work consistently across native and ACP runs. Malformed, unsupported, expired, or cancelled requests now report a visible, explicit outcome rather than silently yielding empty answers.
Evidence
Live before and after
Redproduced exactlyCOLOR:Red.sessions_spawn(runtime="acp")reproduced the defect: no Gateway question appeared and the turn ended with exactlyFLAVOR:.[email protected]created a Gateway question bound to the ACP child session. ResolvingChocolateproduced exactlyFLAVOR:Chocolate.question.list/question.resolvesurfaces and persisted transcripts were inspected instead.Local validation
Before the final rebase, the final focused rerun passed 242 tests and the combined elicitation rerun passed 881 tests. The broader suites included native Codex 472 passed, ACP handler/dispatch/control-plane 140 passed, ACPX extension 253 passed, and shared structured input 16 passed. The real-process ACP
request_user_inputtest returned non-empty answers.After rebasing onto current
main, these exact focused commands passed on the elicitation head:Results on the rebased head: native Codex 474 passed; ACP handler/dispatch/control-plane 263 passed; ACPX extension 124 passed; shared structured input 28 passed (889 total). A stale sibling assertion was updated after this rerun exposed the generalized pending-input owner; its focused rerun passed 27 tests. Protocol-specific helper names were then adjusted for current
main's coercion-helper guard, and the directly affected native/ACP/Gateway rerun passed 22 tests.ClawSweeper's old-head review then identified that structured input was attached as undocumented properties on an existing public SDK function. The final head
3e3c144ef4549abef2650cb0d4d0b79c5b5a5efareplaces that accidental shape with one named, frozenagentHarnessStructuredInputcontract on the existing documented runtime subpath. The harness guide and subpath reference document its ownership and outcomes; runtime and subpath contract tests cover it; the public SDK surface budget accounts for the single export.Additional exact gates:
The final owner-fix changed-file gate passed. Full
pnpm check:changedpassed on the complete pre-rebase diff; the post-rebase changed gate also passed with currentmain's additional guards. The final SDK contract rerun passed 44 focused tests, the Plugin SDK surface check passed at 4,336 public exports, the complete changed gate passed,pnpm buildpassed, andpnpm check:docschecked 6,532 links with zero broken.git diff --checkwas clean. Fresh full-bundle Codex autoreview reported no accepted/actionable findings (confidence 0.98), the post-rebase adjustment review was clean (confidence 0.99), and the final SDK-boundary review was clean (confidence 0.98).Exact-head CI on the prior head exposed two static gates that the initial focused set did not include.
pnpm deadcode:unused-filesidentified the process fixture as a dynamic executable root; it is now registered in the ACPX Knip workspace and the exact scan passes.pnpm check:architectureidentified a type-only Madge cycle; shared structured-input types now live in the lower boundary leaf and the exact architecture suite reports zero cycles. After those repairs, 58 cross-surface focused tests and 27 structured-input tests passed, the complete changed gate passed,pnpm buildpassed again, and final autoreview was clean (confidence 0.99).The next exact-head Node shard found the original
eslint/no-control-regexsuppression was outside the closed production suppression inventory. No allowlist entry was added: the validator now uses an explicit code-point check with the same rejected ranges. The exact lint-suppression and structured-input tests pass (14 tests), the changed gate passes, and the final autoreview is clean (confidence 0.99).Contract inspection
Direct source inspection used current sibling Codex HEAD
d65d315939:codex-rs/protocol/src/approvals.rs:353-398,codex-rs/protocol/src/mcp.rs:12-20,64-80,codex-rs/app-server-protocol/src/protocol/v2/mcp.rs:313-328,330-367,679-777,codex-rs/app-server/src/bespoke_event_handling.rs:720-823,1632-1777,codex-rs/app-server/src/outgoing_message.rs:142-153,295-360,463-511,codex-rs/app-server/src/request_processors/initialize_processor.rs:70-77,codex-rs/app-server/tests/suite/v2/mcp_server_elicitation.rs:160-273,309-469,663-684,761-813,1121-1241, andcodex-rs/app-server/tests/suite/v2/request_user_input.rs:126-176.Those contracts establish the separate native requests, nullable turn correlation for MCP elicitation, string-or-integer outer request IDs, typed form/openai-form/URL payloads, exact response actions, capability negotiation, thread-scoped pending-request cancellation, and end-to-end answer shapes used here.