Skip to content

feat: read agent documents from a host-owned workspace - #150584

Merged
Kimiyu-186 merged 6 commits into
mainfrom
codex/workspace-access-foundation
Sep 18, 2026
Merged

Kimiyu-186 merged 6 commits into
mainfrom
codex/workspace-access-foundation

Conversation

@Kimiyu-186

@Kimiyu-186 Kimiyu-186 commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Gateway reads Agent documents and bootstrap context from its local filesystem, even when a separate harness host owns the workspace.

User Impact

A host plugin can route the existing document editor, identity form, bootstrap loading, and post-compaction reads to that workspace. Unconfigured workspaces retain local behavior; stopped remote access does not select a stale local copy.

Why This Change Was Made

Bind an existing SandboxFsBridge for the host service lifetime, independently of harness turns. The narrow agent-workspace-runtime SDK entrypoint avoids importing the agent execution runtime just to register file access. Keep the document allowlist and best-effort save-conflict checks. Reads report their actual source so Memory Core can apply its existing context filters.

This is the document/bootstrap portion of storage separation. Memory file access, Skills, attachments, and provisioning have separate integration changes.

Evidence

  • Earlier candidate validation passed the native build, core/extension types, changed-file lint, unused-export checks, and document/bootstrap caller tests. Twelve Linux-only bridge cases were not run on macOS.
  • Rebased to fixed main 130c584843baaac2342a9024564943f1c112647c; validated runtime candidate b16c599032b. Ten relevant test files passed: 285 tests, 20 platform skips. Core types, SDK surface check and the complete build passed on Node 24.19 with the checked-in frozen lockfile. This is local evidence, not deployed model E2E.
  • Three independent reviews completed; accepted document-access findings were fixed and verified.
  • Current head 014e0ccd3f2 also passes 10 SDK tooling tests and 24 test-shard tooling tests. Its SDK budget matches its actual exports; later PRs add their own required exports. The two added agent test files use a shard with available capacity; the shard limit is unchanged. Remote shell bootstrap fixtures skip Windows; the 12 focused bootstrap checks pass on macOS.
  • Releasing workspace access rejects new calls and stale results; it does not undo a write already dispatched. This accepted timing limit is documented on the registration API.

Scope and remaining integration work: OCE #76. No merge or deployment is part of this update.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime extensions: memory-core Extension: memory-core agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 17, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 18, 2026, 6:17 PM ET / 22:17 UTC (Revision 6).

ClawSweeper review

What this changes

Adds a plugin-provided workspace binding so document editing, identity updates, bootstrap instructions, and post-compaction reads can use files owned by another host.

Merge readiness

⛔ Blocked before merge - 3 items remain

This remains useful work: current main and the latest release still read agent documents locally. No actionable patch defect remains supported by this review; the prior write-lifecycle concern has an explicit documented disposition.

Priority: P2
Reviewed head: 014e0ccd3f256ba6554f7fea8b988120c7592273

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A coherent foundation with focused boundary coverage, documented integration limits, and no supported blocking correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied Repository State classifies the author as MEMBER, so ordinary external-contributor proof is exempt. The document and bootstrap owners have reported boundary-test validation, but no deployed host run is claimed; the accepted dispatched-write limit is not treated as proof of cancellation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied Repository State classifies the author as MEMBER, so ordinary external-contributor proof is exempt. The document and bootstrap owners have reported boundary-test validation, but no deployed host run is claimed; the accepted dispatched-write limit is not treated as proof of cancellation.
Evidence reviewed 9 items Pinned introduction and review continuity: Reviewed the merge-base-to-head changes at 014e0cc. GitHub's exact-head commit patch confirms that the newest commit only adjusts SDK budgets and test-shard membership. The previous completed review had no findings. A local previous-head comparison encountered an unavailable blob; GitHub's commit patch supplied that comparison instead.
Current main still uses local document access: Current-main agents.files.get opens the Gateway-local workspace root, and agents.files.set writes through that local root. The inspected bootstrap reader likewise uses local guarded file opens; this foundation is not already implemented there.
Latest-release behavior: The v2026.9.4 source also implements agents.files.get through workspaceRoot.read. The release check does not establish a shipped replacement for this PR.
Findings None None.
Security None None.

How this fits together

Gateway document requests and agent context preparation currently consume workspace files. The new binding selects a host-provided filesystem bridge while retaining local access for unconfigured workspaces and existing document restrictions.

flowchart TD
  A[Document requests] --> C[Workspace access owner]
  B[Agent context preparation] --> C
  C --> D{Remote workspace declared?}
  D -->|No| E[Local filesystem]
  D -->|Ready| F[Host filesystem bridge]
  D -->|Stopped| G[Explicit failure]
  E --> H[Documents and filtered context]
  F --> H
Loading

Before merge

  • Resolve merge risk (P1) - Downstream host adoption is not deployment-proven here: missing source-aware reads can block bootstrap, and unsupported Memory classifiers exclude automatic remote context.
  • Resolve merge risk (P1) - A remote write already dispatched when access stops may complete despite the caller receiving an error; the documented contract does not provide rollback or outcome reconciliation.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +543, Tests +934, Docs +50, Config +4, Other +7. Total +1538 across 36 files.

View PR surface stats
Area Files Added Removed Net
Source 16 1099 556 +543
Tests 13 1365 431 +934
Docs 2 50 0 +50
Config 1 4 0 +4
Generated 0 0 0 0
Other 4 11 4 +7
Total 36 2529 991 +1538

Review metrics

Metric Value Why it matters
Public SDK expansion 1 subpath, 3 functions, 1 exported type The narrow workspace entrypoint is documented and has a concrete paired-node consumer.
Production and test growth Production +543 net lines; tests and test support +934; tooling +7 Production growth implements shared remote access and source provenance while retaining the existing local paths.

Stored data model

Persistent data-model change detected: serialized state: src/agents/workspace-access.ts, unknown-data-model-change: extensions/memory-core/src/memory/memory-path-provenance.ts, unknown-data-model-change: src/agents/workspace-access.ts, vector/embedding metadata: extensions/memory-core/index.ts, vector/embedding metadata: extensions/memory-core/src/memory/memory-path-provenance.ts, vector/embedding metadata: extensions/memory-core/src/runtime-provider.ts, and 1 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the documented opt-in contract (recommended)
    Accept the stated bridge requirements and write-completion limit for this foundation, with rollout verification owned by the consuming host integrations.

Technical review

Best possible solution:

Keep remote ownership explicitly opt-in through the shared bridge, with consuming integrations proving their capability requirements before replacing production workspace synchronization.

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

Not applicable as a defect reproduction: this adds remote document access, and source inspection confirms the existing main and release paths are local.

Is this the best way to solve the issue?

Yes. Reusing the filesystem bridge behind one lightweight workspace owner is a focused solution, and the documentation clearly separates this foundation from the remaining remote-host integrations.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 085e19b4593f.

Labels

Label justifications:

  • P2: This is a bounded remote-workspace capability without evidence of an urgent existing-user regression.
  • merge-risk: 🚨 compatibility: The new plugin contract requires source-aware bridge capabilities and changes failure behavior only for explicitly adopted remote workspaces.
  • 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 supplied Repository State classifies the author as MEMBER, so ordinary external-contributor proof is exempt. The document and bootstrap owners have reported boundary-test validation, but no deployed host run is claimed; the accepted dispatched-write limit is not treated as proof of cancellation.

Evidence

What I checked:

  • Pinned introduction and review continuity: Reviewed the merge-base-to-head changes at 014e0cc. GitHub's exact-head commit patch confirms that the newest commit only adjusts SDK budgets and test-shard membership. The previous completed review had no findings. A local previous-head comparison encountered an unavailable blob; GitHub's commit patch supplied that comparison instead. (scripts/plugin-sdk-surface-report.mts:382, 014e0ccd3f25)
  • Current main still uses local document access: Current-main agents.files.get opens the Gateway-local workspace root, and agents.files.set writes through that local root. The inspected bootstrap reader likewise uses local guarded file opens; this foundation is not already implemented there. (src/gateway/server-methods/agents.ts:1563, 085e19b4593f)
  • Latest-release behavior: The v2026.9.4 source also implements agents.files.get through workspaceRoot.read. The release check does not establish a shipped replacement for this PR. (src/gateway/server-methods/agents.ts:1558, 3a9d69db306c)
  • Binding lifecycle and accepted timing limit: The binding rejects duplicate ownership, checks liveness before bridge invocation and after completion, and retains a stopped declaration instead of exposing local files. Its API documents that release cannot undo an already-dispatched write. The author explicitly accepts that scoped limitation in feat: read agent documents from a host-owned workspace #150584 (comment); this review does not reclassify it as an eliminated race. (src/agents/workspace-access.ts:22, 014e0ccd3f25)
  • Source-aware context and integration boundary: Remote bootstrap requires source-aware reads, records source metadata in cache identity, and checks binding continuity. Documentation explicitly requires directory reads for globs and classifier support for automatic remote Memory context. This is a generic OpenClaw filesystem contract; the changed behavior does not depend on the Codex runtime or protocol. Public docs: docs/plugins/sdk-agent-harness/core-ownership.md. (docs/plugins/sdk-agent-harness/core-ownership.md:61, 014e0ccd3f25)
  • Authorization and negative-path coverage: Existing method descriptors retain operator.read for document reads and operator.admin for document writes and identity updates. Inspected tests cover retained capabilities after release, replacement during identity reads, revoked bootstrap results, source aliases, local decoys, and concurrent expectedHash saves. Tests were inspected, not executed in this read-only review. (src/gateway/methods/core-descriptors.ts:177, 014e0ccd3f25)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • vincentkoc: 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 (5 earlier review cycles)
  • reviewed 2026-09-17T04:30:27.170Z sha 7bedd2f :: needs real behavior proof before merge. :: [P1] [P1] Fence pending bridge writes when workspace access is released
  • reviewed 2026-09-17T06:44:00.093Z sha b453f4f :: needs real behavior proof before merge. :: [P1] [P1] Fence pending bridge writes when workspace access is released
  • reviewed 2026-09-18T00:14:03.679Z sha eeb5578 :: needs real behavior proof before merge. :: [P1] [P1] Fence pending bridge writes when workspace access is released
  • reviewed 2026-09-18T20:32:09.252Z sha eeb5578 :: needs real behavior proof before merge. :: [P1] [P1] Fence pending bridge writes when workspace access is released | [P2] [P2] Gate subprocess-backed bootstrap tests on supported hosts
  • reviewed 2026-09-18T21:54:13.851Z sha b16c599 :: blocked before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 17, 2026
@Kimiyu-186
Kimiyu-186 marked this pull request as ready for review September 18, 2026 20:26
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph guard cleared

This PR no longer has blocked dependency graph changes. A future dependency graph change requires a fresh /allow-dependencies-change comment after the guard blocks that new head SHA.

  • Current SHA: 014e0ccd3f256ba6554f7fea8b988120c7592273

@Kimiyu-186

Copy link
Copy Markdown
Contributor Author

Following up on the ClawSweeper review:

  • Fixed the unsupported Windows shell fixture selection. The corresponding 12 bootstrap checks pass on macOS; Linux-only bridge coverage is not reported as passing there.
  • Moved the already-approved workspace SDK budget into this first consumer PR; the surface check passes.
  • The pending-write observation is a real timing limit, not a claim that post-operation checking cancels filesystem I/O. The registration API now explicitly states that stopping access rejects new calls/stale results but cannot undo a dispatched write. We accept that limit for this release rather than introduce task-wide draining/rollback. Ordinary document authorization and path restrictions remain required.

The remote workspace still never falls back to a stale local copy. OCE #76 records this distinction and the remaining deployment evidence. This is a scope decision, not proof that the race has been eliminated.

@clawsweeper clawsweeper Bot added 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 rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 18, 2026
@Kimiyu-186
Kimiyu-186 force-pushed the codex/workspace-access-foundation branch from 9ee468d to b16c599 Compare September 18, 2026 21:44
@github-actions github-actions Bot removed the dependencies-changed PR changes dependency-related files label Sep 18, 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 Sep 18, 2026
@Kimiyu-186
Kimiyu-186 enabled auto-merge (squash) September 18, 2026 22:46
@Kimiyu-186
Kimiyu-186 merged commit ce616b6 into main Sep 18, 2026
228 checks passed
@Kimiyu-186
Kimiyu-186 deleted the codex/workspace-access-foundation branch September 18, 2026 22:46
vincentkoc added a commit that referenced this pull request Sep 18, 2026
…pr-149099-main-20260918

* commit '795e460278d4f8f41545dc8b4a66da1d12defd90': (1902 commits)
  refactor(slack): share Markdown preparation (#149129)
  fix(tooling): release completed PR operations with exited loaders (#152209)
  fix(release): allow stable npm bootstrap under an operator soak waiver (#152206)
  fix(daemon): avoid false restart timeouts during slow startup (#151387)
  feat: read agent documents from a host-owned workspace (#150584)
  improve(startup): skip redundant single-agent directory checks (#152192)
  test(ui): await board widget readiness before size reports (#152198)
  perf(browser): move dashboard event discovery to SQLite worker (#151952)
  improve(auth): reduce pauses during concurrent credential reads (#152140)
  improve(ui): load older chat history in smaller pages (#152093)
  fix(release): reject incomplete legacy npm install trees (#152186)
  refactor: share current-conversation binding row serialization (#152134)
  test(tooling): preserve Node and terminal fixture ownership under Bun (#152187)
  fix(sqlite): service worker admission through retained path aliases (#152190)
  improve: reduce CPU work for long CLI reasoning streams (#152191)
  chore(ui): refresh control ui locales (#152196)
  test(subagents): align lifecycle retries with durable completion owners (#152184)
  perf(gateway): defer participant maps for owned sessions (#152097)
  refactor(stream): share auxiliary queue overflow handling (#149282)
  fix(test): execute CLI fixture preloads on Node and Bun (#152076)
  ...
etzelm pushed a commit to etzelm/openclaw that referenced this pull request Sep 19, 2026
Resolve the plugin-SDK surface budget conflict in
scripts/plugin-sdk-surface-report.mts as a union of both sides.

main (openclaw#150584, host-owned workspace access) raised publicExports
4485 -> 4489 and publicFunctionExports 2649 -> 2652. This branch had
raised the same two counters by +1 each for the shared grapheme-safe
chunk boundary helper. Both sides' justification comments are kept at
their original insertion points; the totals are the values reported by
the repo's own surface script, not hand-computed:

  public package SDK entrypoints:
    entrypoints: 155
    unique entrypoint-qualified exports: 4490
    callable exports: 2653

The third budget (entrypoints 154 -> 155) is main's alone and merged
without conflict.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation extensions: memory-core Extension: memory-core gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: XL 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.

1 participant