Skip to content

refactor: share sandbox filesystem parameter contracts - #143189

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-sandbox-fs-params-01a0750a
Sep 9, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-sandbox-fs-params-01a0750a

Conversation

@steipete

@steipete steipete commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #143186

What Problem This Solves

Sandbox filesystem implementations repeat parameter records already defined by their shared public contract. Independent copies increase the maintenance cost of keeping implementations aligned. This is part of the maintainer-requested code reduction campaign.

Why This Change Was Made

Twenty-four exactly matching multiline annotations now derive their parameters from the corresponding SandboxFsBridge method. Optional methods use NonNullable before extracting parameters; each concrete class retains its required methods and return types. The seven differing mxc signatures remain unchanged. No helpers, aliases, imports, runtime expressions, or SDK exports are added.

User Impact

No user-visible behavior or public API change. This removes 116 production code/physical lines across four files while keeping the existing filesystem contract as the single owner of those parameter fields.

Evidence

  • The patch is byte-identical after refreshing onto main with the separately landed Telegram fixture repair test(telegram): avoid stale sockets in the model callback fixture #143197 and standalone reset repair fix: standalone session resets stall during thinking lookup #143281.
  • All four complete files emit byte-identical JavaScript after TypeScript erasure.
  • Canonical OpenShell and mxc builds produce identical runtime/static output: three files, 126,518 bytes.
  • All 380 regenerated SDK declaration files are byte-identical: 3,504,296 bytes per side.
  • Canonical public API rendering is byte-identical across 152 entrypoints, 4,447 exports and 9,504 reachable declaration sections; the complete 14,623,526-byte JSON reports have no changes.
  • The full changed-file gate passed, including all four typecheck lanes, six existing doctor cases, formatting, lint, dependency, cycle and boundary guards. SDK export-map verification also passed.
  • Independent P2 review has no findings and remains applicable to the identical patch; refreshed source-contract checks retain the differing mxc signatures and OpenShell's concrete method presence.

No live sandbox or Gateway run is claimed for this erased-annotation change. The affected plugin builds and complete SDK/API output were verified; a full root runtime package build was not run. API rendering used the canonical command and its documented memory budget; declaration generation ran after the plugin builds completed.

Stored-data compatibility and CI

No serialized fields, filesystem operations, storage formats, schemas, migration rules or version markers change. The automated stored-data flag does not apply to these erased annotations, as confirmed by complete runtime and public API equivalence. The current source review independently disproves that concern; its remaining generated migration checklist is therefore not applicable.

The earlier CI failures were repaired at their owners in #143197 and #143281. This refreshed head still requires green hosted CI before landing.

@clawsweeper

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

@steipete
steipete marked this pull request as ready for review September 9, 2026 14:42
@steipete
steipete requested a review from a team as a code owner September 9, 2026 14:42
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: openshell plugin: mxc size: S maintainer Maintainer-authored PR labels Sep 9, 2026
@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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 9, 2026
@clawsweeper

clawsweeper Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 9, 2026, 2:16 PM ET / 18:16 UTC (Revision 4).

ClawSweeper review

What this changes

The PR derives sandbox filesystem parameter types from the existing shared contract while preserving each backend’s methods and runtime behavior.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open as a useful, narrowly scoped cleanup with no actionable findings. Current main retains the duplication. The previous migration-proof blocker is unsupported because the introduced changes affect only equivalent type annotations.

Priority: P3
Reviewed head: 6f5b4da715d593852e6def3bc34403834e9b23c5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, mechanically consistent refactor with no identified correctness defects or additional proof blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer-authored PR changes only erased annotations in the filesystem bridges and does not trigger the authority-chain gate; reported output-equivalence checks are relevant supplemental validation, with no live execution claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer-authored PR changes only erased annotations in the filesystem bridges and does not trigger the authority-chain gate; reported output-equivalence checks are relevant supplemental validation, with no live execution claimed.
Evidence reviewed 8 items Verified introduced scope: The complete merge-base-to-head diff changes only 24 parameter annotations. Method bodies, imports, return types, optional capability presence, and persistence operations remain unchanged.
Canonical contract matches: Each extracted parameter record matches the existing SandboxFsBridge contract; NonNullable handles optional interface methods without making concrete implementations optional. The contract remains unchanged.
Backend distinctions preserved: mxc retains its differing signal-less signatures; OpenShell retains concrete readDirectory and createFileExclusive methods. Plugins already import the contract through openclaw/plugin-sdk/sandbox, so no new SDK seam or dependency contract is introduced.
Findings None None.
Security None None.

How this fits together

Sandbox filesystem bridges translate agent file requests into guarded operations on local or remote workspaces. Their shared interface defines the parameters and optional capabilities available to tools and backend plugins.

flowchart LR
  A[Agent file requests] --> B[Shared filesystem contract]
  B --> C[Local sandbox bridge]
  B --> D[Remote sandbox bridge]
  B --> E[OpenShell and mxc plugins]
  C --> F[Existing path and write checks]
  D --> F
  E --> F
  F --> G[Filesystem results]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -116. Total -116 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 4 38 154 -116
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 38 154 -116

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: extensions/openshell/src/fs-bridge.ts, serialized state: src/agents/sandbox/fs-bridge.ts, serialized state: src/agents/sandbox/remote-fs-bridge.ts, unknown-data-model-change: extensions/openshell/src/fs-bridge.ts, unknown-data-model-change: src/agents/sandbox/fs-bridge.ts, unknown-data-model-change: src/agents/sandbox/remote-fs-bridge.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #143186
Summary: This PR implements the exact consolidation requested by the paired open issue.

Members:

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

Technical review

Best possible solution:

Keep the existing shared interface as the parameter owner while preserving backend-specific capabilities and signatures.

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

Not applicable: this is a refactor, and the duplicated parameter records are directly observable in current source.

Is this the best way to solve the issue?

Yes. Extracting parameters from the existing interface removes duplication without adding aliases, changing the public API, or broadening backend capabilities.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This is a type-only maintenance cleanup with no changed user-facing behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The maintainer-authored PR changes only erased annotations in the filesystem bridges and does not trigger the authority-chain gate; reported output-equivalence checks are relevant supplemental validation, with no live execution claimed.

Evidence

What I checked:

  • Verified introduced scope: The complete merge-base-to-head diff changes only 24 parameter annotations. Method bodies, imports, return types, optional capability presence, and persistence operations remain unchanged. (src/agents/sandbox/fs-bridge.ts:71, 6f5b4da715d5)
  • Canonical contract matches: Each extracted parameter record matches the existing SandboxFsBridge contract; NonNullable handles optional interface methods without making concrete implementations optional. The contract remains unchanged. (src/agents/sandbox/fs-bridge.types.ts:24, 87b7cad2014b)
  • Backend distinctions preserved: mxc retains its differing signal-less signatures; OpenShell retains concrete readDirectory and createFileExclusive methods. Plugins already import the contract through openclaw/plugin-sdk/sandbox, so no new SDK seam or dependency contract is introduced. (extensions/mxc/src/fs-bridge.ts:74, 6f5b4da715d5)
  • Still useful on current main: The four affected implementations and shared contract have no changes between the pinned merge base and fetched main; main therefore still contains the duplicated annotations. (src/agents/sandbox/fs-bridge.ts, 87b7cad2014b)
  • Latest release comparison: The v2026.9.3 source still declares readFile and readDirectory parameter records inline; this cleanup is not already present there. (src/agents/sandbox/fs-bridge.ts, 1391f7cd2d40)
  • Proof and review continuity: The captured body reports identical emitted JavaScript, plugin output, SDK declarations, and public API rendering, and explicitly claims no live sandbox run. The previous same-head review had no findings; its migration checklist has no introduced storage boundary to support it. These validation claims were not rerun during this read-only review. (6f5b4da715d5)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Sally O'Malley: 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-09-09T14:50:36.538Z sha 7fb265c :: blocked before merge. :: none
  • reviewed 2026-09-09T15:12:21.244Z sha 7fb265c :: blocked before merge. :: none
  • reviewed 2026-09-09T18:03:45.906Z sha 6f5b4da :: blocked before merge. :: none

Use the existing SandboxFsBridge method parameter types at matching implementation annotations. Preserve concrete capabilities and mxc signal-less signatures. Verified identical emitted runtime files, plugin builds, all SDK declarations and public API, plus full changed checks and independent P2 review.
@steipete
steipete force-pushed the codex/refactor-sandbox-fs-params-01a0750a branch from 7fb265c to 6f5b4da Compare September 9, 2026 17:57
@steipete
steipete merged commit 10af9ba into main Sep 9, 2026
187 checks passed
@steipete
steipete deleted the codex/refactor-sandbox-fs-params-01a0750a branch September 9, 2026 18:30
@steipete

steipete commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 10, 2026
Use the existing SandboxFsBridge method parameter types at matching implementation annotations. Preserve concrete capabilities and mxc signal-less signatures. Verified identical emitted runtime files, plugin builds, all SDK declarations and public API, plus full changed checks and independent P2 review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: openshell maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: mxc rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

Consolidate duplicated sandbox filesystem parameter contracts

1 participant