Skip to content

fix(file-transfer): directory tools hide filenames from direct model calls - #138542

Merged
steipete merged 1 commit into
mainfrom
steipete/youthful-mccarthy-a13751
Sep 4, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/youthful-mccarthy-a13751

Conversation

@steipete

@steipete steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Closes #138480

Related: #137213 (File Fetch saved-media receipt and standalone-tool guidance).

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers can help update the branch when needed.

What Problem This Solves

Fixes an issue where users asking an agent to inspect or fetch a paired-node directory would receive a successful operation but no usable filenames when the model used direct/traditional tool calls. dir_list exposed only counts and a page token. dir_fetch exposed only the saved root/count and sometimes directed the model to a manifest it could not see.

Why This Change Was Made

Repair the File Transfer producers, not provider serializers: return a whole-record prefix within an 8192-byte UTF-8 budget that includes security wrapping, with listing continuation immediately after the last displayed entry and explicit saved-manifest omissions for fetches. Preserve the full structured result, original node pagination, media metadata and selection, filesystem/path authorization, archive validation, integrity checks, and cleanup; Tool Search raw tool_call and Code Mode deliberately use structured details and keep their existing contracts.

User Impact

Direct tool callers can discover remote names, distinguish files from directories, and use saved rootDir plus relPath for local follow-up work. Listing text may be shorter than the node's returned page; its own continuation token prevents hidden rows from being skipped. Requests retain the existing default of 200 entries and hard maximum of 5000. Fetching still saves the entire accepted tree and has no pagination; omitted text records remain inspectable under the saved root.

The 8 KiB ceiling deliberately allows a useful group of exact, variable-length filesystem names plus the security wrapper, while preventing a 5000-record context burst. It is an internal display budget, not a new setting; the ordinary captured outputs are approximately 1–1.3 KiB. Every emitted path record is complete and unchanged by security wrapping. Oversized or reserved-marker paths produce explicit bounded omission/no-progress guidance instead of a fake usable pathname. No SDK/production export, dependency, config/env option, schema, or timeout change is introduced. Channel-delivery behavior is unchanged; this does not claim to repair the separate delivery concern in #138383.

Operator documentation: https://docs.openclaw.ai/nodes#agent-file-transfers

Evidence

Fail-first and boundary tests

The original two-file suite passed 38 tests. Adding content-only filename assertions to those existing tests, before changing production owners, produced 2 failing tests and 36 passing: listing content lacked report.txt/nested, and fetch content lacked ok.txt/.root-note despite successful extraction. The repaired final suite passed 55/55.

node scripts/run-vitest.mjs extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/src/tools/dir-fetch-tool.test.ts

A broader owner/sibling run passed 542 tests, with 2 Linux-only skips on macOS. It covered the complete File Transfer suite, raw Tool Search nested details, Code Mode guest/output contracts, shared result text, and Codex dynamic-tool handling. The final directory-only rerun followed test typing/lint cleanup; production bytes were unchanged.

node scripts/run-vitest.mjs extensions/file-transfer src/agents/tool-search.mcp-error.test.ts src/agents/code-mode.output.test.ts src/agents/code-mode.guest.test.ts src/plugin-sdk/tool-results.test.ts packages/ai/src/providers/tool-result-text.test.ts extensions/codex/src/app-server/dynamic-tools.test.ts

Coverage includes actual canonical filesystem listing and real archive extraction; text-only continuation/file reads; more than 200 real directory entries; five 5000-entry synthetic sequences exhausted without skipped/duplicated names; strict token parsing; final and empty pages; Unicode, quoted/newline and long names; complete-record byte bounds; unrepresentable paths; all saved files; image-first media selection; and the existing archive/security rejection paths.

Exact small synthetic outputs measured 1030 bytes for the two-entry listing and 1321 bytes for the four-file fetch, including wrappers. The latter exposed hidden and nested saved files and supported byte-verified local reads from content alone.

Checks, build, and independent review

The complete changed gate passed, including production/test typechecks, formatting, lint, doctor-contract tests, package/architecture guards, zero-finding dead-export scans and zero runtime import cycles.

node scripts/check-changed.mjs -- docs/nodes/index.md extensions/file-transfer/src/tools/descriptors.ts extensions/file-transfer/src/tools/dir-list-tool.ts extensions/file-transfer/src/tools/dir-fetch-tool.ts extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/src/tools/dir-fetch-tool.test.ts

pnpm docs:list, git diff --check, and pnpm build passed using Node 24.20.0 and repository-pinned pnpm 12.1.0. Fresh isolated Codex autoreview of the complete six-file candidate and full owner/caller/sibling/dependency datasets returned scoped-clean with zero P0–P2 findings and no filtering. No review isolation or credential-scanning control was bypassed.

Initial tooling failures were resolved without changing dependency policy: use the cached exact pnpm version and install the unchanged lockfile in the isolated worktree. Earlier type/lint checks caught two unknown mock-argument reads, an unnecessary escape and a loop-form violation; the tests now use runtime record validation and asserted pagination progress. No suppression, baseline, limit or timeout was relaxed.

The build retained four dependency direct-eval warnings, two Node-path browser externalizations and a plugin-timing diagnostic; no ineffective dynamic import appeared. It also reported a Control UI startup-size advisory (350405 gzip bytes versus 350141 threshold), not a failed build. Baseline attribution is a separate follow-up; this is not a warning-free build or ui:check-performance pass claim. Existing fs-safe Unicode/newline PAX restrictions remain unchanged and are tracked separately; the Unicode archive projection fixture uses the supported short USTAR format.

Runtime integration proof

Accepted before/after proof: a built Gateway handled real HTTP tools/invoke calls and WebSocket node transport through the public File Transfer handlers. The same separate deterministic controller received only content, never details, fixture inventory, raw media, a before/after label, or verifier feedback. The baseline compiled the exact pre-fix owner/descriptor sources and changed only the two executed owner bundles in a 41,262-entry runtime inventory; all Gateway, node, archive, policy and media helpers were identical. This is an isolated producer comparison, not a full historical-release install.

Observation Pre-fix owners Candidate owners
Successful HTTP/native operations 5 7
Directory names discovered from content 0 240
Content-only reads of saved paths 0 85
Complete saved archive files independently verified 442 442
Largest candidate content result — 8163 UTF-8 bytes

The candidate exhausted its real 240-entry listing in 78/77/77/8 displayed entries. Text tokens were 78 → 155 → 232 → exhausted; the first raw result still contained 200 entries and token 200. A separate maximum request forwarded maxEntries:5000 through both node phases but used the same 240-entry physical fixture; the five full 5000-entry sequences are unit proof, not a claimed live 5000-file fixture.

Small/large fetches preserved 11/431 complete saved files and 11/25 media URLs; content exposed 11/74 complete records, with 357 explicit omissions in the large result. Native macOS tar adds AppleDouble members: the original source counts were 4/214, all preserved byte-for-byte. The verifier checked actual archive membership, every saved member, all normalized details, all controller-read hashes, metadata headers/counterparts, and the exact image-first media order. No metadata was hidden, filtered, or suppressed. Original source files, not only metadata, were read using content paths. The parent independently reverified the retained raw responses, archives, controller results and all 24 binding-checked node frames.

{"before":{"successfulCalls":5,"discoveredNames":0,"contentOnlyReads":0},"after":{"successfulCalls":7,"discoveredNames":240,"contentOnlyReads":85,"maxContentBytes":8163},"archiveFilesVerifiedPerVariant":442,"normalizedStructuredFilesAndMediaUnchanged":true,"nodeFrames":24,"allFinalFramesBoundToPreflight":true,"operatorStateAccessed":false}

Both runs used fresh home/state/config/workspace/cache roots, task-owned logging.file, normal pairing/path authorization, and distinct loopback ports. Exact task lifecycle-coordinator filenames were declared from the canonical fresh database paths before launch, required absent, and bound to the actual Gateway PID/UID/device/inode; no global directory exception or runtime lock bypass was used. Writable-descriptor snapshots passed at readiness, around each HTTP call, and completion. All owned processes joined, ports were rebound, and temporary roots/credentials were removed. Empty coordinator remnants lacking observed live-FD deletion identity were deliberately retained rather than reclaimed unsafely.

Earlier harness attempts remain unaccepted: an omitted log override, over-strict/mistaken descriptor and rollback-journal classification, and a baseline linker error were corrected in task-only proof code. No production guard, timeout, schema, dependency or source file changed to obtain proof. The initial shared default log was not read or cleaned up. Existing macOS metadata behavior has a separate follow-up.

This is built Gateway + real node transport with a deterministic content-only consumer, not a live model/provider/channel/UI test or an adversarial OS sandbox. Descriptor audits are snapshots, not a continuous syscall trace. No UI screenshot or channel-delivery claim is made. The complete local evidence is retained under .artifacts/file-transfer-content/runtime-proof/attempt07/, including source/runtime hashes and parent-retained-verification.json; proof artifacts and temporary harness code are not product changes.

Scope and provenance

Both pre-fix owners were byte-identical in stable v2026.9.1, the tested source baseline a86a1b505d335ce6b40cb4f9f1af4ece5103f0c5, and inspected main a33604ea1ecab8212865cd225e17511cc0b69cb3. Raw parent-relative history shows the directory owners originally shipped with this content/details split; it was not introduced by the companion File Fetch receipt repair.

Production LOC: +118/-17 (net +101). Tests: +482/-22 (net +460). Docs: +17/-0. The growth owns complete-record byte budgeting, exact-path representability, and the different listing/fetch continuation contracts; obsolete count-only summaries and invisible-details guidance are removed. There is no new shared/public production seam or persisted manifest artifact.

Pre-merge review disposition

All distinct maintainer items in ClawSweeper's updated review are addressed without source changes:

  • 8,192-byte context contract accepted: adopt this UTF-8 maximum, including security wrapping, as the deliberate direct-caller compatibility tradeoff. Useful complete filenames justify the bounded increase from count-only summaries; ordinary captured results are about 1–1.3 KiB and the maximum observed runtime result was 8,163 bytes. Existing pagination/maxEntries and provider context guards remain in force. The ceiling does not override a caller's smaller context budget, and no new setting is introduced. No cap reduction or details-only compatibility path is requested.
  • Owner-local growth accepted: both projection helpers are private in the existing owners. No shared plugin API or SDK export was introduced; whole-record byte budgeting and distinct continuation semantics justify the net growth.
  • No persistent data-model migration applies: the new JSON.stringify calls render text in the existing content[].text field. They do not change a database, schema/version, migration, store, configuration or protocol field. Existing stored files, audit writes and raw details/media are unchanged; old transcript records are not rewritten. Before/after runtime verification established identical normalized structured file records and media order, and input schemas/numeric-offset tokens remain compatible.

The exact committed head is 5a20e549f08df4f2c6ee20e413f561e7d279aca3. CI run 33910730253, attempt 1 completed successfully and the required CI gate is SUCCESS. Initial Blacksmith runner allocation queued, then resumed; no cancellation, rerun, workflow edit or bypass was needed for that accepted run. A fresh pre-land Codex autoreview of the committed head was scoped-clean with zero P0–P2 findings and no filtering. Native prepare/merge remains the landing owner.

…calls

Expose bounded, complete directory records in tool content so direct callers
can follow listing pagination and read saved files. Preserve structured
details, archive integrity, path authorization, and media selection.

Refs #138480.
@steipete steipete self-assigned this Sep 4, 2026
@steipete
steipete marked this pull request as ready for review September 4, 2026 19:21
@clawsweeper

clawsweeper Bot commented Sep 4, 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 plugin: file-transfer size: L maintainer Maintainer-authored PR labels Sep 4, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 4, 2026
@clawsweeper

clawsweeper Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 4, 2026, 3:56 PM ET / 19:56 UTC.

ClawSweeper review

What this changes

The PR makes File Transfer directory-list and directory-fetch tools return bounded, actionable filenames and saved-file records in model-visible text while retaining their structured details.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open. This is a focused, producer-boundary repair for a shipped direct-tool-result defect; no introduced correctness defect was found. A maintainer must accept the intentional bounded model-context contract before merge.

Priority: P1
Reviewed head: 5a20e549f08df4f2c6ee20e413f561e7d279aca3
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The producer-boundary repair and observable coverage are solid, with the remaining question limited to the intentional context-budget contract.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body supplies before/after built-Gateway evidence through public tools/invoke and WebSocket node transport with a content-only consumer; it exercises the changed producers, while provider serialization is independently established in source.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies before/after built-Gateway evidence through public tools/invoke and WebSocket node transport with a content-only consumer; it exercises the changed producers, while provider serialization is independently established in source.
Evidence reviewed 5 items Current main retains the reported behavior: Fetched main still emits count-only directory-list content and count/root-only directory-fetch content, leaving names and saved-file records only in details.
PR ownership and repair boundary: The verified parent-relative diff adds bounded, sanitized text projections at the two directory-tool producers while preserving the existing details contracts.
Direct callers consume content text: The shared provider helper prioritizes explicit text content, and the OpenAI, Responses, and Google serializers call it; details-only records therefore do not reach these direct model paths.
Findings None None.
Security None None.

How this fits together

