Conversation
- bub client.py: t show -m → -n, t search --limit → -n - openclaw CLAUDE.md: t show --limit → -n in CLI surface table - alma skill + main.js: t show/t search --limit → -n in CLI playbook Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds a Droid Nowledge Mem plugin (manifests, docs, hooks, skills, validation script, marketplace manifest), migrates OpenClaw client to runtime-based async CLI execution with constructor/signature changes, and standardizes thread CLI flags from Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant DroidHook as "Droid Hook"
participant Runtime as "OpenClaw Runtime"
participant Nmem as "nmem CLI"
participant FS as "Filesystem"
User->>DroidHook: SessionStart
DroidHook->>Runtime: runCommandWithTimeout("nmem --json wm read")
alt nmem available
Runtime-->>DroidHook: JSON briefing
DroidHook-->>User: present Working Memory briefing
else nmem missing or fails
DroidHook->>FS: read ~/ai-now/memory.md
alt file exists
FS-->>DroidHook: memory.md content
DroidHook-->>User: present fallback briefing
else
DroidHook-->>User: indicate no briefing available
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nowledge-mem-alma-plugin/main.js`:
- Around line 409-410: searchThreads and showThread use the long flag "--limit"
while documentation and examples use the short "-n"; update both runtime methods
(searchThreads and showThread) to accept and emit the short flag "-n" instead of
"--limit" so the CLI flag style matches the playbook/CLAUDE.md, and ensure any
parsing or help text references (e.g., flag registration or yargs/commander
setup within those functions) are changed accordingly to "-n" so behavior and
docs stay in sync.
In `@nowledge-mem-openclaw-plugin/CLAUDE.md`:
- Around line 124-125: The CLI docs show inconsistent flags for thread
pagination: `nmem --json t search <q> --limit N` vs `nmem --json t show <id> -n
N --offset O`; pick one canonical flag name (either `--limit N` or `-n N`) and
update the table entry for `nmem --json t search` to use the chosen flag so both
`client.searchThreadsFull()` and `client.fetchThread()` rows present the same
pagination flag; ensure the rest of the docs use that same flag for
thread-related commands.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 35fe6365-5655-4ff8-8097-942a4117361d
📒 Files selected for processing (4)
nowledge-mem-alma-plugin/alma-skill-nowledge-mem.mdnowledge-mem-alma-plugin/main.jsnowledge-mem-bub-plugin/src/nowledge_mem_bub/client.pynowledge-mem-openclaw-plugin/CLAUDE.md
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
nowledge-mem-droid-plugin/scripts/validate-plugin.mjs (1)
107-135: Make the runtime-surface checks pattern-based.The current
includes(...)checks are too literal: they would missnmem --json t save --from droid, and they don't catch the stalet search/show --limitexamples that already slipped into the new Droid docs/hooks. Regex checks here would make the validator enforce the CLI contract instead of just spot-checking phrases.Suggested change
-if (pluginText.includes("nmem t save --from droid")) { +if (/\bnmem(?:\s+--json)?\s+t\s+save\s+--from\s+droid\b/.test(pluginText)) { fail("plugin must not claim unsupported nmem t save --from droid behavior"); } else { ok("no fake Droid transcript importer claim"); } if (pluginText.includes("python3")) { fail("plugin should not require python3 just to load Working Memory"); } else { ok("no python3 dependency in plugin runtime surfaces"); } + +if (/\bnmem\s+--json\s+t\s+(?:search|show)\b[^\n]*\s--limit\b/.test(pluginText)) { + fail("plugin runtime surfaces must use -n for nmem t search/show pagination"); +} else { + ok("thread pagination flags are normalized to -n"); +}Based on learnings: Keep validator script and documentation in sync when tool contracts or lifecycle behavior changes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nowledge-mem-droid-plugin/scripts/validate-plugin.mjs` around lines 107 - 135, Replace the literal string checks on pluginText with regex-based tests: instead of pluginText.includes("nmem t save --from droid") add a RegExp test (with i and s flags) that matches the nmem CLI save pattern in any flag order, e.g. something like new RegExp("\\bnmem\\b.*\\b(t\\s+)?save\\b.*--from\\s+droid","is") to catch variants like "nmem --json t save --from droid"; add another regex to detect stale t search/show examples with limits, e.g. /\bt\b.*\b(search|show)\b.*--limit\b/i; and replace the python3 literal check with a regex like /\bpython3\b/i (or /\bpython3(?:\\.\\d+)?\b/i for versions) — update the pluginText.includes(...) usages and corresponding fail/ok branches to use these RegExp.test(pluginText) checks while keeping the same fail messages and symbols runtimeSurfaceFiles and pluginText to locate the code.nowledge-mem-droid-plugin/skills/distill-memory/SKILL.md (1)
36-38: Add--jsonto them updateexample for consistency with downstream parsing requirements.Line 28 uses
nmem --json m addwhile line 37 usesnmem m updatewithout the flag. For tool-driven workflows that depend on parseable JSON output, both commands should follow the same pattern.🔧 Suggested doc patch
- nmem m update <id> -t "Updated title" + nmem --json m update <id> -t "Updated title"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nowledge-mem-droid-plugin/skills/distill-memory/SKILL.md` around lines 36 - 38, The example for the "m update" command in SKILL.md is missing the --json flag and should be changed to match the parseable output used elsewhere; update the example line containing `nmem m update <id> -t "Updated title"` to include `--json` (so it mirrors the `nmem --json m add` pattern) so downstream tooling receives JSON output.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nowledge-mem-droid-plugin/hooks/hooks.json`:
- Around line 10-19: Replace the bare "nmem wm read 2>/dev/null || cat
~/ai-now/memory.md" pattern in both SessionStart hooks with an explicit JSON
read and exists-check using "nmem --json wm read"; call "nmem --json wm read",
parse the JSON response to verify the briefing actually contains content (e.g.,
non-empty field or array) and only when that check fails fall back to "cat
~/ai-now/memory.md"; ensure errors from the nmem command
(server/auth/connection) are not treated as "no briefing" so they surface rather
than silently loading the local file, and keep the surrounding compact hook's
trailing printf intact.
In `@nowledge-mem-droid-plugin/README.md`:
- Around line 146-150: The README's "Validate Locally" section runs "node
scripts/validate-plugin.mjs" but doesn't state the required working directory;
update the README (Validate Locally block) to make the cwd explicit by
prepending a step to change into the nowledge-mem-droid-plugin directory (e.g.,
add "cd nowledge-mem-droid-plugin" before running node
scripts/validate-plugin.mjs) so the command is copy/paste safe and works from
the documented checkout flow.
In `@nowledge-mem-droid-plugin/scripts/validate-plugin.mjs`:
- Around line 3-8: The code uses process.cwd() to set pluginRoot/repoRoot which
breaks when the script is run from elsewhere; change path resolution to be
relative to the script file using import.meta.url (e.g., compute the scriptDir
via fileURLToPath(new URL(import.meta.url)) / path.dirname) and then set
pluginRoot = path.resolve(scriptDir) and repoRoot = path.resolve(pluginRoot,
".."); update the top imports to include fileURLToPath from 'url' if needed and
replace references to pluginRoot/repoRoot accordingly (look for the pluginRoot
and repoRoot variables).
---
Nitpick comments:
In `@nowledge-mem-droid-plugin/scripts/validate-plugin.mjs`:
- Around line 107-135: Replace the literal string checks on pluginText with
regex-based tests: instead of pluginText.includes("nmem t save --from droid")
add a RegExp test (with i and s flags) that matches the nmem CLI save pattern in
any flag order, e.g. something like new
RegExp("\\bnmem\\b.*\\b(t\\s+)?save\\b.*--from\\s+droid","is") to catch variants
like "nmem --json t save --from droid"; add another regex to detect stale t
search/show examples with limits, e.g. /\bt\b.*\b(search|show)\b.*--limit\b/i;
and replace the python3 literal check with a regex like /\bpython3\b/i (or
/\bpython3(?:\\.\\d+)?\b/i for versions) — update the pluginText.includes(...)
usages and corresponding fail/ok branches to use these RegExp.test(pluginText)
checks while keeping the same fail messages and symbols runtimeSurfaceFiles and
pluginText to locate the code.
In `@nowledge-mem-droid-plugin/skills/distill-memory/SKILL.md`:
- Around line 36-38: The example for the "m update" command in SKILL.md is
missing the --json flag and should be changed to match the parseable output used
elsewhere; update the example line containing `nmem m update <id> -t "Updated
title"` to include `--json` (so it mirrors the `nmem --json m add` pattern) so
downstream tooling receives JSON output.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f77d299b-4cf7-450a-b1bc-5f28200a31f8
📒 Files selected for processing (19)
.factory-plugin/marketplace.jsonREADME.mdnowledge-mem-alma-plugin/main.jsnowledge-mem-droid-plugin/.factory-plugin/plugin.jsonnowledge-mem-droid-plugin/CHANGELOG.mdnowledge-mem-droid-plugin/README.mdnowledge-mem-droid-plugin/RELEASING.mdnowledge-mem-droid-plugin/commands/nowledge-distill-memory.mdnowledge-mem-droid-plugin/commands/nowledge-read-working-memory.mdnowledge-mem-droid-plugin/commands/nowledge-save-handoff.mdnowledge-mem-droid-plugin/commands/nowledge-search-memory.mdnowledge-mem-droid-plugin/commands/nowledge-status.mdnowledge-mem-droid-plugin/hooks/hooks.jsonnowledge-mem-droid-plugin/scripts/validate-plugin.mjsnowledge-mem-droid-plugin/skills/distill-memory/SKILL.mdnowledge-mem-droid-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-droid-plugin/skills/save-handoff/SKILL.mdnowledge-mem-droid-plugin/skills/search-memory/SKILL.mdnowledge-mem-openclaw-plugin/CLAUDE.md
✅ Files skipped from review due to trivial changes (8)
- nowledge-mem-droid-plugin/commands/nowledge-distill-memory.md
- nowledge-mem-droid-plugin/skills/save-handoff/SKILL.md
- nowledge-mem-droid-plugin/.factory-plugin/plugin.json
- nowledge-mem-droid-plugin/skills/search-memory/SKILL.md
- nowledge-mem-droid-plugin/commands/nowledge-status.md
- nowledge-mem-droid-plugin/RELEASING.md
- nowledge-mem-droid-plugin/CHANGELOG.md
- nowledge-mem-droid-plugin/commands/nowledge-save-handoff.md
🚧 Files skipped from review as they are similar to previous changes (1)
- nowledge-mem-alma-plugin/main.js
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nowledge-mem-openclaw-plugin/src/client.js`:
- Around line 203-230: The exec method currently logs the full argv on error
which may contain sensitive message content; update exec (function exec,
variable argv) to avoid emitting raw arguments by producing a redacted
representation before logging (e.g., keep argv[0] and any flag-like strings,
replace non-flag args with "<redacted>" or log only the args count), then call
this.logger.error with the sanitized string instead of argv.join(" "). Ensure
the redaction is applied after resolveCommand/_apiUrlArgs() and before the
logger.error line that reports failures from runtimeSystem.runCommandWithTimeout
so no raw payloads are written to logs.
- Around line 910-913: The checkHealth() method currently calls
this.exec(["status"]) without the required --json flag; update the call in
checkHealth() to include the "--json" argument so it becomes
this.exec(["status", "--json"]) (preserving existing error handling and return
true) to adhere to the parseable-output contract for all nmem commands.
In `@nowledge-mem-openclaw-plugin/src/spawn-env.js`:
- Around line 7-15: buildNmemSpawnEnv currently clones process.env which allows
inherited NMEM_API_URL/NMEM_API_KEY to survive and override resolved plugin
config; modify buildNmemSpawnEnv to start from a fresh env object that
explicitly clears NMEM_API_URL and NMEM_API_KEY (do not copy them from
process.env), then overlay values from plugin config: if apiUrl is set and not
equal to LOCAL_API_URL set NMEM_API_URL, and if apiKey set NMEM_API_KEY; ensure
process.env values are only used if neither pluginConfig nor user config provide
them (i.e., consult process.env as a fallback rather than the initial source).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a54af957-18c3-4c50-aca4-c89094405b82
⛔ Files ignored due to path filters (1)
nowledge-mem-openclaw-plugin/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (13)
nowledge-mem-openclaw-plugin/CHANGELOG.mdnowledge-mem-openclaw-plugin/CLAUDE.mdnowledge-mem-openclaw-plugin/README.mdnowledge-mem-openclaw-plugin/openclaw.plugin.jsonnowledge-mem-openclaw-plugin/package.jsonnowledge-mem-openclaw-plugin/src/client.jsnowledge-mem-openclaw-plugin/src/commands/slash.jsnowledge-mem-openclaw-plugin/src/hooks/behavioral.jsnowledge-mem-openclaw-plugin/src/index.jsnowledge-mem-openclaw-plugin/src/spawn-env.jsnowledge-mem-openclaw-plugin/src/tools/forget.jsnowledge-mem-openclaw-plugin/src/tools/save.jsnowledge-mem-openclaw-plugin/src/tools/status.js
✅ Files skipped from review due to trivial changes (1)
- nowledge-mem-openclaw-plugin/openclaw.plugin.json
fix(plugins): align CLI flags after t show -m → -n normalization
Add native Droid plugin for Nowledge Mem
Summary by CodeRabbit
New Features
Documentation
Chores