Repository navigation
fix(codex): native patches fail and fast mode is ignored - #114907
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 27, 2026, 11:50 PM ET / July 28, 2026, 03:50 UTC. ClawSweeper reviewWhat this changesThe branch recognizes real native Codex patch events in tool transcripts, preserves patch success or rejection evidence, and makes fast-mode QA runs request Codex priority service tier. Merge readiness⛔ Blocked until stronger real behavior proof is added - 5 items remain Keep this PR open for explicit owner review. It has the protected Priority: P2 Review scores
Verification
How this fits togetherThe Codex extension converts app-server events into OpenClaw tool-call transcripts and prepares runtime attempts. QA Lab configures controlled Codex runs, so its fast-mode setting must reach the same Codex service-tier request used by the runtime. flowchart LR
A[Codex app-server events] --> B[Codex transcript projection]
B --> C[OpenClaw tool transcript]
D[Fast-mode QA run] --> E[Codex attempt setup]
E --> F[Priority service tier]
C --> G[Patch evidence and QA measurements]
Decision needed
Why: The PR changes how externally generated native patch evidence is accepted and reported, and it is explicitly marked for maintainer handling; that boundary cannot be safely approved from the available metadata alone. Before merge
Agent review detailsSecurityNone. PR surfaceSource +307, Tests +730. Total +1037 across 9 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Have the Codex/QA owner complete a direct upstream-contract and current-main regression review, then retain the narrow runtime-boundary fix only if real native patch success, denial, transcript counts, and fast-mode priority behavior all agree. Do we have a high-confidence way to reproduce the issue? Unclear. The PR body describes live OpenAI-backed failures and successful after-fix runs, but the sandbox prevented an independent current-main reproduction or inspection of the stated artifacts. Is this the best way to solve the issue? Unclear. Recognizing canonical native events at the transcript boundary and forwarding the existing fast-mode fact are plausible narrow fixes, but a direct upstream Codex contract review is required to confirm they are the safest path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 77e1f213b6ee. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
|
Post-merge real-provider verification at landed commit Provider:
Token totals, reported separately from cache traffic:
The pre-fix patch scenario failed on both runtimes with zero real token usage, so it is excluded from the before/after speed comparison. Across the four scenarios that passed in both the original real-provider baseline and the landed run, Codex measures 280.329 s before vs. 292.344 s after. This run therefore does not establish an aggregate Codex speedup; it establishes the repaired patch behavior, accurate non-duplicated tool accounting, correctly propagated priority tier, valid cache accounting, and five passing live scenario pairs. The source/docs workload is model-variable (23 OpenClaw tool calls and 17 Codex tool calls in the landed sample), so one sample must not be presented as a stable optimization. Artifacts:
|
Related: #114574
What Problem This Solves
Fixes an issue where users running the real GPT-5.6 Codex harness would see native
apply_patchfail or disappear from the transcript, while fast-mode comparisons incorrectly ran Codex without its priority service tier. This also made patch tool counts and mock-based performance conclusions unreliable.Why This Change Was Made
Recognize authenticated Codex native and code-mode patch events at the runtime boundary; preserve canonical working-directory and sandbox-denial evidence; count a successful nested file change exactly once; and propagate fast mode consistently into the Codex app-server and QA runtime. Reject ambiguous, spoofed, and non-canonical shell or code-mode representations.
User Impact
Real OpenAI-backed OpenClaw and Codex runs can both apply workspace patches, report denied and invalid patches accurately, respect fast mode, and produce comparable runtime and token measurements without mock-provider timing samples.
Evidence
Exact-head hosted CI: https://github.com/openclaw/openclaw/actions/runs/30326857394
Real provider, not
mock-ai:openai/gpt-5.6-sol, medium thinking, fast mode, and an OpenAI key read through 1Password CLI without printing or storing the key. Redacted actual output from.artifacts/qa-e2e/pr-114574-final-matched-native-patch/qa-suite-summary.json:The two calls represent one verified successful workspace patch and one verified rejected out-of-workspace patch for each runtime. Cached tokens are reported separately; cache reads and writes must not be interpreted as new model input. Successful nested Codex code-mode patch calls are not double-counted.
Remote full
pnpm check:changed: passed. Remote native Codex audit: 40 tests passed, including authenticated invalid patches and sandbox denials, strict shell and code-mode spoof rejection, canonical inner-event deduplication, and effective-working-directory escapes. Remote QA runtime-tool fixture: 62 tests passed. Production and test extension TypeScript checks, all Codex run-attempt tests, and QA gateway configuration tests passed. Fresh independent GPT-5.6 autoreview: clean, no actionable findings.Direct upstream Codex contract inspection
Personally checked the current sibling
openai/codexsource rather than relying on wrappers, generated schemas, or bot review:codex-rs/core/src/apply_patch.rs:37and:72: patch approval rejection is returned asFunctionCallError::RespondToModel("patch rejected: ...")before a successful file-change item exists.codex-rs/core/src/safety.rs:16: the canonical out-of-project rejection iswriting outside of the project; rejected by user approval settings.codex-rs/core/src/tools/handlers/apply_patch.rs:418and:581: successful approved patches use the nativeToolEmitter::apply_patch_for_environmentpath.codex-rs/core/src/tools/events.rs:217,:581, and:681: canonical successful patch audit is owned by nativeFileChangeitems.codex-rs/app-server-protocol/src/protocol/v2/thread.rs:73,:145,:174, and:358: thread start/resume protocol carries service-tier configuration and explicitly opts in to raw provider response events.codex-rs/core/src/session/mod.rs:634,:899, and:3075: session service-tier selection and raw response-item emission.codex-rs/core/src/config/config_tests.rs:8725and:8747: upstream confirms fast maps to the supportedpriorityrequest service tier.ClawSweeper rank-up and owner decisions
Real behavior proof: addressed above with actual redacted live-provider output and independently inspectable exact-head hosted CI. Upstream event/security contract: addressed above with personally verified upstream source and passing spoof, containment, failure, and deduplication regressions. Protected maintainer/owner review: this is an explicit owner-requested maintainer follow-up authored by the repository maintainer; the repository-native review artifacts record
READY FOR /prepare-pr, zero findings, and explicit boundary-by-boundary owner evidence. Final five-scenario real-provider performance measurements will be captured against the confirmed landed merge commit.