Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Branch status verified after creation: GitHub reports |
|
Codex review: needs real behavior proof before merge. What this changesThe branch adds plugin file-stream capabilities, durable session-owned resources, artifact discovery and downloads, and tools for transferring files into and out of execution workspaces. Review scores
Merge readiness⛔ Blocked before merge - 25 items remain This remains a distinct capability proposal that current main does not provide. The prior boundary defects remain in the pinned head, and the reported Gateway coverage does not establish safe factory-bound access or existing-state compatibility. Likely related people: steipete for recent managed-media work and VACInc for plugin invocation authority, both with medium routing confidence. Priority: P2 Decision needed
Before merge
Findings
Agent review detailsHow this fits togetherPlugin tools receive external file streams and place them under OpenClaw’s managed-media custody. Session ownership controls discovery and downloads, while the execution workspace handles file processing and export. flowchart LR
A[External file stream] --> B[Plugin file capability]
B --> C[Managed media custody]
C --> D[Session ownership]
D --> E[Artifact discovery and downloads]
C --> F[Execution workspace]
F --> G[Processed file export]
G --> C
Technical reviewBest possible solution: Keep native custody as the single owner, with an explicitly approved file contract, complete authority at final I/O, and verified existing-state compatibility. Do we have a high-confidence way to reproduce the issue? Yes for the patch defects: source establishes retained-capability revocation, closure during write preparation, incorrect sandbox placement, and replacement during HTTP preparation as concrete triggers. They were not executed in this read-only review. Is this the best way to solve the issue? Unclear: extending native custody avoids duplicate storage ownership, but the lifetime and placement choices need approval and complete authority must reach final effects. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f0f0e3aa47bb. Merge-risk optionsMaintainer options:
SecurityNeeds attention: The introduced capabilities leave concrete revocation, placement, confinement, and stale-session disclosure failures. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +1664, Tests +1365, Other +2. Total +3031 across 33 files. 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: No label 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 HistoryReview history (14 earlier review cycles; latest 8 shown)
Reviewed October 2, 2026, 11:23 AM ET / 15:23 UTC (Revision 15). |
640a89d to
c4b974f
Compare
c4b974f to
b87034f
Compare
b87034f to
6137c83
Compare
bd1432d to
661252c
Compare
…and discovery
Close the V11 hardening blockers.
- Export reads bytes only from a natively safe-opened descriptor: open-local
no-follow, canonical containment inside the workspace root, hardlink and
non-regular-file rejection, then stream from that exact handle. Final and
intermediate symlink escapes and hardlinks now fail closed; no lexical
resolve is an authorization boundary.
- Projection staging is scoped to the exact native sessionId, so a reset or
generation replacement never mounts the previous generation's bytes.
- Mounted (read-only mount + native copy) materialization now tracks and removes
its writable workspace copy at run cleanup; cleanup is idempotent and never
removes the durable Session Resource.
- Materialize preflights the trusted durable size before opening a descriptor,
so an oversized request cannot leak an unread stream.
- Projection ceilings are independent: mount+copy materialize advertises the
resource ceiling (streaming staging) while export stays bounded separately.
- Provider API drops placement identity: materialize returns
`{ workspacePath, size }` and export takes `workspacePath` only.
- Discovery: `cleanup_pending` session resources are excluded, and the
`source: "session-resource"` classification is stable across
list/get/download.
- Tests: symlink/intermediate-symlink/hardlink escape, lifecycle cleanup with
durable-resource survival, generation-scoped staging, cleanup-pending
exclusion, and Gateway E2E source consistency plus physical-replacement denial.
Co-authored-by: Copilot <[email protected]>
Upstream renamed the E2E port helper to `acquireGatewayE2ePortBlock` in `test-helpers.listener.js`; update the session-resource Gateway test to the current claim/release API. Co-authored-by: Copilot <[email protected]>
…ialize safe-write Follow-up to the projection hardening. - Do not change sandbox scope for this PR: drop the session-resource read-only mount, the sessionId threading into sandbox provisioning, and the mount+native-copy projection. Sandbox materialize/export use the generic bridge projection and report their bounded projection ceilings honestly. - Host materialize opens its destination through the native safe-write boundary (`fsSafeRoot(...).openWritable`, mutation symlinks rejected) and streams chunks to that handle, closing the write-side TOCTOU. Export still reads from a natively safe-opened descriptor. - Remove the now-unused projection-paths module and mount tests. Co-authored-by: Copilot <[email protected]>
… internal - Register each materialize destination before the write starts and, on failure or cancellation, close the descriptor first and then remove the partial output (local), or remove the partial destination (bridge). Add partial-write and cancellation cleanup tests. - Derive bridgeProjection materialize and export ceilings independently from the primitive each direction actually uses, instead of forcing both to one value. - Stop re-exporting PluginToolFilesBackend from the plugin public barrels; the execution placement label stays internal. Co-authored-by: Copilot <[email protected]>
…source E2E Upstream now requires explicit surface owners for legacy `agents.entries` default markers; the E2E config uses only an explicit workspace entry. Co-authored-by: Copilot <[email protected]>
b4a0eda to
9bd5ed1
Compare
|
Fix the checks that gate the PR once it leaves draft. - Break the `managed-image-attachments <-> session-resource-store` import cycle by extracting the `ManagedOutgoingMediaArtifactDownload` shape to a leaf contract module. - Keep execution placement identity internal: un-export the projection and retention helpers (and the internal constants) that only their own module uses; route tests through production entry points (`resolveSessionResourceProjection`, `shouldReclaimSessionResource`, `resolveSessionResourceArtifactDownload`). - Remove now-dead `toSessionResourceMetadata` and the newly exported constants. - Add tool-display metadata for `artifact_materialize`/`artifact_export` and regenerate the tool-display snapshot. - Drop the new non-const type assertions instead of annotating them. - Pin the plugin SDK public-export budget to the current count (3641). - Fix the E2E/tests for the current `SessionAccessScope` and `ManagedOutgoingMediaArtifactDownload` shapes. Co-authored-by: Copilot <[email protected]>
Rebuilt on current
main(7a62f6ec184f2e2c9dbb7ddd6cc1a848e359531b); final head9bd5ed1ac361cc13e9cbd0718701e180b77a2c35.28files changed (3161insertions,159deletions). Related: #162529.What Problem This Solves
Fixes: trusted plugins cannot stream an external provider file (for example a
Microsoft Graph download) into the current OpenClaw session as a durable,
discoverable resource without putting base64 file contents or host filesystem
paths into model-visible tool results.
User Impact
User impact: plugin authors can
importStream()provider bytes into the currentadmitted session and get back an opaque
artifactRef; the resource isdiscoverable through the existing
artifacts.list/get/downloadAPIs, survives aGateway restart while the exact session is retained, and can be projected into
and read back from the active execution workspace for processing.
There is no user-visible change to existing chat uploads, media, or
attachments, and their limits are unchanged. Providers do not need to know the
execution placement. This adds no new artifact database, ACL model, GC
scheduler, or cron/subagent principal.
Why This Change Was Made
The change extends OpenClaw's existing session attachment/artifact custody
with one missing generic seam instead of adding a parallel framework:
Native custody is reused: the managed outgoing media/document record gains a
sessionretention class with the exact nativesessionId, SHA-256 and minimalnon-secret provenance; bytes are ingested through the existing
saveMediaStream()(incremental, bounded, atomic) and read through
openMediaStream(). Discoveryreuses
artifacts.*; lifecycle/cleanup reuses the native session store(
retained/gone/unavailable, fail-safe keep).Ownership is by
sessionKeyplus exactsessionId: a copiedartifactRefis a locator, not a credential, and a
/resetreplacement stops disclosing theprevious generation.
Execution projection is placement-neutral.
ctx.filesconsumes aSessionResourceProjectionsupplied by the current execution placement(
AgentWorkspaceAccess/ native local execution); the Session Resource layernever selects sandbox/host/remote. Export reads bytes only from a natively
safe-opened descriptor (canonical containment inside the workspace root;
symlinks, hardlinks and non-regular files rejected); local materialize writes
through the native safe-write boundary and owns any partial output for cleanup.
Provider-facing capacity is split:
Resource capacity and execution-projection capacity are reported independently;
each projection direction derives its own ceiling from the primitive it uses,
so a bounded direction advertises its own lower ceiling rather than reducing the
resource ceiling.
materializereturns{ workspacePath, size }andexporttakes
workspacePath; the execution placement label is not part of the providercontract.
api.session.workflow.sendSessionAttachment()is deliberately not used: it isoutbound delivery of existing local files, not durable current-session provider
ingestion.
Evidence
GitHub Actions on the final head:
resolve,dispatch,label,PR context and evidence,TypeScript contracts,Rust workspace,actionlint,auto-responsepass. TheCritical Quality(CodeQL boundary)suite is gated on a non-draft PR and currently skips; it runs when the PR is
marked Ready.
The real-Gateway E2E proves: session-resource import →
artifacts.list→artifacts.get→artifacts.download→ HTTP bytes → Gateway restart →list/get/download again, with
source: "session-resource"stable acrosslist/get/download and a physical session replacement (same key, new
sessionId)denying the old resource.
Security/lifecycle proof: final/intermediate symlink escapes rejected, hardlink
rejected, valid confined file streams; failed or cancelled materialize removes
its partial output (local and bridge) while the durable resource survives;
oversized
materializefails explicitly without leaking a descriptor;cleanup-pending resources excluded from discovery.
Office365 is a motivating consumer, not a core dependency. Its branch adopts the
same contract and, in
probeStatus, withholds a stored proof once a differentgeneration has been observed for the logical session (a best-effort observation
check, not an authoritative session-store read).
Gaps / not done: no remote/cloud execution placement is implemented here
(they use their backend's own transfer, reported through
projection.*MaxBytes);sandbox command-transport streaming-stdin is left as a separate execution-runtime
follow-up rather than expanding this PR; the CodeQL Critical Quality suite runs
only once the PR is marked Ready.