Skip to content

[Bug]: dir_list is exposed without usable node context and is mistaken for local directory listing. #91482

Closed

Description

@wilfried-codex

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

dir_list is exposed to agents even when nodes status returns no available nodes, causing models to guess invalid node values and fail directory listing attempts.

Steps to reproduce

  1. Start an OpenClaw session with the bundled file-transfer tools available.
  2. Ensure no paired nodes are available; openclaw nodes status / nodes status returns an empty node list.
  3. Ask the agent to list a local workspace directory, for example skills or scripts or whatever exists there.
  4. Observe that the agent attempts to use dir_list.
  5. Observe failed calls such as missing node, then guessed values like auto, host, local, or gateway.
  6. Each guessed node fails with unknown node.

Expected behavior

When no paired nodes are available, dir_list should not be exposed to the agent, or it should immediately return a clear error explaining that no paired nodes exist and that local workspace directories require local file/exec tools.

The tool and node parameter descriptions should make clear that node must be an existing paired node id/name/ip from nodes status, not values like local, host, gateway, or auto.

Actual behavior

dir_list is available even though nodes status returns an empty node list.

The agent does not know what value to use for the required node parameter and guesses values such as auto, host, local, and gateway. Each attempt fails with unknown node, so a simple directory listing task wastes multiple turns before falling back to local shell/file tools.

OpenClaw version

2026.6.1 (2e08f0f)

Operating system

Windows 11

Install method

npm install -g openclaw@2026.6.1

Model

ollama/gemma4:26b

Provider / routing chain

OpenClaw gateway -> local Ollama provider

Additional provider/model setup details

No response

Logs, screenshots, and evidence

• Relevant observed tool-call sequence from the affected session:

  1. dir_list called with:
     {"path":"Tasks"}

     Result:
     Validation failed for tool "dir_list":
     - node: must have required properties node

  2. dir_list retried with guessed node:
     {"node":"auto","path":"Tasks"}

     Result:
     unknown node: auto

  3. dir_list retried with guessed node:
     {"node":"host","path":"Tasks"}

     Result:
     unknown node: host

  4. dir_list retried with guessed node:
     {"node":"local","path":"Tasks"}

     Result:
     unknown node: local

  5. dir_list retried with guessed node:
     {"node":"gateway","path":"."}

     Result:
     unknown node: gateway

  6. nodes status later returned:
     {"nodes":[]}

  The session then used local shell/file tooling instead, which worked for listing the local workspace.

Impact and severity

Impact: Agents can fail or waste multiple turns on simple directory listing tasks because dir_list appears to be a local
directory tool but requires a paired node. This is especially harmful for smaller/local models, but was observed with
ollama/gemma4:26b as well.

Severity: Medium / P2-P3. It does not crash OpenClaw or lose data, but it breaks a common workflow and makes the file- transfer tool surface misleading when no nodes are available.

Additional information

No response

Activity

  1. clawsweeper commented on Jun 8, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 8, 2026, 2:32 PM ET / 18:32 UTC.

    Summary
    Keep this open: current main still ships the same non-optional file-transfer tool exposure, and dir_list still requires a paired node after the model has already selected the tool. The shipped v2026.6.1 source has the same behavior, and I found no merged or open canonical fix in the provided context or local searches.

    Reproducibility: yes. there is a high-confidence source-level reproduction path: with no paired nodes, the default file-transfer plugin can still expose dir_list, and execution then returns node required or unknown node for guessed values. I did not run a live Windows/Ollama session.

    Next step
    A focused repair is clear from source inspection, has no protected labels or linked open PR in the provided context, and can be validated with narrow file-transfer/node-resolution tests.

    Review details

    Best possible solution:

    Land a plugin-owned repair that gives dir_list a clear no-paired-nodes path and stronger node-parameter wording, hiding it dynamically only if the existing plugin tool resolver can do that without adding a new config surface.

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

    Yes, there is a high-confidence source-level reproduction path: with no paired nodes, the default file-transfer plugin can still expose dir_list, and execution then returns node required or unknown node for guessed values. I did not run a live Windows/Ollama session.

    Is this the best way to solve the issue?

    Yes, a narrow plugin-owned fix is the best layer: improve the file-transfer descriptor and no-node execution behavior without changing local filesystem tools or adding config. Dynamic hiding is acceptable only if it fits the existing plugin tool discovery contract.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • No live Windows/Ollama session was replayed; the source path is clear, but a repair PR should add focused regression coverage and verify the real tool surface if it changes dynamic exposure.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 105d77d486bf.

    Label changes

    Label changes:

    • add P2: This is a normal-priority behavior bug in a bundled tool surface that can waste agent turns but does not crash, lose data, or break core startup.
    • add impact:other: The issue affects agent tool selection and user workflow clarity, which is maintainer-visible but does not fit the more specific impact labels.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:queueable-fix: Current issue advisory state selects this label.
    • add clawsweeper:fix-shape-clear: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a normal-priority behavior bug in a bundled tool surface that can waste agent turns but does not crash, lose data, or break core startup.
    • impact:other: The issue affects agent tool selection and user workflow clarity, which is maintainer-visible but does not fit the more specific impact labels.
    Evidence reviewed

    Acceptance criteria:

    • node scripts/run-vitest.mjs extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/index.test.ts src/shared/node-match.test.ts src/agents/tools/nodes-utils.test.ts
    • node scripts/run-vitest.mjs extensions/file-transfer/src/tools/file-fetch-tool.test.ts extensions/file-transfer/src/tools/file-write-tool.test.ts

    What I checked:

    • Tool registration is unconditional: The bundled file-transfer plugin registers dir_list during plugin registration alongside the other file-transfer tools, with no paired-node availability check at registration time. (extensions/file-transfer/index.ts:102, 105d77d486bf)
    • Manifest makes file-transfer default available: The file-transfer plugin is enabled by default and declares dir_list in its tool contract, so normal plugin tool resolution can surface it without node availability metadata. (extensions/file-transfer/openclaw.plugin.json:6, 105d77d486bf)
    • Bundled plugins are control-plane available: Bundled plugin manifest eligibility returns true regardless of current paired-node state; tool availability with missing per-tool metadata also returns true. (src/plugins/manifest-contract-eligibility.ts:21, 105d77d486bf)
    • Descriptor does not prevent guessed local node names: The dir_list schema says the node is an id, name, or IP resolved like the nodes tool, but it does not say the value must come from nodes status or that local/host/gateway/auto are invalid. (extensions/file-transfer/src/tools/descriptors.ts:46, 105d77d486bf)
    • Execution fails after node lookup, not before exposure: The shared file-transfer invoke helper lists nodes only during tool execution, then calls resolveNodeIdFromList(nodes, input.node, false), so an empty node list is discovered after the model has selected dir_list. (extensions/file-transfer/src/tools/node-tool-invoke.ts:49, 105d77d486bf)
    • Empty or guessed nodes produce the reported errors: Blank node input throws node required, and unmatched guessed values throw unknown node: <value> with no no-paired-nodes guidance when the candidate list is empty. (src/shared/node-resolve.ts:17, 105d77d486bf)

    Likely related people:

    • Shakker: Current blame for the file-transfer registration, descriptor, and node invoke helper resolves to the local graft boundary commit, so this is a practical current-source routing signal rather than a root-cause attribution. (role: recent current-source contributor; confidence: medium; commits: 71f6620ba330; files: extensions/file-transfer/index.ts, extensions/file-transfer/src/tools/descriptors.ts, extensions/file-transfer/src/tools/node-tool-invoke.ts)
    • omarshahine: The release changelog credits the bundled file-transfer plugin with dir_list to fix(file-transfer): require canonical node policy authorization #74742, which is the feature surface implicated by this issue. (role: likely original feature contributor; confidence: medium; files: CHANGELOG.md, extensions/file-transfer)
    • samzong: The release changelog credits [Fix] Avoid eager file-transfer policy loading #82211 for lazy-loading node.invoke policy so startup registers static file-transfer command metadata until tools run, adjacent to the exposure path here. (role: recent related file-transfer contributor; confidence: medium; files: CHANGELOG.md, extensions/file-transfer/index.ts)
    • Peter Steinberger: Recent history on node matching and node-list resolution includes centralization and fallback work that owns the shared node required / unknown node behavior used by file-transfer tools. (role: adjacent node-resolution owner; confidence: high; commits: 27519cf06157, a1346a519a13, 06bc9f368b01; files: src/shared/node-match.ts, src/shared/node-resolve.ts, src/agents/tools/nodes-utils.ts)
    How this review workflow works
    • 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.
  2. wilfried-codex commented on Jun 8, 2026

    @wilfried-codex
    Author

    Adding the required issue-report phrase from the OpenClaw issue guidelines: lobster-biscuit

  3. added
    P2Normal backlog priority with limited blast radius.
    impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.
    clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.
    on Jun 8, 2026
  4. self-assigned this
    on Jun 8, 2026
  5. vincentkoc commented on Jun 8, 2026

    @vincentkoc
    Member

    Fixed on main in 224086e.

    What changed:

    • File-transfer tool node parameter descriptions now say the value must be an existing paired node id/display name/IP from nodes status, not guesses like local, host, gateway, or auto.
    • File-transfer execution now detects an empty paired-node list before alias resolution and returns an actionable no-paired-nodes diagnostic instead of falling through to unknown node retries.
    • Added a dir_list regression covering the no-node diagnostic and descriptor wording.

    Verification:

    • node scripts/run-vitest.mjs extensions/file-transfer/src/tools/dir-list-tool.test.ts passed.
    • node scripts/run-vitest.mjs extensions/file-transfer/src/tools/dir-list-tool.test.ts extensions/file-transfer/index.test.ts src/shared/node-match.test.ts src/agents/tools/nodes-utils.test.ts passed.
    • node scripts/run-vitest.mjs extensions/file-transfer/src/tools/file-fetch-tool.test.ts extensions/file-transfer/src/tools/file-write-tool.test.ts passed.
    • node_modules/.bin/oxfmt --check --threads=1 extensions/file-transfer/src/tools/descriptors.ts extensions/file-transfer/src/tools/node-tool-invoke.ts extensions/file-transfer/src/tools/dir-list-tool.test.ts passed.
    • git diff --check passed.
    • .agents/skills/autoreview/scripts/autoreview --mode local returned clean: autoreview clean: no accepted/actionable findings reported.
    • Testbox-through-Crabbox changed gate passed: provider blacksmith-testbox, id tbx_01ktm9b26p891sf6k78cm0dq78, Actions run https://github.com/openclaw/openclaw/actions/runs/27159852235, lanes extensions, extensionTests, exit 0.
    • Exact pushed SHA checks observed: Workflow Sanity success, Plugin NPM Release success, ClawSweeper Dispatch success, plus skipped neutral agent workflows. At close time, push-triggered CI was still draining one build-artifacts job and a push-triggered Blacksmith Testbox run was still in progress; no failing exact-SHA run was observed. The explicit Testbox-through-Crabbox changed gate above is the maintainer gate for this patch.

    No related open issue/PR duplicate was found in the live search for dir_list unknown node local host gateway no paired nodes.

  6. locked as resolved and limited conversation to collaborators on Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions