fix(acpx): surface Codex wrapper stderr on internal errors#80718
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. at source level: current main's generated Codex wrapper does not retain stderr and ACPX Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the lease-scoped redacted stderr-tail design, remove or explicitly justify sandbox policy inheritance from isolated Codex config, then land after redacted installed-path proof shows the actionable stderr tail in the Do we have a high-confidence way to reproduce the issue? Yes at source level: current main's generated Codex wrapper does not retain stderr and ACPX Is this the best way to solve the issue? Mostly yes, but not as submitted: lease-scoped redacted stderr tails are a narrow maintainable fix for opaque generic Codex ACP failures. The sandbox policy inheritance should be removed or handled through an explicit OpenClaw-owned policy contract before merge. Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 926bf66ee336. |
e1b0e87 to
51ef17e
Compare
0af9469 to
d188047
Compare
d188047 to
f62f429
Compare
1da0cdd to
25ff8cf
Compare
Co-authored-by: leoge007 <leoge@users.noreply.github.com>
25ff8cf to
e29c6d8
Compare
OpenClaw ACP Codex Runtime Fix
Related issue:
Bug
Direct
acpx -> Codexcan work while OpenClawsessions_spawn(runtime="acp", agentId="codex")fails before Codex output with only:That hides the real Codex/acpx stderr, so provider/config failures are not actionable from OpenClaw.
Root Cause
OpenClaw does not invoke exactly the same path as direct
acpx.Direct path:
OpenClaw path:
The generated Codex ACP wrapper used isolated
CODEX_HOME. Generic adapter failures surfaced asInternal error, while the underlying wrapper stderr was only piped and not captured for the ACP error path.Fix
Internal errorfailures during session init, thrown first-turn failures, and terminalrunTurn()error events.CODEX_HOME, including model/provider selection but not auth, headers, query params, hooks, or notifications.Changed Files
Real behavior proof
Behavior addressed: Codex ACP failures surfaced only as
AcpRuntimeError: Internal errorwith no underlying stderr, making configuration/provider issues hard to diagnose.Real environment tested: macOS/arm64 source checkout with
@openclaw/acpxtests and agent-core ACP spawn coverage.Exact steps or command run after this patch: Ran focused acpx runtime, auth-bridge, process-lease, and acp-spawn tests, docs formatting, and whitespace checks.
Evidence after fix:
Observed result after fix: Tests cover redacted stderr diagnostics for generic Codex ACP failures, persisted log redaction, safe Codex config bridging, Windows wrapper lease args, and ACP parent stream dispatch order.
What was not tested: A live installed gateway package running this PR branch against
sessions_spawn(runtime="acp", agentId="codex"); local proof stayed at the source-level ACP runtime and agent spawn boundaries.