Skip to content

fix(openclaw-plugin): gate noisy recall resources#2084

Open
yshishenya wants to merge 1 commit into
volcengine:mainfrom
yshishenya:codex/openclaw-recall-russian-gating
Open

fix(openclaw-plugin): gate noisy recall resources#2084
yshishenya wants to merge 1 commit into
volcengine:mainfrom
yshishenya:codex/openclaw-recall-russian-gating

Conversation

@yshishenya
Copy link
Copy Markdown

Summary

Fixes noisy OpenClaw plugin auto-recall when shared viking://resources are enabled.

The patch adds lightweight query-aware recall gating:

  • supports Cyrillic tokens for lexical overlap ranking
  • recognizes Russian temporal/preference recall phrasing
  • skips vague low-confidence recall prompts before injecting context
  • requires a slightly stronger score for shared resource memories than for user/agent memories
  • applies the same resource score floor to explicit memory_recall
  • renders blank memory categories as [memory] instead of []

Root Cause

OpenClaw auto-recall searched user memories, agent memories, and shared resources with the same low score threshold. For vague prompts, shared resource transcripts and logs around ~0.53 score could be injected even when they were not actionable. Russian queries also did not get lexical-overlap help because the token regex only matched ASCII.

Verification

  • pnpm install
  • pnpm test tests/ut
  • pnpm build

Also verified locally against a running OpenViking/OpenClaw setup:

  • vague Russian prompt no longer injected transcript noise
  • exact OpenViking Docker regression recall still injected the expected memories
  • Russian badminton/resource query still recalled the relevant resource summary

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 16, 2026

PR Reviewer Guide 🔍

(Review updated until commit 3c7cd64)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🏅 Score: 95
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@yshishenya yshishenya marked this pull request as ready for review May 16, 2026 02:01
@github-actions
Copy link
Copy Markdown

Persistent review updated to latest commit 3c7cd64

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@yshishenya yshishenya force-pushed the codex/openclaw-recall-russian-gating branch from 3c7cd64 to 2af6cf7 Compare May 16, 2026 03:24
@qin-ctx qin-ctx requested a review from Mijamind719 May 18, 2026 06:10
@Mijamind719
Copy link
Copy Markdown
Collaborator

There is one issue with the explicit memory_recall path.

The PR says the resource score floor also applies to explicit memory_recall, but when the caller passes targetUri: "viking://resources/...", the server returns matches under the resources field. The current code later only reads result.memories, so all resource results are dropped. In practice, explicit resource recall may incorrectly return “No relevant OpenViking memories found.”

The fix should be small: before filtering/ranking in memory_recall, merge result.memories ?? [] and result.resources ?? [], then apply the existing leaf/filter/rank logic. It would also be good to add a unit test for explicit targetUri: "viking://resources/..." to make sure resource matches are preserved and the resource score floor is applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants