Repository navigation
fix(codex): preserve configured MCP on native fallback - #134941
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed September 2, 2026, 2:13 PM ET / 18:13 UTC. ClawSweeper reviewWhat this changesThe PR makes configured static MCP tools available through OpenClaw’s dynamic Codex tool surface when native Codex tools are disabled, while preserving policy, approvals, name uniqueness, and cleanup. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness✅ Ready for maintainer review Keep open. The proposed native-off dynamic owner fixes a current-main MCP disappearance, preserves per-tool approval and cleanup, and has supplied exact-head Gateway red/green proof; no introduced blocking defect was found. Priority: P1 Review scores
Verification
How this fits togetherThe Codex plugin assembles each agent turn’s tool surface from configured MCP servers and policy. It passes either native MCP configuration or OpenClaw-managed dynamic tools to Codex, which then invokes the selected tool during the turn. flowchart LR
A[Configured MCP servers] --> B[Codex turn policy]
B --> C{Native tool surface enabled?}
C -->|Yes| D[Native Codex MCP]
C -->|No| E[OpenClaw dynamic MCP]
D --> F[Tool call]
E --> F
F --> G[Agent response]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +129, Tests +157, Docs +1. Total +287 across 15 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Retain one configured-MCP owner per turn: native MCP on ordinary native-enabled turns and the policy-filtered OpenClaw dynamic surface on scheduled or native-off turns. Do we have a high-confidence way to reproduce the issue? Yes. The supplied isolated Gateway red/green run reproduces current-main zero MCP calls under native-off policy and records one exact-head call returning the hidden value. Is this the best way to solve the issue? Yes. The patch gives configured MCP a single policy-filtered owner on each turn instead of restoring native MCP or adding a fallback path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1212f991db46. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
80dfa6a to
2cb0916
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Youssef Hemimy <53057646+itsuzef@users.noreply.github.com>
036b29a to
48397e5
Compare
|
Thanks @itsuzef! Proof: An isolated production Gateway selected the Codex harness with
|
What Problem This Solves
Configured static MCP tools disappeared from Codex turns when OpenClaw disabled Codex's native tool surface. The native
mcp_serversprojection was absent, while the dynamic producer materialized configured MCP only for scheduled runs. Operators saw a healthy configured server, but the model saw no tool and no useful failure.Root cause
The Codex attempt runtime had two independent decisions:
An ordinary native-off turn therefore had no owner for configured MCP.
Fix
prompt, per-tool projected approval, and durable OpenClaw grants.Evidence
The same isolated production Gateway flow used
openai/gpt-5.6-sol, forced the Codex harness, settools.exec.host="node", configured one static MCP server, and requested one hidden fixture value throughopenclaw agent.04bad80b953dcodex(forced_plugin)fixture__lookup_note is unavailable.48397e587cca(Sol)codex(forced_plugin)c909e68d223(Luna)codex(forced_plugin)The hidden value was generated after the builds, never appeared in the prompt, and remained private to the fixture. The exact-head
dist/was built on Testbox, downloaded by hash, and used unchanged for the final isolated Gateway replay. All Gateways and both Testbox leases were stopped after proof. Public Testbox runs: initial red/green, exact-head build.Codex contract checked
Direct inspection of
openai/codex@da23e131e68b171909407f469da1b2f72d9c4f4aconfirmed:thread/startowns stable config and experimental dynamic tools.Validation
Diff audit
+258/-129(net+129).+176/-19(net+157).+1/-1.+3/-2.The positive production delta creates the missing dynamic owner and closure-bound approval boundary. The change replaces the scheduled-only materializer and removes the duplicate 61-line approval implementation; it does not add a second MCP or fallback stack.