Skip to content

fix(codex): expose sandbox shell tools - #80590

Closed
steipete wants to merge 1 commit into
mainfrom
codex/sandbox-exec-routing
Closed

steipete wants to merge 1 commit into
mainfrom
codex/sandbox-exec-routing

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • Expose OpenClaw sandbox-routed shell access to Codex as sandbox_exec and sandbox_process only for active non-Docker sandbox backends such as SSH.
  • Keep Codex native shell enabled and keep plain OpenClaw exec / process filtered from Codex dynamic tools.
  • Require both OpenClaw exec and process to be available before exposing the sandbox pair, and rewrite yielded sandbox_exec follow-up guidance to point at sandbox_process.
  • Add regression coverage for backend gating, exclude handling, runtime allowlist mapping, missing-process fail-closed behavior, and yielded follow-up guidance.

Fixes #80322.

Root Cause

PR #80048 correctly made Codex own native workspace tools by default, but the app-server dynamic-tool filter also removed the only OpenClaw shell path that honored agents.list[].sandbox.backend for SSH-backed sandbox sessions. Codex native shell remains the right default shell, but it does not represent OpenClaw's non-Docker sandbox backend routing.

Verification

  • pnpm test extensions/codex/src/app-server/run-attempt.test.ts
  • git diff --check
  • pnpm check:changed

pnpm check:changed result: Codex touched lanes passed through typecheck/lint/import-cycle setup, but the delegated Testbox run still fails on an unrelated existing extension-test type error:

extensions/zalouser/src/zca-client.test.ts(20,19): error TS2339: Property 'options' does not exist on type ...

Latest changed-gate run: https://github.com/openclaw/openclaw/actions/runs/25657229446

@clawsweeper

clawsweeper Bot commented May 11, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open only because the protected maintainer label blocks automated cleanup; otherwise the PR is superseded by the merged replacement and current main/v2026.6.10 already contain the sandbox shell behavior with tests and release notes.

Root-cause cluster
Relationship: superseded
Canonical: #83667
Summary: This PR is the earlier branch for the Codex SSH sandbox shell routing fix; the merged replacement PR is the canonical landed implementation with live proof.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this PR as superseded by #83667.

So I’m closing this here and keeping the remaining discussion on #83667.

Review details

Best possible solution:

Close this PR as superseded by #83667.

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

Yes, at source level for the original regression: current main and v2026.6.10 contain the sandbox aliases and tests that restore the OpenClaw sandbox-routed shell path. I did not run a live SSH sandbox turn during this read-only review, but the merged replacement PR includes live Codex SSH sandbox proof.

Is this the best way to solve the issue?

No, this stale PR is no longer the best landing path. The best fix is the merged replacement implementation plus current-main hardening, with the separate direct/no-environment gap tracked by #92294.

Security review:

Security review cleared: No discrete supply-chain or security defect was found in the stale patch; the sandbox shell exposure is tracked as merge risk rather than a line-level security finding.

AGENTS.md: found and applied where relevant.

What I checked:

  • linked superseding PR: fix(codex): expose sandbox shell tools for ssh backends #83667 (fix(codex): expose sandbox shell tools for ssh backends) is merged at 2026-05-19T00:15:54Z.
  • cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • steipete: Authored this original branch and the merged replacement PR that landed the same sandbox shell routing behavior with live proof. (role: source and canonical fix contributor; confidence: high; commits: bd7558869e07, f27b4de7bebf, b4fdd1470b70; files: extensions/codex/src/app-server/run-attempt.ts, extensions/codex/src/app-server/run-attempt.test.ts, extensions/codex/src/app-server/dynamic-tool-build.ts)
  • kevinslin: Authored the merged dynamic-tool profile removal that the linked regression identified as making the SSH sandbox shell routing gap visible. (role: adjacent regression provenance contributor; confidence: medium; commits: b79de62b3c48; files: extensions/codex/src/app-server/dynamic-tool-profile.ts, extensions/codex/src/app-server/config.ts, extensions/codex/doctor-contract-api.ts)
  • joshavant: Authored later Codex sandbox hardening in the same native execution and sandbox-boundary area. (role: adjacent sandbox/native execution contributor; confidence: medium; commits: ba06376c7955; files: extensions/codex/src/app-server/run-attempt.ts, extensions/codex/src/app-server/sandbox-exec-server.ts, extensions/codex/src/app-server/sandbox-guard.ts)
  • vincentkoc: The released/current split dynamic-tool-build.ts implementation blames to the v2026.6.10 release commit, which is useful routing context for the current file shape. (role: recent current-code contributor; confidence: medium; commits: aa69b12d0086; files: extensions/codex/src/app-server/dynamic-tool-build.ts, extensions/codex/src/app-server/dynamic-tool-build.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865; fix evidence: release v2026.6.10, commit aa69b12d0086.

@keramblock

keramblock commented May 11, 2026 •

Copy link
Copy Markdown

tbh, I have my doubts that Codex will reliably work with sandbox_exec and sandbox_process if exec already exists in the tool list.

UPD: I used -c features.shell_tool=false to prevent ambiguity, in case that helps:

"appServer": {
            "transport": "stdio",
            "command": "codex",
            "args": [
              "app-server",
              "--listen",
              "stdio://",
              "-c",
              "features.shell_tool=false",
              "-c",
              "sandbox_workspace_write.network_access=true",
              "-c",
              "sandbox_workspace_write.writable_roots=[\"/home/node/.openclaw\",\"/data/backups\"]"
            ],
            "mode": "guardian"
          }

@clawSean

clawSean commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

I took a fresh rebase pass against current main to see whether this draft could be made mergeable.

Result: the conflict resolves to an empty branch. Current main already contains the sandbox shell dynamic-tool behavior this PR introduced, including sandbox_exec / sandbox_process, allowlist mapping, and the evolved sandbox/native-tool gating.

Evidence:

  • git rebase origin/main conflicted only in CHANGELOG.md, extensions/codex/src/app-server/run-attempt.ts, and extensions/codex/src/app-server/run-attempt.test.ts.
  • Resolving those conflicts by taking current main completed the rebase with no remaining commit.
  • git rev-parse HEAD origin/main both resolved to 5c4a733912a813df8fe583ddde556bda687f518b.
  • Current main already has the relevant implementation around addSandboxShellDynamicToolsIfAvailable, sandbox_exec, and sandbox_process.

So I do not think a replacement PR is useful here; #80590 looks superseded by current main rather than merely blocked by a mechanical conflict.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 14, 2026
@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Thanks @steipete for the original sandbox shell routing fix in #80590. Clownfish is closing this PR as fixed by the merged PR #83667 because current main already contains the same sandbox_exec / sandbox_process behavior, allowlist mapping, and sandbox/native-tool gating from that path.

Credit/attribution stays with @steipete: #80590 is the source PR for this same fix family, and #83667 carried the landed implementation and validation. If there is still a different reproduction path after #83667, please reply here and we can reopen or split follow-up work.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 24, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 28, 2026
@steipete

steipete commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded. #83667 merged and shipped the same Codex sandbox_exec / sandbox_process behavior with current gating, tests, and live SSH sandbox proof; rebasing this branch resolves to no unique change.

@steipete steipete closed this Jul 5, 2026
@shakkernerd
shakkernerd deleted the codex/sandbox-exec-routing branch October 19, 2026 23:17
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 merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

Beta blocker: codex - SSH-backed sandbox routing lost; app-server unconditionally strips exec/process from OpenClaw dynamic tools (#80048 regression)

3 participants