Skip to content

batch v0.6.3 changes#79

Merged
wey-gu merged 18 commits intomainfrom
dev_063
Feb 27, 2026
Merged

batch v0.6.3 changes#79
wey-gu merged 18 commits intomainfrom
dev_063

Conversation

@wey-gu
Copy link
Copy Markdown
Member

@wey-gu wey-gu commented Feb 26, 2026

Summary by CodeRabbit

  • New Features

    • Structured memory typing (unit types: decision, learning, fact, event, plan, procedure, context, preference)
    • Thread provenance linking via sourceThreadId and relatedThreads enrichment
    • Automatic memory deduplication (skips near-duplicates ≥90%) with dedup feedback
    • Thread search & fetch with pagination (offset/limit) and thread snippets
    • Status diagnostics tool reporting connectivity and settings
    • Behavioral guidance injected per turn; session modes: sessionContext and sessionDigest
  • Configuration

    • New settings: nowledgeMem.apiUrl, nowledgeMem.apiKey
    • Renamed options: sessionContext (was autoRecall), sessionDigest (was autoCapture)
  • Documentation

    • Updated CLI/examples to include --unit-type, temporal fields, and -l labels; examples reflect provenance, pagination, and dedup behavior

wey-gu and others added 15 commits February 26, 2026 12:49
- Add behavioral hook via before_prompt_build that fires every turn
  (~50 tokens) — agent now proactively saves and searches in all modes
- Rename config: sessionContext, sessionDigest, digestMinInterval,
  maxContextResults (old names work as silent aliases)
- Migrate session context from legacy before_agent_start to
  before_prompt_build

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sessionContext/sessionDigest/maxContextResults/digestMinInterval
replace old names in operating modes table, config table, hook
surface, and file descriptions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…est default true

memory_search now includes relatedThreads (past conversation snippets)
alongside memory results. Thread search is best-effort via GET /threads/search.
sessionDigest default changed from false to true - negligible cost, conversations
captured automatically. Version bumped to 0.6.4.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two new tools for progressive conversation retrieval:
- nowledge_mem_thread_search: search past conversations by keyword
- nowledge_mem_thread_fetch: fetch full messages with pagination

Memories distilled from conversations now include sourceThreadId in
search results and individual lookups, enabling agents to trace any
memory back to its source conversation and retrieve the full context.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per-turn flow, tool decision table, session lifecycle capture,
and progressive retrieval chain diagrams.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add pre-save dedup check: skip saves when ≥90% similarity match exists
- Behavioral hook adjusts for sessionContext mode (reduces redundant searches)
- README: honest Design Decisions section with Q&A on retrieval, dedup, modes
- CHANGELOG: document dedup + context-aware guidance in 0.6.5

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ter, docs accuracy

- package.json version: 0.6.3 → 0.6.5 (sync with openclaw.plugin.json)
- forget.js: require ≥0.85 score for auto-delete (was deleting single low-score results)
- client.js: pass source filter to CLI in searchThreadsFull (was silently ignored)
- README: add apiUrl/apiKey to Configuration table with valid ranges
- CLAUDE.md: update capture.js and behavioral.js descriptions to match current code

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ad pagination

- sourceThreadId in search/show/query results for thread provenance
- Structured save: unit_type, event_start/end, temporal_context
- Save dedup guard: blocks at >=90% similarity
- Thread pagination: offset/limit in thread_show
- Thread source filter in thread_search
- Behavioral guidance: proactive save nudge + sourceThreadId awareness
- Updated CLI args: --limit/--offset/--source (requires nmem-cli >=0.6)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add apiUrl/apiKey settings for connecting to a remote Mem instance.
API key injected via env var only (never as CLI arg, never logged).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
deactivate() was creating NowledgeMemClient without apiUrl/apiKey, so
auto-capture on quit would fail in remote mode (tried localhost).
Also update CLAUDE.md to reflect v0.6.1 settings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… labels

- npx search-memory: add --unit-type filter, document source_thread field
- npx distill-memory: add --unit-type and -l flags to options and examples
- npx README: add unit_type + labels to create memory example
- npx CHANGELOG: add 0.3.0 entry
- codex distill.md: add --unit-type and -l to template and example
- examples AGENTS.md: fix category names to match actual unit_type values

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reports connection mode (local/remote), API URL, API key configured
(boolean), CLI availability, server connectivity, and current settings.
Useful for verifying Access Anywhere configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…isposables

activate() now returns { dispose } per Alma API contract. Tool and event
registrations collect Disposable handles for proper cleanup on deactivation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ials

Settings (apiUrl, apiKey, recallPolicy, autoCapture, maxRecallResults)
were read once at activation and never updated. Changing Access Anywhere
credentials in Alma settings had no effect until plugin reload.

Now listens to settings.onDidChange() and recreates the client with
fresh credentials immediately. All tool closures see the updated client
via let-binding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 26, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aacfede and 6b8ff6c.

📒 Files selected for processing (2)
  • examples/AGENTS.md
  • nowledge-mem-openclaw-plugin/src/tools/forget.js
🚧 Files skipped from review as they are similar to previous changes (2)
  • nowledge-mem-openclaw-plugin/src/tools/forget.js
  • examples/AGENTS.md

📝 Walkthrough

Walkthrough

This PR standardizes memory taxonomy to unit_type, adds thread provenance via sourceThreadId, implements pre-save deduplication, adds thread search/fetch with pagination, introduces sessionContext/sessionDigest behavioral modes, and extends remote API credentialing and status tooling across plugins and CLIs.

Changes

Cohort / File(s) Summary
Docs — Memory type & CLI examples
examples/AGENTS.md, nowledge-mem-codex-prompts/distill.md, nowledge-mem-npx-skills/skills/distill-memory/SKILL.md, nowledge-mem-npx-skills/README.md, nowledge-mem-npx-skills/CHANGELOG.md
Replace legacy memory categories with --unit-type and explicit -l labels; add available unit types and update CLI examples.
Alma plugin — Docs & contracts
nowledge-mem-alma-plugin/README.md, nowledge-mem-alma-plugin/CLAUDE.md, nowledge-mem-alma-plugin/CHANGELOG.md, nowledge-mem-alma-plugin/alma-skill-nowledge-mem.md
Documented unit_type, temporal fields, dedup behavior, sourceThreadId in tool I/O, thread pagination, and remote-access notes.
Alma plugin — Core & CLI integration
nowledge-mem-alma-plugin/main.js, nowledge-mem-alma-plugin/manifest.json
NowledgeMemClient accepts credentials (apiUrl/apiKey), injects env/CLI args for remote mode, validates unit_type, runs dedup checks before store, enriches results with sourceThreadId, adds thread search/show with pagination, and adds nowledge_mem_status tool.
OpenClaw plugin — Versioning & config surface
nowledge-mem-openclaw-plugin/openclaw.plugin.json, nowledge-mem-openclaw-plugin/package.json, nowledge-mem-openclaw-plugin/CHANGELOG.md, nowledge-mem-openclaw-plugin/README.md
Bumped versions; renamed config/UI keys (autoRecall/autoCapture/... → sessionContext/sessionDigest/...), updated defaults/descriptions and README/changelog.
OpenClaw plugin — Client & thread APIs
nowledge-mem-openclaw-plugin/src/client.js, nowledge-mem-openclaw-plugin/src/config.js
Added searchThreads / searchThreadsFull / fetchThread, normalized sourceThreadId on memories, added config aliases and new default shaping (sessionDigest default true).
OpenClaw plugin — Hooks & lifecycle
nowledge-mem-openclaw-plugin/src/hooks/behavioral.js, nowledge-mem-openclaw-plugin/src/hooks/capture.js, nowledge-mem-openclaw-plugin/src/hooks/recall.js, nowledge-mem-openclaw-plugin/src/index.js
Introduced always-on behavioral hook (session-aware), switched capture gating to sessionDigest and digestMinInterval, adjusted recall to use maxContextResults, registered thread tools and rewired lifecycle hooks.
OpenClaw plugin — Tools & behaviors
nowledge-mem-openclaw-plugin/src/tools/...
.../forget.js, .../memory-get.js, .../memory-search.js, .../save.js, .../thread-search.js, .../thread-fetch.js
Added sourceThreadId provenance, memory_search enrichment with relatedThreads via thread search, pre-save dedup check (skip if ≥90% similar), narrowed forget auto-delete conditions, and added thread-search/thread-fetch tools with pagination and robust error handling.
NPX/skills changelogs & SKILL docs
nowledge-mem-npx-skills/CHANGELOG.md, nowledge-mem-npx-skills/skills/*
Documented new --unit-type/-l flags for distill/search skills and added unit-type filters in examples.

Sequence Diagrams

sequenceDiagram
    participant User
    participant Plugin
    participant MemoryService
    participant ThreadService

    User->>Plugin: Save memory (text, unit_type, labels)
    Plugin->>MemoryService: searchRich(query) — dedup check
    alt Found ≥90% similar
        MemoryService-->>Plugin: existing memory (id, similarity)
        Plugin->>User: Return skipped save (duplicate, existingId)
    else No duplicate
        Plugin->>MemoryService: store(item with unit_type, temporal, labels)
        MemoryService-->>Plugin: saved item (id, sourceThreadId)
        Plugin->>User: Return saved summary
    end
Loading
sequenceDiagram
    participant Client
    participant MemoryService
    participant ThreadService
    participant Plugin

    Client->>MemoryService: searchRich(query, limit)
    MemoryService-->>Client: memories (each may include sourceThreadId)
    Client->>ThreadService: searchThreadsFull(query, {limit, source})
    ThreadService-->>Client: threads metadata & matchedMessages
    Client->>Plugin: Enrich memories with relatedThreads
    Plugin->>Client: Return combined results
Loading
sequenceDiagram
    participant Agent
    participant Plugin
    participant BehavioralHook
    participant MemoryService
    participant WorkingMemory

    Note over Agent,Plugin: Per-turn prompt construction
    Agent->>Plugin: before_prompt_build
    Plugin->>BehavioralHook: buildBehavioralHook(sessionContext)
    BehavioralHook-->>Agent: prepend guidance (session-aware)
    alt sessionContext enabled
        Plugin->>MemoryService: searchRich(context, maxContextResults)
        MemoryService-->>Plugin: relevant memories
        Plugin->>WorkingMemory: inject memories
    end
    Agent->>Agent: construct prompt
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Poem

🐇 I nibble on threads and tag each thought,

unit_type and source in my cozy spot.
Duplicates I skip with a careful hop,
Session digests keep the warren neat on top,
Hooray — tidy memories, one little hop!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'batch v0.6.3 changes' is vague and generic, using non-descriptive terminology that doesn't convey the specific nature of the changeset. Use a more descriptive title that summarizes the main feature or change, such as 'Add thread provenance, memory deduplication, and remote API support' or similar that captures the primary objectives.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev_063

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
examples/AGENTS.md (1)

81-81: ⚠️ Potential issue | 🟡 Minor

Update agent instructions to use new unit-type taxonomy.

Line 81 still references the old category names (insight/experience) which are inconsistent with the new unit-type taxonomy (learning/event) introduced earlier in the document.

📝 Proposed fix to align with new taxonomy
-2. Categorize (insight/decision/fact/procedure/experience)
+2. Categorize (learning/decision/fact/procedure/event)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/AGENTS.md` at line 81, Replace the outdated category names in the
agent instruction string "2. Categorize
(insight/decision/fact/procedure/experience)" to match the new unit-type
taxonomy by changing the listed categories to the new terms (e.g., use
"learning" and "event" where appropriate) so the instruction reads consistently
with the taxonomy used earlier in the document; update any sibling occurrences
of the old names in the same section to the new unit-type names to ensure
consistency across the agent guidance.
🧹 Nitpick comments (3)
nowledge-mem-npx-skills/skills/search-memory/SKILL.md (1)

101-101: Clarify provenance field naming across surfaces (source_thread vs sourceThreadId).

At Line 101, consider a short note about field-name mapping (CLI snake_case vs tool/API camelCase) to prevent lookup mistakes when users switch contexts.

Based on learnings: Preserve thread metadata integrity by maintaining external_id, session/source fields in memory operations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nowledge-mem-npx-skills/skills/search-memory/SKILL.md` at line 101, Doc
clarifies that provenance field names differ across surfaces and should map
consistently: add a brief note near the sentence mentioning `source_thread` to
state that the CLI uses snake_case (`source_thread`) while APIs/tools use
camelCase (`sourceThreadId`), and remind readers to use the CLI command `nmem
--json t show <thread_id>` to fetch the full conversation and that memory
records retain `external_id` and session/source metadata during operations;
ensure the note references `source_thread`, `sourceThreadId`, `nmem --json t
show <thread_id>`, and `external_id` so users know which fields to look up in
each context.
examples/AGENTS.md (1)

86-88: Consider adding --unit-type to the agent example for consistency.

The memory-keeper agent example doesn't include the --unit-type flag, which is demonstrated as best practice in the earlier examples (lines 24, 29). For consistency and to reinforce the new taxonomy, consider adding it.

♻️ Suggested enhancement for consistency
 nmem m add "Root cause: API rate limiting missing exponential backoff" \
   -t "API Rate Limiting Fix" \
-  -i 0.7
+  -i 0.7 --unit-type learning
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/AGENTS.md` around lines 86 - 88, The agent example using the "nmem m
add" command is missing the --unit-type flag used elsewhere; update the example
invocation of nmem m add (the line starting with nmem m add "Root cause: API
rate limiting missing exponential backoff") to include a --unit-type value
consistent with prior examples (e.g., --unit-type issue or --unit-type finding)
so it matches the taxonomy shown in earlier examples and reinforces the expected
flag usage.
nowledge-mem-openclaw-plugin/README.md (1)

250-257: Add language specifier to fenced code block.

The code block is missing a language identifier. Since this shows CLI-style output, consider using text or plaintext for syntax highlighting consistency.

📝 Suggested fix
-```
+```text
 threadId: "openclaw-db-arch-a1b2c3"
 offset: 0, limit: 50
 -> Thread: "Database architecture discussion" (128 messages)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nowledge-mem-openclaw-plugin/README.md` around lines 250 - 257, The fenced
code block showing CLI-style output (containing "threadId:
\"openclaw-db-arch-a1b2c3\"", offset/limit lines and the Thread line) in
README.md is missing a language specifier; edit that fenced block to add a
language identifier such as text or plaintext (e.g., ```text) so the snippet
renders with consistent plaintext/CLI highlighting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/AGENTS.md`:
- Around line 7-16: Replace the outdated category names "insight" and
"experience" in the "Categorize" step with the current taxonomy by changing the
text to "Categorize (learning/decision/fact/procedure/event)"; update the
example command that creates memories to include the --unit-type flag and use
one of the new categories (e.g., add --unit-type learning or --unit-type
decision) so the example follows the "Creating Memories" pattern and matches the
Memory Types list.

In `@nowledge-mem-openclaw-plugin/src/tools/forget.js`:
- Around line 90-91: The code currently auto-deletes based only on
results[0].score >= 0.85 even when multiple candidates exist; change the
condition to only auto-delete when there is exactly one candidate with high
confidence (e.g., results.length === 1 && results[0].score >= 0.85) and
otherwise fall back to the existing disambiguation/confirmation path (do not
perform the delete operation in the "High-confidence match — delete directly"
block unless that single-candidate check passes), updating the if that
references results and results[0].score accordingly so ambiguous multi-candidate
cases require explicit confirmation.

In `@nowledge-mem-openclaw-plugin/src/tools/thread-search.js`:
- Around line 43-45: The current assignment of the local variable `source` uses
String(safeParams.source).trim() but leaves whitespace-only input as an empty
string, which behaves as an active filter; change the logic where `source` is
defined (the `source` variable near `safeParams.source` in thread-search.js) so
that after trimming you set `source` to undefined when the trimmed result is an
empty string (i.e., treat `""` as no filter), ensuring downstream code receives
undefined instead of an empty string.

---

Outside diff comments:
In `@examples/AGENTS.md`:
- Line 81: Replace the outdated category names in the agent instruction string
"2. Categorize (insight/decision/fact/procedure/experience)" to match the new
unit-type taxonomy by changing the listed categories to the new terms (e.g., use
"learning" and "event" where appropriate) so the instruction reads consistently
with the taxonomy used earlier in the document; update any sibling occurrences
of the old names in the same section to the new unit-type names to ensure
consistency across the agent guidance.

---

Nitpick comments:
In `@examples/AGENTS.md`:
- Around line 86-88: The agent example using the "nmem m add" command is missing
the --unit-type flag used elsewhere; update the example invocation of nmem m add
(the line starting with nmem m add "Root cause: API rate limiting missing
exponential backoff") to include a --unit-type value consistent with prior
examples (e.g., --unit-type issue or --unit-type finding) so it matches the
taxonomy shown in earlier examples and reinforces the expected flag usage.

In `@nowledge-mem-npx-skills/skills/search-memory/SKILL.md`:
- Line 101: Doc clarifies that provenance field names differ across surfaces and
should map consistently: add a brief note near the sentence mentioning
`source_thread` to state that the CLI uses snake_case (`source_thread`) while
APIs/tools use camelCase (`sourceThreadId`), and remind readers to use the CLI
command `nmem --json t show <thread_id>` to fetch the full conversation and that
memory records retain `external_id` and session/source metadata during
operations; ensure the note references `source_thread`, `sourceThreadId`, `nmem
--json t show <thread_id>`, and `external_id` so users know which fields to look
up in each context.

In `@nowledge-mem-openclaw-plugin/README.md`:
- Around line 250-257: The fenced code block showing CLI-style output
(containing "threadId: \"openclaw-db-arch-a1b2c3\"", offset/limit lines and the
Thread line) in README.md is missing a language specifier; edit that fenced
block to add a language identifier such as text or plaintext (e.g., ```text) so
the snippet renders with consistent plaintext/CLI highlighting.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c43d8ea and d46ea79.

📒 Files selected for processing (29)
  • examples/AGENTS.md
  • nowledge-mem-alma-plugin/CHANGELOG.md
  • nowledge-mem-alma-plugin/CLAUDE.md
  • nowledge-mem-alma-plugin/README.md
  • nowledge-mem-alma-plugin/alma-skill-nowledge-mem.md
  • nowledge-mem-alma-plugin/main.js
  • nowledge-mem-alma-plugin/manifest.json
  • nowledge-mem-codex-prompts/distill.md
  • nowledge-mem-npx-skills/CHANGELOG.md
  • nowledge-mem-npx-skills/README.md
  • nowledge-mem-npx-skills/skills/distill-memory/SKILL.md
  • nowledge-mem-npx-skills/skills/search-memory/SKILL.md
  • nowledge-mem-openclaw-plugin/CHANGELOG.md
  • nowledge-mem-openclaw-plugin/CLAUDE.md
  • nowledge-mem-openclaw-plugin/README.md
  • nowledge-mem-openclaw-plugin/openclaw.plugin.json
  • nowledge-mem-openclaw-plugin/package.json
  • nowledge-mem-openclaw-plugin/src/client.js
  • nowledge-mem-openclaw-plugin/src/config.js
  • nowledge-mem-openclaw-plugin/src/hooks/behavioral.js
  • nowledge-mem-openclaw-plugin/src/hooks/capture.js
  • nowledge-mem-openclaw-plugin/src/hooks/recall.js
  • nowledge-mem-openclaw-plugin/src/index.js
  • nowledge-mem-openclaw-plugin/src/tools/forget.js
  • nowledge-mem-openclaw-plugin/src/tools/memory-get.js
  • nowledge-mem-openclaw-plugin/src/tools/memory-search.js
  • nowledge-mem-openclaw-plugin/src/tools/save.js
  • nowledge-mem-openclaw-plugin/src/tools/thread-fetch.js
  • nowledge-mem-openclaw-plugin/src/tools/thread-search.js

Comment thread examples/AGENTS.md
Comment thread nowledge-mem-openclaw-plugin/src/tools/forget.js Outdated
Comment thread nowledge-mem-openclaw-plugin/src/tools/thread-search.js Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

♻️ Duplicate comments (1)
nowledge-mem-openclaw-plugin/src/tools/forget.js (1)

91-98: ⚠️ Potential issue | 🟠 Major

Prevent auto-delete when multiple matches exist (destructive behavior mismatch).

At Line 97, deletion can still proceed with multiple candidates (topScore - runnerUp > 0.2). That conflicts with the tool contract (“multiple matches → user confirmation”) and can still delete the wrong memory in edge cases.

🔧 Proposed fix
-				// Requires clear winner: top score >= 0.85 AND either only one result
-				// or a significant gap (>0.2) between top and second result
+				// Requires a single high-confidence match
 				const topScore = results[0].score;
-				const runnerUp = results.length > 1 ? results[1].score : 0;
-				if (
-					topScore >= 0.85 &&
-					(results.length === 1 || topScore - runnerUp > 0.2)
-				) {
+				if (results.length === 1 && topScore >= 0.85) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@nowledge-mem-openclaw-plugin/src/tools/forget.js` around lines 91 - 98, The
current auto-delete condition (using topScore, runnerUp, and results) still
permits deletion when multiple matches exist if the score gap >0.2; change the
logic so auto-delete only occurs when there is exactly one match. Update the if
that references topScore, runnerUp, and results so it requires results.length
=== 1 AND topScore >= 0.85 for automatic deletion, and otherwise fall through to
the user-confirmation path (i.e., do not rely on topScore - runnerUp > 0.2 to
bypass confirmation).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@nowledge-mem-openclaw-plugin/src/tools/forget.js`:
- Around line 91-98: The current auto-delete condition (using topScore,
runnerUp, and results) still permits deletion when multiple matches exist if the
score gap >0.2; change the logic so auto-delete only occurs when there is
exactly one match. Update the if that references topScore, runnerUp, and results
so it requires results.length === 1 AND topScore >= 0.85 for automatic deletion,
and otherwise fall through to the user-confirmation path (i.e., do not rely on
topScore - runnerUp > 0.2 to bypass confirmation).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d46ea79 and aacfede.

📒 Files selected for processing (2)
  • nowledge-mem-openclaw-plugin/src/tools/forget.js
  • nowledge-mem-openclaw-plugin/src/tools/thread-search.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • nowledge-mem-openclaw-plugin/src/tools/thread-search.js

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