Skip to content

feat: add explicit Honcho remember tool#95

Open
Niko96-dotcom wants to merge 2 commits into
plastic-labs:mainfrom
Niko96-dotcom:fix/explicit-honcho-remember-tool
Open

feat: add explicit Honcho remember tool#95
Niko96-dotcom wants to merge 2 commits into
plastic-labs:mainfrom
Niko96-dotcom:fix/explicit-honcho-remember-tool

Conversation

@Niko96-dotcom

@Niko96-dotcom Niko96-dotcom commented May 8, 2026

Copy link
Copy Markdown

Summary

  • add honcho_remember for explicit durable memory writes into Honcho conclusions
  • wire the tool into the Honcho memory prompt guidance and plugin registration
  • declare Honcho-provided tools in contracts.tools so OpenClaw plugin diagnostics know about them

Why

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 build
  • pnpm exec vitest run

All tests pass locally: 35/35.

Summary by CodeRabbit

  • New Features
    • Added a "Remember" tool to explicitly save durable user/procedural memory, with options for content, observer context, and optional session attachment.
    • Expanded memory capabilities with new tools/contracts for sessions, searching conclusions and messages, and memory retrieval.
  • Tests
    • Added tests validating successful memory creation and error handling when creation fails.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dae484aa-1347-4b81-9d08-f09c3c334c89

📥 Commits

Reviewing files that changed from the base of the PR and between 6352c54 and 08dbccd.

📒 Files selected for processing (2)
  • test/remember.test.ts
  • tools/remember.ts
✅ Files skipped from review due to trivial changes (1)
  • test/remember.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • tools/remember.ts

Walkthrough

The PR adds a new honcho_remember tool to the OpenClaw plugin that enables explicit saving of durable user and procedural memory within Honcho. The implementation includes tool contract declaration, the complete registration and execution logic, and integration into the plugin's core tools and prompt guidance system.

Changes

Honcho Remember Tool

Layer / File(s) Summary
Plugin Tool Contracts
openclaw.plugin.json
Plugin manifest declares support for honcho_remember and related Honcho memory tool contracts.
Remember Tool Implementation — Imports
tools/remember.ts
Module imports and wiring for TypeBox schema, session key builder, and plugin API/state.
Remember Tool Implementation — Registration
tools/remember.ts
registerRememberTool registers honcho_remember with TypeBox parameters (content, about, observed, attachToCurrentSession) and additionalProperties: false.
Remember Tool Implementation — Execute Handler
tools/remember.ts
Execute handler trims/validates content, computes session key and agent id, resolves agent/observed peers, selects conclusions scope, optionally attaches session metadata, creates a conclusion, and returns a response with details.
Tool Registration & Prompt Integration
index.ts
Imports registerRememberTool, detects honcho_remember availability in prompt building, registers it alongside core tools, and includes a tool description line in prompt guidance when available.
Tests
test/remember.test.ts
Vitest harness tests successful conclusion creation and the error path when no created conclusions are returned.

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)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nibble bytes and tuck them tight,
I stash your thoughts in Honcho's light,
A tiny hop, a saved-up clue,
Conclusions kept for me and you,
Remembering well — the plugin's new delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a new explicit Honcho remember tool for durable memory writes, which is the primary feature across all modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
tools/remember.ts (1)

21-34: ⚡ Quick win

about is silently ignored when observed === "agent"; schema description doesn't mention this.

When observed is "agent", observedPeer is always forced to agentPeer regardless of about, so any caller-supplied about is a no-op. Neither the about description nor the observed description mentions this constraint, which may confuse an LLM caller that supplies both parameters expecting about to 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

📥 Commits

Reviewing files that changed from the base of the PR and between e9f0145 and 6352c54.

📒 Files selected for processing (3)
  • index.ts
  • openclaw.plugin.json
  • tools/remember.ts

Comment thread tools/remember.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant