Repository navigation
[2026.9.36] Preserve filesystem policy in Gateway-built tools - #187308
Conversation
…spaceOnly reaches the delegate and media tools (#185094) * fix(agents): derive fsPolicy for Gateway-built OpenClaw tools so workspaceOnly reaches the delegate and media tools * test(gateway): prove workspace policy at delegation and media sinks Backport adaptation (#185094): Resolve policy before synchronous hosted gateway/delegate and media assembly; this train has no separate asynchronous preparation module. Keep branch-local policy unit fixtures; wire the historical inference test dependency fixture and add factory-level restriction/override regressions. (cherry picked from commit 3e0c610) Co-authored-by: RomneyDa <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR derives omitted filesystem policy before Gateway-built delegate and media tools are constructed. Example: With tools.fs.workspaceOnly=true, a Gateway-built delegate receives config set logging.level debug.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored backport repairs a filesystem-policy bypass still present on the extended-stable base; no actionable introduced defect was found. Priority: P1 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway tool resolution supplies configuration and session context to the shared tool factory, which passes filesystem restrictions to existing delegation, approval, and media-access owners. flowchart TD
A[Gateway tool resolution] --> B[Shared tool factory]
C[Config and session policy] --> B
B --> D[Captured filesystem policy]
D --> E[Delegate approval owner]
D --> F[Media access owner]
E --> G[Guarded config write]
F --> H[Allowed file bytes]
Technical reviewBest possible solution: Retain the synchronous shared-factory backport while leaving approval, live-authority enforcement, and media validation with their existing owners. Do we have a high-confidence way to reproduce the issue? The extended-stable parent omits policy derivation, while the delegate interprets absent workspaceOnly as unrestricted and media resolution admits default roots; fetched main already contains the upstream repair. Is this the best way to solve the issue? Deriving omitted policy at shared construction fixes the missing input without duplicating enforcement or importing the newer asynchronous preparation architecture. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54818f9e6756. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +63, Tests +373. Total +436 across 7 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 29, 2026, 12:41 AM ET / 04:41 UTC. |
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
…187308) Co-authored-by: RomneyDa <[email protected]>
Only the immutable options adapter is consumed across modules. Keep its implementation helper private so the full export inventory reflects the actual public surface. Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Scope
Focused backport of Agustin Rivera's #185094, source commit 3e0c610. Derive an omitted fsPolicy from the captured session/config policy before delegate and media tool construction. Preserve explicit policy overrides, session permission roots and read-only attachment roots. No approval/cancellation/revocation enforcement is removed.
Adaptation
This train predates asynchronous OpenClaw tool preparation. Derive in the synchronous factory before createHostedGatewayTools delegates and before media factories; do not import the newer preparation architecture.
The upstream unit tests use the existing branch-local config fixture shape; the historical inference fixture passes its dependency adapter to preserve route re-verification while keeping approval and persistence real. Additional factory regressions cover global and per-agent workspace restrictions plus explicit unrestricted overrides.
Validation
Review gates
Draft only. Independent full-context review, required hosted checks, and release qualification remain outstanding. This does not claim ready-for-review, merge approval, or release inclusion. No version, dependency, lockfile, or release-validation changes.