fix(memory-wiki): make wiki_lint report path tool-safe#83464
fix(memory-wiki): make wiki_lint report path tool-safe#83464ThiagoCAltoe wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: no. not for the exact full-runtime bridge error. Source inspection does show current main returns the raw absolute-path-heavy linter result from PR rating Rank-up moves:
What the crustacean ranks mean
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. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Merge this wrapper/test fix after CI and maintainer acceptance of the relative agent-tool details contract, then close the linked issue and supersede the companion PR at #83439 if this lands first. Do we have a high-confidence way to reproduce the issue? No, not for the exact full-runtime bridge error. Source inspection does show current main returns the raw absolute-path-heavy linter result from Is this the best way to solve the issue? Yes. Keeping Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 56024b782814. |
|
@clawsweeper automerge |
|
🦞🔧
Draft PRs stay fix-only until GitHub marks them ready for review. Pause with Automerge progress:
|
|
ClawSweeper 🐠 reef update Thanks for the work on this. ClawSweeper could not push to this branch with the permissions available, so it opened a narrow replacement PR to keep the fix swimming forward without losing the contributor trail. not your fault, just GitHub branch-permission tides. Why replacement: ClawSweeper could not update the source PR branch directly; GitHub did not grant sufficient push rights to the bot for that branch.
fish notes: model gpt-5.5, reasoning high; reviewed against da27925. |
Summary
wiki_lintcan surface the linter's absolute report path in agent-tool text/details even though CLI lint succeeds.createWikiLintTool()reused the rawlintMemoryWikiVault()result for both visible text and tool metadata. That raw result is correct for CLI/file callers because they need an absolutereportPath, but it is too path-heavy for model-visible tool output.lintMemoryWikiVault()and CLI behavior unchanged, but have thewiki_linttool render and return a vault-relativereportPathsuch asreports/lint.md.AI-assisted PR: yes. I used OpenClaw/Codex assistance, reviewed the diff, and verified the behavior below.
Compatibility note
wiki_lintagent tool result shape.details.reportPathreturned by the agent tool is now vault-relative, for examplereports/lint.md.vaultRootindetails, so tool output does not expose the local vault root.lintMemoryWikiVault()result is unchanged and still returns the absolutereportPathplusvaultRoot.openclaw wiki lintandwiki.lintgateway calls still consume the raw linter result.details.reportPathfrom thewiki_lintagent tool outside the new regression test.details.reportPathas an absolute filesystem path should resolve the relative path against the configured wiki vault root, or call the CLI/gateway/linter surface that still returns absolute paths.Change Type
Scope
Linked Issue/PR
Closes #83420.
Real Behavior Proof
wiki_linttool output should not expose the raw absolute lint report path in model-visible text or return the raw linter result object as tool details.fix-memory-wiki-lint-tool-output, with an isolated temporary memory-wiki vault.node --import tsx -e ...harness that created a temporary wiki vault, wrote a lintable page, invokedcreateWikiLintTool(config).execute(...), inspected the tool text/details, and compared that with the underlying linter/CLI report path shape.details.reportPathusereports/lint.md, while the underlying linter/CLI path remains absolute for file-oriented callers.unable to resolve opened file pathbridge failure. The proof covers the risky output shape at the tool wrapper where this patch changes behavior.createWikiLintTool()renderedresult.reportPathdirectly and returneddetails: result, so the direct tool output included the absolute vault report path.Regression Test Plan
extensions/memory-wiki/src/tool.test.tsforwiki_linttool output.reports/lint.md, does not include the vault root,details.reportPathis relative, and the details payload does not includevaultRoot.Validation
Passed locally before opening this PR:
Results:
Not run locally: full
pnpm checkand fullpnpm test. This was intentionally left to CI/Testbox because the local host is a low-memory Raspberry Pi-class machine and repo-wide checks overloaded the session.User-visible / Behavior Changes
wiki_linttool responses now show the lint report path relative to the vault (reports/lint.md) instead of an absolute local filesystem path. CLI lint behavior is unchanged.Security Impact
Risks and Mitigations
details.reportPathas an absolute path will now receive a vault-relative path.lintMemoryWikiVault()and CLI/file callers still receive the absolute report path. The agent-facing tool payload avoids exposing the local vault root in text or details.