Skip to content

test(codex): run the native output-fidelity proof without the Linux bwrap sandbox - #156132

Merged
steipete merged 1 commit into
mainfrom
fix/codex-native-fidelity-item-events
Sep 23, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/codex-native-fidelity-item-events

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

extensions/codex/src/app-server/event-projector.output-fidelity.native.test.ts fails in every Linux Full Release Validation run for 2026.9.6 (runs 35743778013, 35761282770, 35776854018, 35802235259 attempts 1 and 2) with Error: Expected native command execution from requireRecord, while passing on macOS.

Root cause (environment, not a runtime contract change)

The proof dials codex app-server directly with sandbox_mode="read-only". Since Codex 0.154 bubblewrap is the only Linux sandbox (use_linux_sandbox_bwrap is Stage::Removed, use_legacy_landlock deprecated) and a read-only exec needs a user plus network namespace. The GitHub-hosted ubuntu-24.04 shard (checks-node-extensions-shard-1, image 20260907.300.1) cannot configure loopback inside that namespace. The diagnostics from #154919 captured the real exec output on Linux CI (run 35612418856):

Process exited with code 1
Output:
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted

cat source.txt never runs, app-server emits a function_call_output with the bwrap error but no item/completed with type: "commandExecution" for the call id, and the harness throws. The same symptom is already documented in docs/plugins/codex-harness-reference/approval-and-sandbox.md and probed by openclaw doctor for namespace-restricted Ubuntu/AppArmor hosts. It became deterministic on the 09-22 runner rotation; Codex 0.155.1 did not change the Linux sandbox path (git diff rust-v0.154.0 rust-v0.155.1 -- codex-rs/linux-sandbox codex-rs/sandboxing only adds WSL interop masking).

settled-turn-finalizer.native.test.ts passes on the same shard because it runs through the product path, which launches app-server with --sandbox from the resolved exec policy and therefore never enters bwrap.

Fix

  • Use sandbox_mode="danger-full-access" for this proof. It covers exec output fidelity (history truncation vs the provider-visible result), not sandboxing, and mirrors how product launches configure app-server. Every assertion stays in place.
  • When the commandExecution item is missing, the failure message now lists the observed notifications (method, item type, id, status) and the first 500 chars of the exec output, so a future regression is self-describing. This folds in the diagnostics from test(codex): show native output-fidelity failure context #154919.

Proof

  • Local macOS, Node 24, vitest.extension-database-workers.config.ts: 5/5 runs green while the whole extensions/codex/src/app-server batch ran concurrently as load.
  • Docker ubuntu:24.04 with the 0.155.1 linux-arm64 binary: codex sandbox -c sandbox_mode=read-only -- cat fails with bwrap namespace errors under default confinement and succeeds only when the container may create namespaces; danger-full-access runs in both.
  • OPENCLAW_TESTBOX=1 pnpm check:changed: see the landing log.

Related: #154919 (diagnostics-only PR, superseded by this change), #155989 (0.155.1 pin).

…wrap sandbox

The proof dials app-server directly with sandbox_mode=read-only, which on
Linux (Codex >= 0.154, bwrap-only) needs user plus network namespaces. The
GitHub-hosted ubuntu-24.04 Full Release Validation shard cannot configure
loopback in that namespace (bwrap: loopback: Failed RTM_NEWADDR), so cat never
runs, app-server emits no commandExecution item, and requireRecord throws.
Use danger-full-access like product launches (--sandbox from the resolved exec
policy) and print the observed notifications when the item is missing.
@clawsweeper

clawsweeper Bot commented Sep 23, 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.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 22, 2026, 11:18 PM ET / September 23, 2026, 03:18 UTC.

ClawSweeper review

What this changes

Runs the native Codex output-fidelity test without OS sandboxing and adds command-output and event details to missing-completion failures.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: current main still uses the problematic fixture configuration, and the patch preserves the output-fidelity assertions. No actionable correctness or security defect was found.

Priority: P3
Reviewed head: 83f0599d96478b17178882e8bc33b7dce31dd524

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Recorded reviewer rating: A focused fixture repair with preserved assertions and no actionable defect; reported native runs were not independently repeated. Real behavior proof remains required by host policy.
Proof confidence 🌊 off-meta tidepool Recorded reviewer rating; Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from external-contributor proof. The body reports native macOS passes and Linux Docker comparisons for the changed execution setup; the fixture still checks actual Codex output through OpenClaw’s projector, and no stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Required by policy Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from external-contributor proof. The body reports native macOS passes and Linux Docker comparisons for the changed execution setup; the fixture still checks actual Codex output through OpenClaw’s projector, and no stored-data contract changes.
Evidence reviewed 9 items Pinned introduced change: The introduced patch changes only the fixture sandbox setting and diagnostic label; command success, truncation, provider-request equality, and projected-result assertions remain intact.
Still necessary on main: Fetched main retains sandbox_mode="read-only" and the generic failure label. The fixture path does not exist at the supplied latest-release commit, so that release does not supply this fixture repair.
Fixture security boundary: The local provider supplies only the fixed cat source.txt command. The native child uses a temporary home/workspace, an allowlisted environment, and anonymous loopback provider traffic; the patch changes no product permissions or stored-state contract.
Findings None None.
Security None None.

How this fits together

OpenClaw’s Codex plugin converts native command events into conversation tool results. This test compares real native execution output with the next provider request and OpenClaw’s projected result.

flowchart LR
  A[Synthetic local provider] --> B[Native Codex app server]
  C[Temporary source file] --> D[Fixed read command]
  B --> D
  D --> E[Native output and events]
  E --> F[Next provider request]
  E --> G[OpenClaw tool result]
  F --> H[Fidelity assertions]
  G --> H
Loading

Before merge

  • Add real behavior proof - Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from external-contributor proof. The body reports native macOS passes and Linux Docker comparisons for the changed execution setup; the fixture still checks actual Codex output through OpenClaw’s projector, and no stored-data contract changes.
Agent review details

Security

None.

PR surface

Tests +14. Total +14 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 16 2 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 16 2 +14

Review metrics

None.

Technical review

Best possible solution:

Keep native output-fidelity coverage independent of host namespace support while preserving its real command, provider-request, and projection assertions.

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

No independently verified current-main reproduction was run; the reported namespace-denial trace matches the fixture configuration and pinned Codex sandbox checks.

Is this the best way to solve the issue?

Yes: changing this synthetic fixture’s execution posture removes an unrelated platform prerequisite without weakening the output-fidelity contract.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is bounded test-portability and diagnostic maintenance with no product behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. This is the recorded reviewer rating; real behavior proof remains required by host policy.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from external-contributor proof. The body reports native macOS passes and Linux Docker comparisons for the changed execution setup; the fixture still checks actual Codex output through OpenClaw’s projector, and no stored-data contract changes.

Label justifications:

  • P3: This is bounded test-portability and diagnostic maintenance with no product behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. This is the recorded reviewer rating; real behavior proof remains required by host policy.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: The verified repository-admin author is exempt from external-contributor proof. The body reports native macOS passes and Linux Docker comparisons for the changed execution setup; the fixture still checks actual Codex output through OpenClaw’s projector, and no stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; 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.

