feat: add explicit Honcho remember tool#95
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughThe PR adds a new ChangesHoncho Remember Tool
Sequence Diagram(s)sequenceDiagram
participant Client
participant RememberTool
participant PeerMgr
participant HonchoStorage
Client->>RememberTool: execute({ content, about?, observed?, attachToCurrentSession? })
RememberTool->>RememberTool: validate & trim content
RememberTool->>PeerMgr: resolve agentPeer and observedPeer
RememberTool->>HonchoStorage: (optional) set session metadata
RememberTool->>HonchoStorage: create conclusion in selected scope
HonchoStorage-->>RememberTool: created conclusion id/result
RememberTool-->>Client: response + details (id, content, observedId, sessionId)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 (1)
tools/remember.ts (1)
21-34: ⚡ Quick win
aboutis silently ignored whenobserved === "agent"; schema description doesn't mention this.When
observedis"agent",observedPeeris always forced toagentPeerregardless ofabout, so any caller-suppliedaboutis a no-op. Neither theaboutdescription nor theobserveddescription mentions this constraint, which may confuse an LLM caller that supplies both parameters expectingaboutto take effect.✏️ Suggested description update
about: Type.Optional( Type.String({ description: - "Sender ID of the participant the memory is about. Defaults to the current session participant.", + "Sender ID of the participant the memory is about. Defaults to the current session participant. Ignored when observed is 'agent'.", }) ),🤖 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 `@tools/remember.ts` around lines 21 - 34, The schema descriptions are misleading: when observed === "agent" the code forces observedPeer to agentPeer and any caller-supplied about is ignored, so update the Type.String description for about and the Type.Unsafe description for observed to explicitly state that about is ignored when observed is "agent" (or that observedPeer will be set to agentPeer), referencing the about and observed fields and the observedPeer/agentPeer behavior so callers (including LLMs) know the constraint.
🤖 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 `@tools/remember.ts`:
- Around line 76-84: The current code calls scope.create(...) and uses
created[0] (assigned to first) without checking for an empty response, allowing
a silent "Saved to Honcho" success when the API returned an empty array; update
the logic in tools/remember.ts around scope.create, created and first to
validate that created is a non-empty array (e.g., if (!created || created.length
=== 0) { handle as failure: throw or return an error/result indicating the write
failed }), and only construct the success message including observedPeer.id and
first.id when a valid first exists; ensure any failure path logs or surfaces the
error consistently instead of returning a silent success.
---
Nitpick comments:
In `@tools/remember.ts`:
- Around line 21-34: The schema descriptions are misleading: when observed ===
"agent" the code forces observedPeer to agentPeer and any caller-supplied about
is ignored, so update the Type.String description for about and the Type.Unsafe
description for observed to explicitly state that about is ignored when observed
is "agent" (or that observedPeer will be set to agentPeer), referencing the
about and observed fields and the observedPeer/agentPeer behavior so callers
(including LLMs) know the constraint.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9681c672-40f0-460b-8f9f-168d64c6932b
📒 Files selected for processing (3)
index.tsopenclaw.plugin.jsontools/remember.ts
Summary
honcho_rememberfor explicit durable memory writes into Honcho conclusionscontracts.toolsso OpenClaw plugin diagnostics know about themWhy
OpenClaw can use Honcho as the active memory backend for capture/recall, but agents currently lack a clean first-class tool for explicit “remember this” writes. This makes durable project state writes fall back to local Markdown or ad-hoc CLI usage.
Test plan
pnpm buildpnpm exec vitest runAll tests pass locally: 35/35.
Summary by CodeRabbit