Repository navigation
[2026.10.10-beta.5] Preserve filesystem policy in Gateway-built tools - #187307
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 in branch-local preparation and synchronous assembly while retaining existing auth preparation ordering. 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 real behavior proof before merge. What this changesThis PR derives omitted filesystem policy before constructing Gateway-backed delegation and media tools. Example: A Gateway caller has tools.fs.workspaceOnly=true and requests logging.level=debug through the openclaw tool.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 3 items remain Keep open: this maintainer-authored backport restores configured filesystem restrictions on the release branch, and source review found no concrete introduced correctness defect. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherGateway and skill callers construct shared agent tools; captured session and configuration policy governs delegated administrative changes and local media access. flowchart TD
A[Gateway or skill caller] --> B[Shared tool preparation]
C[Session and configuration policy] --> B
B --> D[Filesystem policy resolver]
D --> E[Delegate approval owner]
D --> F[Media access owner]
E --> G[Persistent configuration writer]
F --> H[Allowed local files]
Technical reviewBest possible solution: Retain the shared policy derivation and existing effect owners, then qualify the backport with inspectable final-effect results. Do we have a high-confidence way to reproduce the issue? The release-base factory omits policy derivation while delegation interprets absent workspace restriction as potentially Full Access; current main contains the repair, and no reproduction was executed during this read-only review. Is this the best way to solve the issue? The backport addresses the missing producer input in both construction paths while preserving explicit overrides, session precedence, attachment exceptions, and existing approval enforcement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54818f9e6756. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: in-process harness. SecurityNeeds attention: Source review found no introduced bypass, but branch-specific final-effect execution evidence remains unverified. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +61, Tests +398. Total +459 across 8 files. Added test files: 1. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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:40 AM ET / 04:40 UTC. |
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
Apply the same policy derivation in the existing preparation module and synchronous factory; preserve branch-local auth preparation ordering. Added an interception regression at the asynchronous delegate-preparation boundary.
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.