@steipete
steipete merged commit cd1eb7f into main Sep 23, 2026
111 checks passed
@steipete
steipete deleted the fix/codex-native-fidelity-item-events branch September 23, 2026 03:45
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 23, 2026
…wrap sandbox (openclaw#156132)

## Summary

`extensions/codex/src/app-server/event-projector.output-fidelity.native.test.ts` fails in every Linux Full Release Validation run for 2026.9.6 (runs 35743778013, 35761282770, 35776854018, 35802235259 attempts 1 and 2) with `Error: Expected native command execution` from `requireRecord`, while passing on macOS.

## Root cause (environment, not a runtime contract change)

The proof dials `codex app-server` directly with `sandbox_mode="read-only"`. Since Codex 0.154 bubblewrap is the only Linux sandbox (`use_linux_sandbox_bwrap` is `Stage::Removed`, `use_legacy_landlock` deprecated) and a read-only exec needs a user plus network namespace. The GitHub-hosted `ubuntu-24.04` shard (`checks-node-extensions-shard-1`, image 20260907.300.1) cannot configure loopback inside that namespace. The diagnostics from openclaw#154919 captured the real exec output on Linux CI (run 35612418856):

```
Process exited with code 1
Output:
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
```

`cat source.txt` never runs, app-server emits a `function_call_output` with the bwrap error but no `item/completed` with `type: "commandExecution"` for the call id, and the harness throws. The same symptom is already documented in `docs/plugins/codex-harness-reference/approval-and-sandbox.md` and probed by `openclaw doctor` for namespace-restricted Ubuntu/AppArmor hosts. It became deterministic on the 09-22 runner rotation; Codex 0.155.1 did not change the Linux sandbox path (`git diff rust-v0.154.0 rust-v0.155.1 -- codex-rs/linux-sandbox codex-rs/sandboxing` only adds WSL interop masking).

`settled-turn-finalizer.native.test.ts` passes on the same shard because it runs through the product path, which launches app-server with `--sandbox` from the resolved exec policy and therefore never enters bwrap.

## Fix

- Use `sandbox_mode="danger-full-access"` for this proof. It covers exec output fidelity (history truncation vs the provider-visible result), not sandboxing, and mirrors how product launches configure app-server. Every assertion stays in place.
- When the `commandExecution` item is missing, the failure message now lists the observed notifications (method, item type, id, status) and the first 500 chars of the exec output, so a future regression is self-describing. This folds in the diagnostics from openclaw#154919.

## Proof

- Local macOS, Node 24, `vitest.extension-database-workers.config.ts`: 5/5 runs green while the whole `extensions/codex/src/app-server` batch ran concurrently as load.
- Docker `ubuntu:24.04` with the 0.155.1 linux-arm64 binary: `codex sandbox -c sandbox_mode=read-only -- cat` fails with bwrap namespace errors under default confinement and succeeds only when the container may create namespaces; `danger-full-access` runs in both.
- `OPENCLAW_TESTBOX=1 pnpm check:changed`: see the landing log.

Related: openclaw#154919 (diagnostics-only PR, superseded by this change), openclaw#155989 (0.155.1 pin).
steipete added a commit that referenced this pull request Sep 23, 2026
…wrap sandbox (#156132)

## Summary

`extensions/codex/src/app-server/event-projector.output-fidelity.native.test.ts` fails in every Linux Full Release Validation run for 2026.9.6 (runs 35743778013, 35761282770, 35776854018, 35802235259 attempts 1 and 2) with `Error: Expected native command execution` from `requireRecord`, while passing on macOS.

## Root cause (environment, not a runtime contract change)

The proof dials `codex app-server` directly with `sandbox_mode="read-only"`. Since Codex 0.154 bubblewrap is the only Linux sandbox (`use_linux_sandbox_bwrap` is `Stage::Removed`, `use_legacy_landlock` deprecated) and a read-only exec needs a user plus network namespace. The GitHub-hosted `ubuntu-24.04` shard (`checks-node-extensions-shard-1`, image 20260907.300.1) cannot configure loopback inside that namespace. The diagnostics from #154919 captured the real exec output on Linux CI (run 35612418856):

```
Process exited with code 1
Output:
bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted
```

`cat source.txt` never runs, app-server emits a `function_call_output` with the bwrap error but no `item/completed` with `type: "commandExecution"` for the call id, and the harness throws. The same symptom is already documented in `docs/plugins/codex-harness-reference/approval-and-sandbox.md` and probed by `openclaw doctor` for namespace-restricted Ubuntu/AppArmor hosts. It became deterministic on the 09-22 runner rotation; Codex 0.155.1 did not change the Linux sandbox path (`git diff rust-v0.154.0 rust-v0.155.1 -- codex-rs/linux-sandbox codex-rs/sandboxing` only adds WSL interop masking).

`settled-turn-finalizer.native.test.ts` passes on the same shard because it runs through the product path, which launches app-server with `--sandbox` from the resolved exec policy and therefore never enters bwrap.

## Fix

- Use `sandbox_mode="danger-full-access"` for this proof. It covers exec output fidelity (history truncation vs the provider-visible result), not sandboxing, and mirrors how product launches configure app-server. Every assertion stays in place.
- When the `commandExecution` item is missing, the failure message now lists the observed notifications (method, item type, id, status) and the first 500 chars of the exec output, so a future regression is self-describing. This folds in the diagnostics from #154919.

## Proof

- Local macOS, Node 24, `vitest.extension-database-workers.config.ts`: 5/5 runs green while the whole `extensions/codex/src/app-server` batch ran concurrently as load.
- Docker `ubuntu:24.04` with the 0.155.1 linux-arm64 binary: `codex sandbox -c sandbox_mode=read-only -- cat` fails with bwrap namespace errors under default confinement and succeeds only when the container may create namespaces; `danger-full-access` runs in both.
- `OPENCLAW_TESTBOX=1 pnpm check:changed`: see the landing log.

Related: #154919 (diagnostics-only PR, superseded by this change), #155989 (0.155.1 pin).
@roboclaw-bot roboclaw-bot mentioned this pull request Sep 24, 2026
2 of 8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: codex maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant