Skip to content

feat(examples): mark recalled memories as used#1079

Merged
qin-ctx merged 1 commit intovolcengine:mainfrom
0xble:feature/retrieval-feedback-examples
Mar 30, 2026
Merged

feat(examples): mark recalled memories as used#1079
qin-ctx merged 1 commit intovolcengine:mainfrom
0xble:feature/retrieval-feedback-examples

Conversation

@0xble
Copy link
Copy Markdown
Contributor

@0xble 0xble commented Mar 30, 2026

Description

Mark recalled memories as used() in the existing Claude Code and OpenClaw examples so retrieval feedback feeds back into OpenViking hotness/ranking.

This keeps the change narrowly scoped to the example integrations that already perform recall.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Add sessionUsed() support to the OpenClaw example client.
  • Mark recalled memory URIs as used() during OpenClaw recall before continuing with normal injection flow.
  • Add the same fire-and-forget session.used() plus commit() feedback loop to the Claude Code memory example and auto-recall script.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Verified locally with:

cd examples/claude-code-memory-plugin
npm ci
npm run build

cd ../openclaw-plugin
npm ci
npm test

OpenClaw plugin tests are currently red on upstream main before this patch as well. The same two failures reproduce on a clean upstream-based worktree:

  • context-engine-assemble.test.ts > assembles summary archive and completed tool parts into agent messages
  • context-engine-assemble.test.ts > emits a non-error toolResult for a running tool

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

  • This PR intentionally stays at the example layer and does not change core retrieval APIs.
  • The OpenClaw-side diff is limited to marking recalled URIs as used; unrelated local-only runtime wiring is excluded.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@qin-ctx qin-ctx merged commit 7122c3c into volcengine:main Mar 30, 2026
1 of 2 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 30, 2026
qin-ptr added a commit to qin-ptr/OpenViking that referenced this pull request Mar 30, 2026
qin-ctx pushed a commit that referenced this pull request Mar 30, 2026
@qin-ctx
Copy link
Copy Markdown
Collaborator

qin-ctx commented Mar 30, 2026

Thanks for the feature work here.

We found a regression in the OpenClaw example after #1079 landed. In examples/openclaw-plugin/index.ts, ov_archive_expand() renamed the local variable at the top of the block from sessionId to activeSessionId, but later references in the same function still used sessionId (if (!sessionId && !sessionKey), later logs, and returned details).

That left the block inconsistent, so we reverted the PR in #1090 to restore main to a safe state.

If you want to re-land this change, please send a follow-up that keeps that block internally consistent and we can take another look.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants