Conversation
📝 WalkthroughWalkthroughThis PR makes Context Bundle the preferred session-start context across the codebase (with Working Memory as a fallback), adds client/provider/plugin APIs and tools to read Context Bundles, broadens proactive save guidance to include facts/events with structured unit types, and updates tests and docs accordingly. ChangesContext Bundle Core Implementation & Integration
Hooks, Scripts & Tests
Behavioral Guidance & Documentation
Client Libraries and OpenClaw
Tests, Manifests & Version Bumps
Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
nowledge-mem-hermes/provider.py (1)
277-280: 💤 Low valueConsider replacing
getattrwithhasattrcheck or try/except.The
getattr(self._client, "context_bundle")pattern works but is flagged by static analysis. Consider this more idiomatic approach:- raw_identity = kwargs.get("agent_identity") - host_agent_id = str(raw_identity).strip() if raw_identity else None try: - context_bundle = getattr(self._client, "context_bundle")( + context_bundle = self._client.context_bundle( source_app="hermes", host_agent_id=host_agent_id, ) self._context_bundle = self._format_context_bundle(context_bundle) - except Exception as error: + except (AttributeError, Exception) as error:This makes the backward compatibility intent clearer and explicitly catches
AttributeErrorwhen the method doesn't exist on older clients.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nowledge-mem-hermes/provider.py` around lines 277 - 280, Replace the getattr(self._client, "context_bundle")(...) usage with an explicit existence check or try/except to handle older clients: either use hasattr(self._client, "context_bundle") and call self._client.context_bundle(...) only when present, or wrap the call to self._client.context_bundle(...) in a try/except AttributeError to provide a clear fallback path; update the block around context_bundle and self._client so the intent of backward compatibility is explicit and AttributeError is handled gracefully.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@nowledge-mem-openclaw-plugin/skills/memory-guide/SKILL.md`:
- Line 34: The behavioral runtime hook that controls autonomous saves currently
restricts triggers to decision/preference/plan/procedure/learning but SKILL.md
expands that taxonomy to include durable fact, event, and important context;
update the behavioral hook in behavioral.js by expanding the trigger list (the
array or constant that enumerates allowed autonomous-save types used by the
exported behavioral handler) to include "durable_fact" (or "fact"/"durable fact"
to match SKILL.md wording), "event", and "important_context" (or the canonical
strings used in SKILL.md), and update any related conditional logic, comments,
and tests so the runtime will autonomously save those new types exactly as the
skill instructs.
In `@nowledge-mem-proma-plugin/skills/read-working-memory/SKILL.md`:
- Around line 21-27: The fenced code blocks containing the MCP identifiers
(mcp__nowledge-mem__read_context_bundle and
mcp__nowledge-mem__read_working_memory) are missing language tags; update each
opening fence to include a language identifier (e.g., "text") so the blocks read
as fenced code with a language (replace ``` with ```text) to satisfy
markdownlint and ensure consistent rendering for those two blocks in SKILL.md.
---
Nitpick comments:
In `@nowledge-mem-hermes/provider.py`:
- Around line 277-280: Replace the getattr(self._client, "context_bundle")(...)
usage with an explicit existence check or try/except to handle older clients:
either use hasattr(self._client, "context_bundle") and call
self._client.context_bundle(...) only when present, or wrap the call to
self._client.context_bundle(...) in a try/except AttributeError to provide a
clear fallback path; update the block around context_bundle and self._client so
the intent of backward compatibility is explicit and AttributeError is handled
gracefully.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5c2487b-3244-45f4-b0ea-67370cb85f5a
📒 Files selected for processing (37)
docs/PLUGIN_DEVELOPMENT_GUIDE.mdnowledge-mem-claude-code-plugin/README.mdnowledge-mem-claude-code-plugin/scripts/nmem-hook-read.shnowledge-mem-claude-code-plugin/skills/distill-memory/SKILL.mdnowledge-mem-claude-code-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-claude-code-plugin/tests/test_nmem_hook_read.pynowledge-mem-codex-plugin/AGENTS.mdnowledge-mem-codex-plugin/README.mdnowledge-mem-codex-plugin/skills/working-memory/SKILL.mdnowledge-mem-codex-prompts/AGENTS.mdnowledge-mem-codex-prompts/distill.mdnowledge-mem-copilot-cli-plugin/AGENTS.mdnowledge-mem-copilot-cli-plugin/skills/distill-memory/SKILL.mdnowledge-mem-copilot-cli-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-cursor-plugin/skills/distill-memory/SKILL.mdnowledge-mem-cursor-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-droid-plugin/skills/distill-memory/SKILL.mdnowledge-mem-droid-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-gemini-clinowledge-mem-hermes/AGENTS.mdnowledge-mem-hermes/README.mdnowledge-mem-hermes/client.pynowledge-mem-hermes/provider.pynowledge-mem-npx-skills/README.mdnowledge-mem-npx-skills/skills/distill-memory/SKILL.mdnowledge-mem-npx-skills/skills/read-working-memory/SKILL.mdnowledge-mem-openclaw-plugin/skills/memory-guide/SKILL.mdnowledge-mem-opencode-plugin/AGENTS.mdnowledge-mem-opencode-plugin/README.mdnowledge-mem-opencode-plugin/src/index.tsnowledge-mem-pi-package/AGENTS.mdnowledge-mem-pi-package/skills/distill-memory/SKILL.mdnowledge-mem-pi-package/skills/read-working-memory/SKILL.mdnowledge-mem-proma-plugin/skills/distill-memory/SKILL.mdnowledge-mem-proma-plugin/skills/read-working-memory/SKILL.mdshared/behavioral-guidance.mdtests/plugin_e2e/test_key_plugins_e2e.py
| ## Save (nowledge_mem_save) | ||
|
|
||
| Save proactively when the conversation produces a decision, preference, plan, procedure, learning, or important context. Do not wait to be asked. | ||
| Save proactively when the conversation produces a durable fact, preference, decision, plan, procedure, learning, event, or important context. Do not wait to be asked. |
There was a problem hiding this comment.
Sync OpenClaw runtime behavioral hook with this expanded save taxonomy.
This skill now instructs autonomous saves for durable fact/event/important context, but the supplied runtime snippet (nowledge-mem-openclaw-plugin/src/hooks/behavioral.js, Lines 24-36) still limits autonomous-save triggers to decision/preference/plan/procedure/learning. That mismatch can cause documented behavior to not occur in real sessions.
Suggested runtime wording update
- "Save autonomously with nowledge_mem_save when the conversation produces a decision, preference, plan, procedure, or learning. Do not wait to be asked.",
+ "Save autonomously with nowledge_mem_save when the conversation produces a durable fact, preference, decision, plan, procedure, learning, event, or important context. Do not wait to be asked.",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@nowledge-mem-openclaw-plugin/skills/memory-guide/SKILL.md` at line 34, The
behavioral runtime hook that controls autonomous saves currently restricts
triggers to decision/preference/plan/procedure/learning but SKILL.md expands
that taxonomy to include durable fact, event, and important context; update the
behavioral hook in behavioral.js by expanding the trigger list (the array or
constant that enumerates allowed autonomous-save types used by the exported
behavioral handler) to include "durable_fact" (or "fact"/"durable fact" to match
SKILL.md wording), "event", and "important_context" (or the canonical strings
used in SKILL.md), and update any related conditional logic, comments, and tests
so the runtime will autonomously save those new types exactly as the skill
instructs.
| ``` | ||
| mcp__nowledge-mem__read_context_bundle | ||
| ``` | ||
|
|
||
| **Lightweight MCP**: | ||
| ``` | ||
| mcp__nowledge-mem__read_working_memory |
There was a problem hiding this comment.
Add language identifiers to fenced code blocks.
The fences under “Primary (MCP, full startup context)” and “Lightweight MCP” are missing language tags, which will keep markdownlint warnings active and reduce renderer consistency.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 21-21: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
[warning] 26-26: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@nowledge-mem-proma-plugin/skills/read-working-memory/SKILL.md` around lines
21 - 27, The fenced code blocks containing the MCP identifiers
(mcp__nowledge-mem__read_context_bundle and
mcp__nowledge-mem__read_working_memory) are missing language tags; update each
opening fence to include a language identifier (e.g., "text") so the blocks read
as fenced code with a language (replace ``` with ```text) to satisfy
markdownlint and ensure consistent rendering for those two blocks in SKILL.md.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
nowledge-mem-proma-plugin/hooks/read-working-memory.py (1)
14-18:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winRemove duplicate
import osstatement.The module is imported at both line 14 and line 18. Remove one of them.
🧹 Proposed fix
import json import os import shutil import subprocess import sys -import os from datetime import datetime🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nowledge-mem-proma-plugin/hooks/read-working-memory.py` around lines 14 - 18, The file read-working-memory.py contains a duplicated import of the os module (two "import os" lines in the shown diff); remove the redundant import so only one "import os" remains (locate the duplicate lines in the top-level imports in read-working-memory.py and delete the extra "import os" entry).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@nowledge-mem-proma-plugin/hooks/read-working-memory.py`:
- Around line 14-18: The file read-working-memory.py contains a duplicated
import of the os module (two "import os" lines in the shown diff); remove the
redundant import so only one "import os" remains (locate the duplicate lines in
the top-level imports in read-working-memory.py and delete the extra "import os"
entry).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8199ee70-7424-47bd-b7f9-bc77757dc9dd
⛔ Files ignored due to path filters (1)
nowledge-mem-openclaw-plugin/package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (82)
README.mdintegrations.jsonnowledge-mem-alma-plugin/CHANGELOG.mdnowledge-mem-alma-plugin/README.mdnowledge-mem-alma-plugin/alma-skill-nowledge-mem.mdnowledge-mem-alma-plugin/main.jsnowledge-mem-alma-plugin/manifest.jsonnowledge-mem-alma-plugin/package.jsonnowledge-mem-alma-plugin/tests/space-resolution.test.mjsnowledge-mem-bub-plugin/CHANGELOG.mdnowledge-mem-bub-plugin/README.mdnowledge-mem-bub-plugin/pyproject.tomlnowledge-mem-bub-plugin/src/nowledge_mem_bub/client.pynowledge-mem-bub-plugin/src/nowledge_mem_bub/plugin.pynowledge-mem-bub-plugin/src/nowledge_mem_bub/tools.pynowledge-mem-bub-plugin/src/skills/nowledge-mem/SKILL.mdnowledge-mem-claude-code-plugin/README.mdnowledge-mem-claude-code-plugin/hooks/hooks.jsonnowledge-mem-claude-code-plugin/scripts/nmem-hook-read.shnowledge-mem-claude-code-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-claude-code-plugin/tests/test_nmem_hook_read.pynowledge-mem-codex-plugin/AGENTS.mdnowledge-mem-codex-plugin/README.mdnowledge-mem-codex-plugin/skills/search-memory/SKILL.mdnowledge-mem-codex-plugin/skills/working-memory/SKILL.mdnowledge-mem-codex-prompts/AGENTS.mdnowledge-mem-codex-prompts/README.mdnowledge-mem-codex-prompts/read_working_memory.mdnowledge-mem-copilot-cli-plugin/.claude-plugin/plugin.jsonnowledge-mem-copilot-cli-plugin/CHANGELOG.mdnowledge-mem-copilot-cli-plugin/README.mdnowledge-mem-copilot-cli-plugin/RELEASING.mdnowledge-mem-copilot-cli-plugin/hooks/hooks.jsonnowledge-mem-copilot-cli-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-cursor-plugin/.cursor-plugin/plugin.jsonnowledge-mem-cursor-plugin/CHANGELOG.mdnowledge-mem-cursor-plugin/README.mdnowledge-mem-cursor-plugin/RELEASING.mdnowledge-mem-cursor-plugin/hooks/session-start.mjsnowledge-mem-cursor-plugin/rules/nowledge-mem.mdcnowledge-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-read-working-memory.mdnowledge-mem-droid-plugin/hooks/hooks.jsonnowledge-mem-droid-plugin/skills/read-working-memory/SKILL.mdnowledge-mem-gemini-clinowledge-mem-hermes/README.mdnowledge-mem-npx-skills/README.mdnowledge-mem-npx-skills/skills/read-working-memory/SKILL.mdnowledge-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/skills/memory-guide/SKILL.mdnowledge-mem-openclaw-plugin/src/client.jsnowledge-mem-openclaw-plugin/src/context-engine.jsnowledge-mem-openclaw-plugin/src/corpus-supplement.jsnowledge-mem-openclaw-plugin/src/hooks/recall.jsnowledge-mem-openclaw-plugin/src/tools/context.jsnowledge-mem-openclaw-plugin/src/tools/status.jsnowledge-mem-openclaw-plugin/tests/space-config.test.mjsnowledge-mem-openclaw-plugin/tests/status-tool.test.mjsnowledge-mem-opencode-plugin/AGENTS.mdnowledge-mem-opencode-plugin/CHANGELOG.mdnowledge-mem-opencode-plugin/README.mdnowledge-mem-opencode-plugin/package.jsonnowledge-mem-opencode-plugin/src/index.tsnowledge-mem-pi-package/AGENTS.mdnowledge-mem-pi-package/CHANGELOG.mdnowledge-mem-pi-package/package.jsonnowledge-mem-pi-package/skills/read-working-memory/SKILL.mdnowledge-mem-proma-plugin/.claude-plugin/plugin.jsonnowledge-mem-proma-plugin/CHANGELOG.mdnowledge-mem-proma-plugin/README.mdnowledge-mem-proma-plugin/hooks/read-working-memory.pynowledge-mem-proma-plugin/skills/read-working-memory/SKILL.mdshared/behavioral-guidance.mdtests/plugin_e2e/test_key_plugins_e2e.pytests/plugin_e2e/test_proma_plugin.py
✅ Files skipped from review due to trivial changes (39)
- nowledge-mem-alma-plugin/package.json
- nowledge-mem-bub-plugin/pyproject.toml
- nowledge-mem-copilot-cli-plugin/.claude-plugin/plugin.json
- nowledge-mem-pi-package/package.json
- nowledge-mem-droid-plugin/.factory-plugin/plugin.json
- nowledge-mem-cursor-plugin/.cursor-plugin/plugin.json
- nowledge-mem-proma-plugin/.claude-plugin/plugin.json
- nowledge-mem-copilot-cli-plugin/RELEASING.md
- nowledge-mem-bub-plugin/CHANGELOG.md
- nowledge-mem-openclaw-plugin/package.json
- nowledge-mem-opencode-plugin/package.json
- nowledge-mem-alma-plugin/CHANGELOG.md
- nowledge-mem-cursor-plugin/rules/nowledge-mem.mdc
- nowledge-mem-openclaw-plugin/src/corpus-supplement.js
- nowledge-mem-droid-plugin/commands/nowledge-read-working-memory.md
- nowledge-mem-codex-prompts/README.md
- nowledge-mem-opencode-plugin/CHANGELOG.md
- nowledge-mem-openclaw-plugin/openclaw.plugin.json
- nowledge-mem-proma-plugin/README.md
- nowledge-mem-pi-package/CHANGELOG.md
- nowledge-mem-bub-plugin/README.md
- nowledge-mem-openclaw-plugin/CHANGELOG.md
- nowledge-mem-cursor-plugin/RELEASING.md
- nowledge-mem-droid-plugin/RELEASING.md
- nowledge-mem-claude-code-plugin/hooks/hooks.json
- nowledge-mem-hermes/README.md
- nowledge-mem-openclaw-plugin/skills/memory-guide/SKILL.md
- nowledge-mem-codex-plugin/skills/working-memory/SKILL.md
- nowledge-mem-copilot-cli-plugin/README.md
- nowledge-mem-pi-package/AGENTS.md
- nowledge-mem-codex-plugin/skills/search-memory/SKILL.md
- nowledge-mem-claude-code-plugin/README.md
- nowledge-mem-npx-skills/skills/read-working-memory/SKILL.md
- nowledge-mem-opencode-plugin/AGENTS.md
- nowledge-mem-opencode-plugin/README.md
- nowledge-mem-codex-plugin/README.md
- nowledge-mem-codex-plugin/AGENTS.md
- nowledge-mem-proma-plugin/skills/read-working-memory/SKILL.md
- nowledge-mem-claude-code-plugin/skills/read-working-memory/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (5)
- nowledge-mem-gemini-cli
- nowledge-mem-copilot-cli-plugin/skills/read-working-memory/SKILL.md
- nowledge-mem-claude-code-plugin/scripts/nmem-hook-read.sh
- nowledge-mem-claude-code-plugin/tests/test_nmem_hook_read.py
- nowledge-mem-droid-plugin/skills/read-working-memory/SKILL.md
Summary by CodeRabbit
New Features
Documentation