File Transfer tools invoke an authorized paired node through the Gateway and return tool results to the model. The new producer-side projections make the listing and extracted-file manifest visible to direct model result serializers while preserving structured data for programmatic consumers.

flowchart LR
  A[Model tool call] --> B[File Transfer directory tool]
  B --> C[Authorized node operation]
  C --> D[Bounded result projection]
  D --> E[Direct model result serializer]
  D --> F[Structured tool details]
  E --> G[Model follow-up action]
  F --> H[Programmatic consumers]
Loading

Decision needed

Question Recommendation
Should this PR adopt the bounded 8,192-byte direct-result text contract for existing directory-tool callers? Accept the bounded result contract: Merge the owner-local listing and manifest projections so direct model callers can perform follow-up work from content.

Why: Source proves a shipped usability defect and a bounded repair, but accepting the model-context tradeoff for existing integrations is a product and compatibility choice.

Before merge

  • Resolve merge risk (P1) - Merging changes the direct model-result contract from a short summary to bounded text of up to 8,192 bytes, increasing context use for existing callers.
  • Resolve merge risk (P1) - Production code grows by 101 net lines; separate list-pagination and fetch-manifest contracts justify keeping the logic owner-local, but a net-neutral shared abstraction was not demonstrated.
  • Complete next step (P2) - A maintainer must accept the bounded direct-result compatibility tradeoff after exact-head CI completes.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +101, Tests +460, Docs +17. Total +578 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 118 17 +101
Tests 2 482 22 +460
Docs 1 17 0 +17
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 617 39 +578

Review metrics

Metric Value Why it matters
Production versus test delta production +118/-17 (net +101); tests +482/-22 (net +460); docs +17/-0 Production adds distinct bounded continuation and manifest contracts; tests exercise content-only follow-up behavior and byte bounds.

Stored data model

Persistent data-model change detected: serialized state: extensions/file-transfer/src/tools/dir-fetch-tool.ts, serialized state: extensions/file-transfer/src/tools/dir-list-tool.ts, unknown-data-model-change: extensions/file-transfer/src/tools/dir-fetch-tool.ts, unknown-data-model-change: extensions/file-transfer/src/tools/dir-list-tool.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #138480
Summary: This PR is the focused candidate repair for the direct directory-result projection defect reported in #138480.

Members:

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

Merge-risk options

Maintainer options:

  1. Accept the bounded result contract (recommended)
    Approve the 8,192-byte maximum as the direct-caller compatibility tradeoff and merge after exact-head CI is green.
  2. Reduce the context budget
    Change the projection format or cap before merge if maintainers do not accept the present model-context cost.
  3. Pause the result-contract change
    Defer the PR if details-only output remains the preferred compatibility policy.

Technical review

Best possible solution:

Keep the two bounded producer-local projections because listing pagination and fetched manifests need distinct complete record shapes; merge once a maintainer accepts the explicit context-budget contract.

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

Yes, from source and the PR's deterministic content-only harness: current producers place names only in details while direct serializers consume explicit content; this read-only review did not execute the harness.

Is this the best way to solve the issue?

Yes, subject to maintainer acceptance of the bounded context contract: projecting complete, sanitized records at the producing tools fixes the information loss without changing provider serializers, media trust, or configuration.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against c4b91f5c7052.

Labels

Label changes:

  • add merge-risk: 🚨 compatibility: Existing direct callers will receive up to 8,192 bytes of model-visible result text instead of a short summary.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after built-Gateway evidence through public tools/invoke and WebSocket node transport with a content-only consumer; it exercises the changed producers, while provider serialization is independently established in source.

Label justifications:

  • P1: The PR repairs a shipped direct model tool-result workflow that succeeds yet leaves the model without names needed for follow-up actions.
  • merge-risk: 🚨 compatibility: Existing direct callers will receive up to 8,192 bytes of model-visible result text instead of a short summary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies before/after built-Gateway evidence through public tools/invoke and WebSocket node transport with a content-only consumer; it exercises the changed producers, while provider serialization is independently established in source.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after built-Gateway evidence through public tools/invoke and WebSocket node transport with a content-only consumer; it exercises the changed producers, while provider serialization is independently established in source.

Evidence

Acceptance criteria:

  • [P1] Inspect exact-head CI before merge.
  • [P1] Confirm the 8,192-byte direct-result budget is acceptable for supported model callers.

What I checked:

Likely related people:

  • steipete: 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 (1 earlier review cycle)
  • reviewed 2026-09-04T19:48:29.096Z sha 5a20e54 :: blocked before merge. :: none

@steipete

steipete commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Maintainer disposition and land-ready proof

Addressing the maintainer items in the updated ClawSweeper review, including its explicit context-budget decision, for head 5a20e549f08df4f2c6ee20e413f561e7d279aca3:

  1. Context-budget decision — accepted: adopt the 8,192-byte UTF-8 maximum, including security wrapping, as the intentional direct-caller compatibility tradeoff. A useful group of exact variable-length filenames is worth the bounded increase from count-only summaries; ordinary captured results are about 1–1.3 KiB, and the maximum observed runtime result was 8,163 bytes. Complete records, existing pagination/maxEntries, and unchanged provider context guards bound the cost. This is an internal ceiling, not a promise to override a caller's smaller context budget, and no new setting is introduced. Do not reduce the cap or retain details-only behavior for this repair.
  2. Production growth: accepted as the necessary owner-local repair. The +101 net production lines are private functions inside the two existing tool owners, not a shared plugin API or SDK export. They enforce complete-record byte bounds, unchanged usable paths, and the different listing-continuation/fetch-omission contracts. The old count-only summaries are removed. Generic prose truncation cannot preserve these boundaries, and promoting all details would put up to 5000 file records into model context.
  3. Data-model compatibility: no persistent model changes occur. The new JSON.stringify calls only render strings for the existing content: [{ type: "text", text }] field. They do not introduce a store, schema, schema version, migration, config key or protocol field. Existing details, file storage, audit writes and media selection are unchanged; old transcript records are not rewritten. No database migration or older-reader database exercise applies to this text projection. Existing callers keep the same argument schemas and numeric-offset page-token language; structured consumers keep the original page/manifest.

Source: listing owner, fetch owner, and model-content versus details contract. The before/after runtime comparison independently verified every normalized structured file record and the full media sequence as identical.

Exact-head CI: run 33910730253, attempt 1 completed successfully, and openclaw/ci-gate is SUCCESS. Its 32-vCPU runner allocation initially queued; capacity resumed and the existing run completed without cancellation, rerun, workflow edits or bypass. The earlier draft run was superseded and is not the accepted evidence.

Local and runtime proof: the original content-only assertions failed before repair (2 failed / 36 passed); the final directory suite passed 55/55. The broader owner/Tool Search/Code Mode/Codex/shared-result run passed 542 tests with 2 Linux-only skips. The complete changed gate and build passed. Fresh isolated pre-land Codex autoreview of this committed head returned scoped-clean with zero P0–P2 findings and no filtering.

node scripts/run-vitest.mjs extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/src/tools/dir-fetch-tool.test.ts
node scripts/check-changed.mjs -- docs/nodes/index.md extensions/file-transfer/src/tools/descriptors.ts extensions/file-transfer/src/tools/dir-list-tool.ts extensions/file-transfer/src/tools/dir-fetch-tool.ts extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/src/tools/dir-fetch-tool.test.ts
pnpm build

The accepted built-Gateway/native-node comparison used the same independent content-only consumer: 0 → 240 discoverable names, 0 → 85 local reads, maximum 8163 UTF-8 bytes, with all 442 saved archive members per variant and raw details/media preserved. The parent independently verified the retained raw responses, archives and controller observations. Full commands, scope, source identities, and initial harness failures are recorded in the PR body.

Known limits remain explicit: no live model/provider/channel/UI or Windows run, no continuous syscall trace, and no physical 5000-file fixture (full-size sequences are unit proof). Native AppleDouble/PAX behavior and the unrelated Control UI build-size advisory remain separate follow-ups; no limits, policies or baselines were relaxed. Operator docs: https://docs.openclaw.ai/nodes#agent-file-transfers

No source changes were needed after the review. Proceeding through the repository-native prepare/merge gates, not bypassing them.

@steipete
steipete merged commit 137698c into main Sep 4, 2026
194 of 242 checks passed
@steipete
steipete deleted the steipete/youthful-mccarthy-a13751 branch September 4, 2026 20:17
@steipete

steipete commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 5, 2026
…calls (openclaw#138542)

Expose bounded, complete directory records in tool content so direct callers
can follow listing pagination and read saved files. Preserve structured
details, archive integrity, path authorization, and media selection.

Refs openclaw#138480.
obviyus added a commit that referenced this pull request Sep 11, 2026
…138427)

Fixes #138383.

## What Problem This Solves

`dir_fetch` saved files fetched from a paired node, but the embedded runner and Codex bridge discarded their local attachment paths. The final reply contained no files. The earlier misleading directory summary was already removed by #138542.

## Why This Change Was Made

Carry the existing concrete tool metadata into both reply pipelines. Keep core tool behavior, exact registered names, filesystem grants, private-media rejection, and MCP filtering. An unmarked plugin cannot gain trust by reusing a core name or setting a public result flag; the special TTS path uses the existing private core result provenance and its original URLs.

Complete delivery through the existing host-selected path: suppress final text already sent as the same assistant message's file caption, append UI media supplements without recreating runtime-owned text, and read image downloads through the existing authenticated media route without relaxing the browser policy.

## User Impact

Permitted files arrive with the final reply, up to the existing 25-file selection limit. The complete saved inventory remains available. No schema, configuration option, protocol, dependency, or direct adapter-send path is added.

## Evidence

- Real embedded Control UI and Telegram Test Server baseline: successful paired-node fetch, zero final attachments.
- Real Codex app-server baseline: 26 fetched files, zero final attachments.
- Repaired native Codex flow: one caption and 25 final attachments from 26 files; image and document downloads match the source bytes, and attachments survive history refresh.
- Real unmarked plugin calls succeed while local attachments remain blocked. An ungranted directory returns `POLICY_DENIED`. Core aliases, HTTP media, MCP provenance, private results, and TTS provenance also have focused owner-boundary coverage.
- Telegram delivers one captioned photo and one document; the document matches the original bytes. Owned test messages and credential leases were cleaned up.
- Focused integration, delivery, trust, and browser-policy checks plus the matching runtime/UI build passed on an isolated native runner.

Independent source-blind acceptance passed both native and embedded public flows: final attachments, 25-file selection, all 26 saved-file hashes, image/document downloads, history refresh, and actual unmarked-plugin rejection. Baseline and Telegram results above are separate retained proof. Exact-head hosted checks and final review are required before landing.

This preserves the implementation from @NianJiuZst and includes useful regression coverage offered by @igs-rogenlo in #144609. The two-runtime scope is retained; the older wording-only alternative is not reopened.

Co-authored-by: igs-rogenlo <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…penclaw#138427)

Fixes openclaw#138383.

## What Problem This Solves

`dir_fetch` saved files fetched from a paired node, but the embedded runner and Codex bridge discarded their local attachment paths. The final reply contained no files. The earlier misleading directory summary was already removed by openclaw#138542.

## Why This Change Was Made

Carry the existing concrete tool metadata into both reply pipelines. Keep core tool behavior, exact registered names, filesystem grants, private-media rejection, and MCP filtering. An unmarked plugin cannot gain trust by reusing a core name or setting a public result flag; the special TTS path uses the existing private core result provenance and its original URLs.

Complete delivery through the existing host-selected path: suppress final text already sent as the same assistant message's file caption, append UI media supplements without recreating runtime-owned text, and read image downloads through the existing authenticated media route without relaxing the browser policy.

## User Impact

Permitted files arrive with the final reply, up to the existing 25-file selection limit. The complete saved inventory remains available. No schema, configuration option, protocol, dependency, or direct adapter-send path is added.

## Evidence

- Real embedded Control UI and Telegram Test Server baseline: successful paired-node fetch, zero final attachments.
- Real Codex app-server baseline: 26 fetched files, zero final attachments.
- Repaired native Codex flow: one caption and 25 final attachments from 26 files; image and document downloads match the source bytes, and attachments survive history refresh.
- Real unmarked plugin calls succeed while local attachments remain blocked. An ungranted directory returns `POLICY_DENIED`. Core aliases, HTTP media, MCP provenance, private results, and TTS provenance also have focused owner-boundary coverage.
- Telegram delivers one captioned photo and one document; the document matches the original bytes. Owned test messages and credential leases were cleaned up.
- Focused integration, delivery, trust, and browser-policy checks plus the matching runtime/UI build passed on an isolated native runner.

Independent source-blind acceptance passed both native and embedded public flows: final attachments, 25-file selection, all 26 saved-file hashes, image/document downloads, history refresh, and actual unmarked-plugin rejection. Baseline and Telegram results above are separate retained proof. Exact-head hosted checks and final review are required before landing.

This preserves the implementation from @NianJiuZst and includes useful regression coverage offered by @igs-rogenlo in openclaw#144609. The two-runtime scope is retained; the older wording-only alternative is not reopened.

Co-authored-by: igs-rogenlo <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

Directory tools hide entries and saved manifests from direct model calls

1 participant