Skip to content

memory-wiki: wiki_lint tool can fail with 'unable to resolve opened file path' while CLI lint succeeds #83420

@one-box-u

Description

@one-box-u

Summary

wiki_lint can fail at the tool layer with:

  • unable to resolve opened file path

when the bundled memory-wiki tool returns the raw lintMemoryWikiVault() result object directly. In practice, the CLI lint path can succeed while the wiki_lint tool invocation fails.

Environment

  • OpenClaw: bundled global install on Linux
  • memory-wiki bundled plugin
  • bridge-mode wiki vault
  • direct tool invocation: wiki_lint
  • CLI comparison: openclaw wiki lint

Reproduction

  1. Use a configured memory-wiki vault with bridge content.
  2. Invoke the agent tool wiki_lint.
  3. Observe tool-layer failure similar to:
unable to resolve opened file path

At the same time, the CLI path can still succeed:

openclaw wiki lint

Actual behavior

The tool wrapper returns the raw lint result object, including absolute reportPath and the full details payload:

return {
  content: [{ type: "text", text: summary }],
  details: result,
};

This appears to interact badly with the tool/result handling path and can produce the unable to resolve opened file path failure even though lint itself succeeded.

Expected behavior

wiki_lint should return successfully, the same way the CLI does, and should not require callers to consume raw absolute-path-heavy internals.

Validated fix

A minimal fix in extensions/memory-wiki/src/tool.ts is to:

  1. normalize reportPath to be relative to the vault root for tool output
  2. return a lightweight details object instead of the raw result

Example shape:

const reportPath = result.reportPath.startsWith(config.vault.path)
  ? result.reportPath.slice(config.vault.path.length + 1)
  : result.reportPath;

return {
  content: [{ type: "text", text: summary }],
  details: {
    issueCount: result.issueCount,
    issues: result.issues,
    issuesByCategory: result.issuesByCategory,
    reportPath,
    vaultRoot: config.vault.path,
  },
};

Validation

I added a focused test in extensions/memory-wiki/src/tool.test.ts for:

  • relative reportPath (reports/lint.md)
  • lightweight details

and ran:

corepack pnpm exec vitest run --project extension-memory \
  extensions/memory-wiki/src/markdown.test.ts \
  extensions/memory-wiki/src/tool.test.ts

Result:

  • 2 passed
  • 9 passed
  • exit code 0

On the live install, after applying the tool-side change, wiki_lint returned normally instead of failing.

Why open separately

There is already existing discussion around lint false positives and wikilink resolution, but this is a different bug surface:

  • not link resolution correctness
  • not lint core logic
  • specifically the tool wrapper / result transport layer for wiki_lint

Acceptance criteria

  • wiki_lint tool invocation does not fail with unable to resolve opened file path
  • openclaw wiki lint and wiki_lint both succeed against the same vault
  • tool output uses a stable relative reportPath and a bounded details payload

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions