fix: CLI help and docs papercuts#897
Conversation
- derive the connect agent list in --help from the adapter registry (18 agents, was a stale 9-name list) - warn on unknown --tools values instead of silently treating them as all - point claude-code, hermes, and openclaw protocol notes at real doc URLs (the docs/*.md paths never existed) - correct skill count to 15 in the connect summary and AGENTS.md - name the real 8 core tools in INSTALL_FOR_AGENTS.md - extend the tool-count consistency test to guard skill counts and the core tool sentence
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughUpdates project to reflect 15 agentmemory skills, defines a new core tools set, adds dynamic connect help with --tools validation, consolidates connector docs to GitHub links, and adds tests ensuring docs and CLI match filesystem-derived skill/tool counts. ChangesSkills and Core Tools Update
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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: 1
🧹 Nitpick comments (3)
src/cli/connect/claude-code.ts (1)
43-45: ⚡ Quick winExtract duplicated URL to a constant.
The same GitHub URL appears in both
docs(line 43) andprotocolNote(line 45). Consider extracting it to a constant to prevent drift.♻️ Proposed refactor
+const DOCS = "https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it"; + export const adapter: ConnectAdapter = { name: "claude-code", displayName: "Claude Code", category: "native", - docs: "https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it", + docs: DOCS, protocolNote: - "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory#claude-code-one-block-paste-it.", + `→ Using MCP. Hooks are also available — see ${DOCS}.`,🤖 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 `@src/cli/connect/claude-code.ts` around lines 43 - 45, Extract the duplicated GitHub URL used in the docs and protocolNote object properties into a single constant (e.g., CLAUDE_CODE_DOCS_URL) and replace both occurrences with that constant; update the definition near the top of the module and reference the constant in the docs and protocolNote fields so the URL is maintained in one place and cannot drift.src/cli/connect/openclaw.ts (1)
11-13: ⚡ Quick winExtract duplicated URL to a constant.
The same GitHub URL appears in both
docs(line 11) andprotocolNote(line 13). Extract it to a constant to prevent drift.♻️ Proposed refactor
+const DOCS = "https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw"; + export const adapter = createJsonMcpAdapter({ name: "openclaw", displayName: "OpenClaw", category: "native", detectDir: join(homedir(), ".openclaw"), configPath: join(homedir(), ".openclaw", "openclaw.json"), - docs: "https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw", + docs: DOCS, protocolNote: - "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory/tree/main/integrations/openclaw.", + `→ Using MCP. Hooks are also available — see ${DOCS}.`, });🤖 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 `@src/cli/connect/openclaw.ts` around lines 11 - 13, Extract the duplicated GitHub URL used in openclaw's metadata into a single constant (e.g., OPENCLAW_DOCS_URL) at the top of src/cli/connect/openclaw.ts and replace the inline URL in both the docs field and inside protocolNote with that constant (use string/template concatenation as needed for the arrow/prefix in protocolNote). Ensure the constant name is descriptive and update both references so the file no longer contains the same literal URL twice.src/cli/connect/hermes.ts (1)
16-17: ⚡ Quick winReuse the existing
DOCSconstant.The
protocolNotehardcodes the GitHub URL that's already defined in theDOCSconstant (line 9). Thedocsfield already uses this constant (line 15)—protocolNoteshould follow the same pattern.♻️ Proposed refactor
protocolNote: - "→ Using MCP. Hooks are also available — see https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes.", + `→ Using MCP. Hooks are also available — see ${DOCS}.`,🤖 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 `@src/cli/connect/hermes.ts` around lines 16 - 17, The protocolNote currently hardcodes the GitHub URL; change it to reuse the existing DOCS constant (the same one used by the docs field) by referencing DOCS when constructing protocolNote so the URL stays centralized; update the protocolNote string (in the object that defines protocolNote and docs) to interpolate or concatenate DOCS instead of the literal "https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes".
🤖 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 `@src/cli.ts`:
- Around line 211-217: The code warns on invalid toolsMode but still persists
the original value; update the branch that checks toolsMode (the if block
referencing toolsMode !== "all" && toolsMode !== "core") to normalize the value
before writing the env: set toolsMode = "all" (or desired fallback) inside that
block and then assign process.env["AGENTMEMORY_TOOLS"] = toolsMode so the
normalized value is persisted; ensure the p.log.warn message remains informative
and uses the normalized value if needed.
---
Nitpick comments:
In `@src/cli/connect/claude-code.ts`:
- Around line 43-45: Extract the duplicated GitHub URL used in the docs and
protocolNote object properties into a single constant (e.g.,
CLAUDE_CODE_DOCS_URL) and replace both occurrences with that constant; update
the definition near the top of the module and reference the constant in the docs
and protocolNote fields so the URL is maintained in one place and cannot drift.
In `@src/cli/connect/hermes.ts`:
- Around line 16-17: The protocolNote currently hardcodes the GitHub URL; change
it to reuse the existing DOCS constant (the same one used by the docs field) by
referencing DOCS when constructing protocolNote so the URL stays centralized;
update the protocolNote string (in the object that defines protocolNote and
docs) to interpolate or concatenate DOCS instead of the literal
"https://github.com/rohitg00/agentmemory/tree/main/integrations/hermes".
In `@src/cli/connect/openclaw.ts`:
- Around line 11-13: Extract the duplicated GitHub URL used in openclaw's
metadata into a single constant (e.g., OPENCLAW_DOCS_URL) at the top of
src/cli/connect/openclaw.ts and replace the inline URL in both the docs field
and inside protocolNote with that constant (use string/template concatenation as
needed for the arrow/prefix in protocolNote). Ensure the constant name is
descriptive and update both references so the file no longer contains the same
literal URL twice.
🪄 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: b288936b-c4b4-4d3e-991c-38bd1ebc4638
📒 Files selected for processing (8)
AGENTS.mdINSTALL_FOR_AGENTS.mdsrc/cli.tssrc/cli/connect/claude-code.tssrc/cli/connect/hermes.tssrc/cli/connect/index.tssrc/cli/connect/openclaw.tstest/tool-count-consistency.test.ts
| if (toolsMode !== "all" && toolsMode !== "core") { | ||
| p.log.warn( | ||
| `Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`, | ||
| ); | ||
| } | ||
| process.env["AGENTMEMORY_TOOLS"] = toolsMode; | ||
| } |
There was a problem hiding this comment.
Normalize invalid --tools values before writing env.
At Line 216, invalid input is still persisted (AGENTMEMORY_TOOLS=<invalid>), even though Line 213 says fallback is all. Persist the normalized value instead.
Suggested fix
const toolsMode = args[toolsIdx + 1]!;
+const normalizedToolsMode =
+ toolsMode === "all" || toolsMode === "core" ? toolsMode : "all";
if (toolsMode !== "all" && toolsMode !== "core") {
p.log.warn(
`Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`,
);
}
-process.env["AGENTMEMORY_TOOLS"] = toolsMode;
+process.env["AGENTMEMORY_TOOLS"] = normalizedToolsMode;📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if (toolsMode !== "all" && toolsMode !== "core") { | |
| p.log.warn( | |
| `Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`, | |
| ); | |
| } | |
| process.env["AGENTMEMORY_TOOLS"] = toolsMode; | |
| } | |
| const normalizedToolsMode = | |
| toolsMode === "all" || toolsMode === "core" ? toolsMode : "all"; | |
| if (toolsMode !== "all" && toolsMode !== "core") { | |
| p.log.warn( | |
| `Unknown --tools value "${toolsMode}" (valid: all, core); falling back to all.`, | |
| ); | |
| } | |
| process.env["AGENTMEMORY_TOOLS"] = normalizedToolsMode; | |
| } |
🤖 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 `@src/cli.ts` around lines 211 - 217, The code warns on invalid toolsMode but
still persists the original value; update the branch that checks toolsMode (the
if block referencing toolsMode !== "all" && toolsMode !== "core") to normalize
the value before writing the env: set toolsMode = "all" (or desired fallback)
inside that block and then assign process.env["AGENTMEMORY_TOOLS"] = toolsMode
so the normalized value is persisted; ensure the p.log.warn message remains
informative and uses the normalized value if needed.
|
Docs PR opened: https://github.com/mintlify-community/docs-agentmemory-abc2951c/pull/2 Updated the connect agents page to list 18 supported agents including OpenCode, and documented the new --tools validation behavior. |
Batch of DX papercuts:
Summary by CodeRabbit
Documentation
New Features
Tests