Skip to content

[2026.10.9] Preserve filesystem policy in Gateway-built tools - #187276

Merged
RomneyDa merged 5 commits into
release/2026.10.9from
openclaw/calm-shell
Oct 29, 2026
Merged

RomneyDa merged 5 commits into
release/2026.10.9from
openclaw/calm-shell

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Original attribution verified

The published tip directly descends from original authored candidate 5efa539bf99d7fbd2142ffd28c5ccac5dc0f69dc; original author identities, upstream references and RomneyDa coauthor trailers remain intact in PR history. Full ancestry verification supersedes the earlier tip-only attribution warning. Published tree is unchanged; no merge, history rewrite or force-push was necessary.

Publication recovery — DRAFT ONLY

The managed publisher originally selected main. The existing PR was retargeted to release/2026.10.8 on 2026-10-29 without changing its head. GitHub now reports exactly seven expected files. Published tree 02e5c6a698d63bc42d833c97d7d6733a2b48a39a exactly matches tested local candidate 5efa539bf99d7fbd2142ffd28c5ccac5dc0f69dc. Independent full-context review and hosted checks remain required.

Scope

Backport Agustin Rivera's #185094 (3e0c610) to release/2026.10.8. Derive omitted filesystem policy before asynchronous delegate preparation and synchronous tool construction. Preserve explicit overrides, session permission roots, read-only attachments, approval, cancellation and revocation enforcement.

Adaptation

Use the older inline createOpenClawToolsWithPreparation boundary. Regression coverage intercepts asynchronous preparation and proves the derived policy reaches the delegate. Historical inference fixtures pass their dependency adapter; real approval and persistence remain exercised.

Validation

  • Policy: 12 passed.
  • Media/preparation: 13 passed.
  • Full gateway tool-resolution: 19 passed, exit 0, covering persistent effects, approval, cancellation, run/precommit revocation and outside-root media denial.
  • Core TypeScript: passed using checkout-owned wrapper.
  • Source formatting and whitespace: passed.
  • Optional broader lint preparation stopped; no lint pass claimed.

Gates

DRAFT ONLY. Independent full-context review, hosted checks and release qualification remain outstanding. No ready-for-review or merge/release claim. No version, dependency, lockfile or release-validation changes.

shakkernerd and others added 3 commits October 27, 2026 13:12
Passive macOS Gateway stops now preserve an absent current-profile service definition without invoking uninstall, while explicit low-level ghost recovery remains available.

Release adaptation: the 2026.10.8 backport of #180390 removed the absent-plist
guard from GatewayLaunchAgentManager's disable path without main's follow-up,
so every passive stop with no LaunchAgent plist ran `openclaw gateway uninstall`
(mac validation: GatewayProcessManagerTests "pause preserves unretainable
services" [absent]). Stable has no migration-pending custody or `.authority`
wrapper, so the guard checks `custody.definition.plist` directly. Mac-only
post-tag fix; npm, Docker and Linux bytes are unaffected.

(cherry picked from commit cb10ec4)
…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 the older createOpenClawToolsWithPreparation capture before asynchronous delegation, and before synchronous assembly. 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]>
OpenClaw-Publication: 1566eb5f-7298-42a5-95d8-47bc24fe6e4e
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@RomneyDa RomneyDa changed the title [2026.10.8] Preserve filesystem policy in Gateway-built tools [BLOCKED: wrong base] [2026.10.8] Preserve filesystem policy in Gateway-built tools Oct 29, 2026
@RomneyDa
RomneyDa changed the base branch from main to release/2026.10.8 October 29, 2026 04:27
@RomneyDa RomneyDa changed the title [BLOCKED: wrong base] [2026.10.8] Preserve filesystem policy in Gateway-built tools [2026.10.8] Preserve filesystem policy in Gateway-built tools Oct 29, 2026
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: M labels Oct 29, 2026
@RomneyDa
RomneyDa marked this pull request as ready for review October 29, 2026 04:32
@RomneyDa

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 29, 2026
@clawsweeper

clawsweeper Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Derive omitted filesystem policy before Gateway tool preparation so delegation and media tools honor existing workspace restrictions.

Example: A Gateway tool requests config set logging.level debug with tools.fs.workspaceOnly: true.

  • Before: The delegate can classify the request as Full Access and persist the change without approval.
  • After: The change waits for approval, and cancellation or revoked run authority prevents persistence.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused backport with no production finding; confidence rests on reported in-process final-effect coverage, and one added spy test duplicates stronger coverage.
Proof confidence 🦐 gold shrimp (3/6) ✨ media proof bonus Sufficient (linked_artifact): The maintainer reports passing backport runs through the inspected production-path authority harness: real Gateway-resolved delegation, approval storage, config writes and media reads demonstrate permitted effects, restricted non-effects, cancellation, and pending/precommit revocation; external inference is deterministic scaffolding, and no live model or socket-Gateway proof is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Configured workspace restrictions can be lost when Gateway-built tools delegate administrative changes or read local media.
Reason: This maintainer-authored backport restores an existing documented permission contract without adding settings or changing approval policy.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored release backport open; it restores documented filesystem restrictions, and inspection found no introduced production defect.

Priority: P1
Reviewed head: d050fbe6f2c2a8aa65187dc93b85666a59ae5bff

Before merge

None.

Findings

None.

Tests

  • Low-value test src/agents/openclaw-tools.media-workspace.test.ts: Remove the spy-only preparation propagation test: the real Gateway final-effect cases already detect policy omission before delegate preparation, while this test pins internal call arguments.
  • Missing end-to-end proof: No shipped CLI or socket-Gateway run is supplied for this backport; failing-base evidence is recorded for the upstream repair.
Agent review details

How this fits together

Gateway and skill-dispatch callers construct tools through the shared agent factory; captured configuration and session permissions become policy inputs to delegation approval and media-file access.

flowchart TD
  A[Gateway or skill dispatch] --> B[Shared tool factory]
  C[Config and session permissions] --> B
  B --> D[Captured filesystem policy]
  D --> E[Delegate approval owner]
  D --> F[Media access owner]
  E --> G[Authorized config write]
  F --> H[Allowed image bytes]
Loading

Technical review

Best possible solution:

Retain the shared-factory policy repair and include this backport after the release branch's qualification gates are satisfied.

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

Source tracing confirms that omitted policy reaches consumers which interpret it as unrestricted; the upstream report records failing-base final-effect cases, but no target code was executed during this read-only review.

Is this the best way to solve the issue?

Deriving the missing input at shared construction boundaries fixes both callers while preserving the existing approval, persistence, permission-precedence, and media-access owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 54818f9e6756.

Provenance checked

  • Global and agent filesystem-policy precedence keeps the original intent (878b4e0: Centralize tools.fs.workspaceOnly resolution across agent execution paths.)
  • Task-workspace media access keeps the original intent (2433b00: Use the active task cwd and approved session root while preserving sandbox and attachment handling.)
  • Delegated Full Access approval keeps the original intent (6187bd6: Automatically apply permitted Full Access proposals while retaining human approval for restricted runs and live-authority checks before effects.)
  • Asynchronous delegate preparation keeps the original intent (ddcae51: Prepare source-bound exec policy asynchronously and preserve current-authority checks across preparation.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 878b4e0 adds src/agents/tool-fs-policy.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 878b4e0ed7cf; files: src/agents/tool-fs-policy.ts)

PR surface

Source +63, Tests +398. Total +461 across 7 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 64 1 +63
Tests 4 399 1 +398
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 463 2 +461

Review metrics

Metric Value Why it matters
Production versus test changes Production +64/-1; tests and support +399/-1 Production growth supplies shared policy derivation at both factories; most coverage exercises distinct persistent-effect and media boundaries.

Root-cause cluster

Relationship: same_root_cause
Canonical: #185094
Summary: The canonical main repair and these release-specific backports address the same omitted filesystem-policy input; their different target branches make them distinct landing work.

Members:

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

Labels

Label changes:

  • add P1: The affected release can bypass configured workspace restrictions for automatic administrative changes and local-media reads.
  • add merge-risk: 🚨 security-boundary: The change controls private Full Access classification and local-file disclosure; the reported final-effect harness covers permitted, restricted, cancelled, and revoked execution.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The affected release can bypass configured workspace restrictions for automatic administrative changes and local-media reads.
  • merge-risk: 🚨 security-boundary: The change controls private Full Access classification and local-file disclosure; the reported final-effect harness covers permitted, restricted, cancelled, and revoked execution.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 29, 2026, 12:39 AM ET / 04:39 UTC.

@RomneyDa
RomneyDa changed the base branch from release/2026.10.8 to release/2026.10.9 October 29, 2026 05:08
@openclaw-barnacle openclaw-barnacle Bot added the app: macos App: macos label Oct 29, 2026
@RomneyDa RomneyDa changed the title [2026.10.8] Preserve filesystem policy in Gateway-built tools [2026.10.9] Preserve filesystem policy in Gateway-built tools Oct 29, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the app: macos App: macos label Oct 29, 2026
@RomneyDa
RomneyDa merged commit 489d183 into release/2026.10.9 Oct 29, 2026
122 checks passed
@RomneyDa
RomneyDa deleted the openclaw/calm-shell branch October 29, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

4 participants