Skip to content

fix: show failed native tools in Codex transcripts - #164116

Merged
joshavant merged 1 commit into
mainfrom
codex/qa-transcript-projection
Oct 3, 2026
Merged

joshavant merged 1 commit into
mainfrom
codex/qa-transcript-projection

Conversation

@joshavant

@joshavant joshavant commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Fixes missing failed native tool receipts in Codex transcripts when Code Mode binds patch input before calling apply_patch, or a command returns a nonzero exit code inside a completed script.

User Impact

Denied native patches and filesystem writes retain linked apply_patch or bash failure evidence. Execution and workspace permissions are unchanged.

Why This Change Was Made

The transcript projector now shares one bounded recognizer for literal single-call wrappers, including local input and result bindings. It uses the script failure or structured terminal command exit code to recover missing native failures, preserves raw response bytes, and retains existing native item IDs. The old patch-only recognizer is removed. No dependencies, manifests, lockfiles, or public contracts change.

Recovery deliberately excludes computed inputs, extra executable statements, modified results, and unknown output shapes. Potentially concurrent native receipts remain authoritative rather than receiving a guessed correlation.

Evidence

  • Frozen baseline: 3dc72be817aca542c355a69817c6da62edc8c715. Three pre-fix regression cases failed for the intended missing native identity; the regressions read the persisted SQLite transcript and check linked failed results.
  • Personally inspected the sibling Codex source at 39598ed17885970828acd42a6370131ed0190a98, including Code Mode output, unified exec failures, and app-server event projection. A completed script can carry a nonzero command exit code; nested native item IDs differ from the outer cell ID.
  • Rebased without conflicts onto efcd9ff82b8488abfc6f9dbd6443ba0afb2fdcd8 to include the required aliased transcript-store fix 32d49385f67f09054c8d9b03f10e0e7f3c68d33b. git range-diff confirms the repair is patch-identical. Candidate head: ae7e2abf25877b467b458288acbfe8bd1cf84c45.
  • Focused projector, output-fidelity, native-failure, command-output, and checkpoint suites on the rebased head: 83 passed, 70.16 seconds wall time with --maxWorkers=1 (original-head proof: 83 passed in 137.26 seconds).
  • pnpm test extensions/codex/src/app-server/event-projector.native-audit.test.ts --maxWorkers=1: 30 passed, 28.49 seconds wall time (about 3 seconds in test bodies).
  • pnpm test extensions/codex/src/app-server/event-projector.code-mode.test.ts --maxWorkers=1: 20 passed, 16.90 seconds wall time (under 1 second in test bodies).
  • Exact-head CI for both changed test files: 50 passed, 45.96 seconds for the combined test command; 83 seconds for the complete CI job, including setup.
  • Exact-head CI: passed, 27 successful jobs and no failures; non-selected jobs were skipped by the existing plan.
  • Fresh autoreview of the complete candidate diff: scoped-clean at P2, no actionable findings; retained for the patch-identical rebase.
  • ClawSweeper reviewed the exact rebased head: no actionable findings; its latest completed review accepted the live proof below.
  • Before the rebase, the final compile-only lint correction passed the two affected projector files again: 50 tests. Original-head production/test type checks, formatting, narrowed lint, plugin and dependency boundaries, doctor contracts, unused exports, storage/loader guards, and import-cycle checks passed. Rebased local check coverage and completed exact-head CI are classified separately below.
  • OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build on the rebased head: passed, 10m 36.8s. Verified the build stamp matches the candidate head with clean inputs and that packaged Codex, QA Lab, and QA channel entries exist.
  • Live runtime-tool-apply-patch and runtime-tool-fs-write: 2 passed, 0 failed, 0 skipped, 66.071 seconds, on the exact rebased head. Both primary and alternate were openai/gpt-5.5, with forcedRuntime=codex, default app-server resolution, one isolated Gateway, and the built openclaw.mjs launcher. Row and infrastructure retries were disabled. Registered assertions verified linked persisted native success/failure receipts, exact successful file contents, and unchanged outside-workspace sentinels. Credentials were injected through op run; task-owned runtime state was cleaned up.
  • The original baseline's inherited environment-count mismatch (476 names versus budget 477) was separately reproduced before the rebase. Current main corrects that budget; the rebased check passes at 476/476. Local changed checks passed through both production and test type checks. The coordinator stopped the broad static tail to keep checkout jobs serialized; its partial logs are retained. All selected exact-head CI gates subsequently passed.

Sanitized live runner output (2026-10-03, 08:16:29–08:17:36 UTC):

[qa-suite] scenario pass (1/2): runtime-tool-apply-patch
[qa-suite] scenario pass (2/2): runtime-tool-fs-write
[qa-suite] run complete: passed=2 failed=0 skipped=0 total=2
QA complete: passed=2 failed=0 skipped=0 total=2

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@joshavant
joshavant marked this pull request as ready for review October 3, 2026 07:08
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: codex size: L labels Oct 3, 2026
@joshavant
joshavant marked this pull request as draft October 3, 2026 07:08
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 4:35 AM ET / 08:35 UTC (Revision 4).

ClawSweeper review

What this changes

The Codex plugin restores linked failed patch and shell-command records from simple Code Mode scripts, adds persisted-transcript regressions, and documents recovery limits.

Merge readiness

✅ Ready for maintainer review

This PR remains useful: current main and the latest release still lack the broader failure recovery. The pinned patch has no actionable findings, and the reported exact-head live runs provide sufficient behavior proof. No additional review blocker remains.

Priority: P2
Reviewed head: ae7e2abf25877b467b458288acbfe8bd1cf84c45

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, coherent repair with strong exact-head live evidence and meaningful persisted-transcript regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured exact-head live output reports both native patch and filesystem-write scenarios passing through the built launcher, isolated Gateway, and real Codex runtime; inspected scenario assertions cover persisted linked failures and unchanged denied-write sentinels. No stored schema or serialized-format contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured exact-head live output reports both native patch and filesystem-write scenarios passing through the built launcher, isolated Gateway, and real Codex runtime; inspected scenario assertions cover persisted linked failures and unchanged denied-write sentinels. No stored schema or serialized-format contract changes.
Evidence reviewed 8 items Pinned introduced change: Reviewed the merge-base-to-head delta across all six introduced paths. The replacement recognizer accepts literal single-call wrappers, rejects computed or modified inputs/results, and compiles recognized syntax without executing it.
Identity and response preservation: Existing native items suppress guessed fallback correlation. Recovered failures use the outer call ID, while result construction retains the original raw response through the existing output owner.
Current main still needs the repair: Current-main source still uses the patch-only recognizer and lacks recovery of completed Code Mode scripts carrying nonzero command exits. GitHub content reads supplied the source after local historical blob retrieval failed with HTTP 403.
Findings None None.
Security None None.

How this fits together

The Codex plugin receives native tool events and raw responses from the Codex app-server. Its transcript projector turns those events into saved tool calls and results used by conversation history and output inspection.

flowchart TD
  A[Codex app-server events] --> B[Transcript projector]
  C[Raw Code Mode responses] --> B
  B --> D{Native receipt available?}
  D -->|Yes| E[Preserve native identity]
  D -->|No| F[Recognize literal single-call failure]
  E --> G[Saved conversation transcript]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +127, Tests +188, Docs +7. Total +322 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 166 39 +127
Tests 2 317 129 +188
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 490 168 +322

Review metrics

Metric Value Why it matters
Production and regression growth production net +127 lines; tests net +188 lines Production growth replaces the patch-only recognizer with shared bounded patch/command recovery, supported by persisted-transcript and negative-control coverage.

Technical review

Best possible solution:

Keep bounded failure recovery in the existing transcript projector, with native receipts authoritative and unsupported scripts retained as raw execution evidence.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the missing-record path for a locally bound patch input or a completed script containing a nonzero command exit. The contributor reports failing baseline regressions and passing after-fix live scenarios; this read-only review did not execute them.

Is this the best way to solve the issue?

Yes, the patch extends the existing projection owner, removes the old recognizer, and conservatively preserves native identities and raw responses.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against f1c2314964b7.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs missing failure records in Codex conversation history without changing execution permissions or provider routing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured exact-head live output reports both native patch and filesystem-write scenarios passing through the built launcher, isolated Gateway, and real Codex runtime; inspected scenario assertions cover persisted linked failures and unchanged denied-write sentinels. No stored schema or serialized-format contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured exact-head live output reports both native patch and filesystem-write scenarios passing through the built launcher, isolated Gateway, and real Codex runtime; inspected scenario assertions cover persisted linked failures and unchanged denied-write sentinels. No stored schema or serialized-format contract changes.

Evidence

What I checked:

  • Pinned introduced change: Reviewed the merge-base-to-head delta across all six introduced paths. The replacement recognizer accepts literal single-call wrappers, rejects computed or modified inputs/results, and compiles recognized syntax without executing it. (extensions/codex/src/app-server/event-projector-code-mode.ts:61, ae7e2abf2587)
  • Identity and response preservation: Existing native items suppress guessed fallback correlation. Recovered failures use the outer call ID, while result construction retains the original raw response through the existing output owner. (extensions/codex/src/app-server/event-projector-tool-transcript.ts:316, ae7e2abf2587)
  • Current main still needs the repair: Current-main source still uses the patch-only recognizer and lacks recovery of completed Code Mode scripts carrying nonzero command exits. GitHub content reads supplied the source after local historical blob retrieval failed with HTTP 403. (extensions/codex/src/app-server/event-projector-tool-items.ts:23, f1c2314964b7)
  • Latest release check: The latest release also retains the older patch-only recovery path; it does not supersede this PR. (extensions/codex/src/app-server/event-projector-tool-transcript.ts:248, fc23bc864e45)
  • Verified dependency contract: The patch interprets Codex Code Mode output, making the dependency contract applicable. Personally inspected the installed dependency's v0.160.0 source: command results contain wall_time_seconds, optional exit_code/session_id, and output, while successful script completion is independent of command exit status. GitHub's annotated release tag resolves to the sibling checkout SHA, establishing repository ownership. The contributor's older inspection SHA was unavailable locally. (codex-rs/core/src/tools/context.rs:447, a956835d0207)
  • Regression coverage: Read both changed test modules. Regressions read persisted SQLite transcript messages and assert linked failed results and preserved response text; separate cases protect native identity, unsupported wrappers, and running/unknown command outcomes. The body reports intended baseline failures and supplies focused wall-time and CI-cost measurements. (extensions/codex/src/app-server/event-projector.native-audit.test.ts:176, ae7e2abf2587)

Likely related people:

  • joshavant: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-10-03T07:13:09.394Z sha dbad93df955259d7e3ddd6f09ffc859122bd2f09 :: needs changes before merge. :: none
  • reviewed 2026-10-03T08:06:19.871Z sha ae7e2ab :: needs maintainer review before merge. :: none
  • reviewed 2026-10-03T08:25:48.195Z sha ae7e2ab :: needs maintainer review before merge. :: none

@joshavant
joshavant force-pushed the codex/qa-transcript-projection branch from dbad93d to ae7e2ab Compare October 3, 2026 08:00
@joshavant
joshavant marked this pull request as ready for review October 3, 2026 08:19
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 3, 2026
@joshavant

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

Please review exact head ae7e2abf25877b467b458288acbfe8bd1cf84c45. The PR body now includes the rebased private build (10m 36.8s), both registered live rows passing with zero failures and retries disabled, the partial local changed-check classification, and passing exact-head CI.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@joshavant
joshavant merged commit 3b0b12d into main Oct 3, 2026
192 checks passed
@joshavant
joshavant deleted the codex/qa-transcript-projection branch October 3, 2026 13:37
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: codex P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant