Skip to content

Openclaw local plugin 20260324#1386

Merged
syzsunshine219 merged 17 commits intomainfrom
openclaw-local-plugin-20260324
Mar 31, 2026
Merged

Openclaw local plugin 20260324#1386
syzsunshine219 merged 17 commits intomainfrom
openclaw-local-plugin-20260324

Conversation

@syzsunshine219
Copy link
Copy Markdown
Collaborator

Description

Please include a summary of the change, the problem it solves, the implementation approach, and relevant context. List any dependencies required for this change.

Related Issue (Required): Fixes #issue_number

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g. code style improvements, linting)
  • Documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Unit Test
  • Test Script Or Test Steps (please provide)
  • Pipeline Automated API Test (please provide)

Checklist

  • I have performed a self-review of my own code | 我已自行检查了自己的代码
  • I have commented my code in hard-to-understand areas | 我已在难以理解的地方对代码进行了注释
  • I have added tests that prove my fix is effective or that my feature works | 我已添加测试以证明我的修复有效或功能正常
  • I have created related documentation issue/PR in MemOS-Docs (if applicable) | 我已在 MemOS-Docs 中创建了相关的文档 issue/PR(如果适用)
  • I have linked the issue to this PR (if applicable) | 我已将 issue 链接到此 PR(如果适用)
  • I have mentioned the person who will review this PR | 我已提及将审查此 PR 的人

Reviewer Checklist

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Made sure Checks passed
  • Tests have been provided

CaralHsi and others added 17 commits March 23, 2026 21:15
## Description

Please include a summary of the change, the problem it solves, the
implementation approach, and relevant context. List any dependencies
required for this change.

Related Issue (Required):  Fixes #issue_number

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style
improvements, linting)
- [ ] Documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Unit Test
- [ ] Test Script Or Test Steps (please provide)
- [ ] Pipeline Automated API Test (please provide)

## Checklist

- [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [ ] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [ ] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
#1331)

fix(memos-local): scope sharing state by hubInstanceId and fix owner isolation

- Add hubInstanceId to team_shared_chunks, local_shared_tasks, and
  client_hub_connection to prevent stale sharing state when switching
  between Hub instances
- Fix memory_search/timeline/get owner isolation by accepting agentId
  from tool execution context
- Fix viewer sharing queries to use role-appropriate tables (hub_memories
  vs team_shared_chunks)
- Apply maxChars truncation in memory_get handler
- Fix 11 failing tests: accuracy thresholds, integration env isolation,
  plugin-impl join flow, and task-processor topic judge flakiness

Made-with: Cursor
…ate reliability fix (#1341)

* fix: fix windows dir error

* chore: update doc

* chore: update web

* fix: add deepseek provider

* fix(memos-local): scope sharing state by hubInstanceId and fix owner isolation

- Add hubInstanceId to team_shared_chunks, local_shared_tasks, and
  client_hub_connection to prevent stale sharing state when switching
  between Hub instances
- Fix memory_search/timeline/get owner isolation by accepting agentId
  from tool execution context
- Fix viewer sharing queries to use role-appropriate tables (hub_memories
  vs team_shared_chunks)
- Apply maxChars truncation in memory_get handler
- Fix 11 failing tests: accuracy thresholds, integration env isolation,
  plugin-impl join flow, and task-processor topic judge flakiness

Made-with: Cursor

* feat(memos-local-openclaw): hub embedding on ingest, vector+FTS fusion search, LLM dedup

- Compute embeddings on Hub when memories are shared (same as task/skill),
  instead of on-the-fly at search time; auto-backfill missing vectors on startup
- Hub search now reads pre-computed vectors from hub_memory_embeddings + FTS + RRF
  (unified retrieval strategy across memory/chunk/skill)
- Add deduplication rule to LLM filterRelevant prompt so merged local+remote
  results automatically drop near-duplicate snippets
- Add LLM filtering to skill_search hub merge path (consistent with memory_search)
- Persist latest Hub username/role during client 401 recovery
- Add admin rename notification + fix client nickname consistency
- Fix Hub join dryRun logic, normalizeTimestamp compile error
- Define missing OpenClaw provider prompt constants

* refactor(memos-local-openclaw): parallel local+hub search with unified 3-phase recall

- Refactor both memory_search tool and auto-recall to a 3-phase pipeline:
  Phase 1: local engine.search() ∥ hubSearchMemories() via Promise.all
  Phase 2: merge all candidates → single LLM filterRelevant() call
  Phase 3: build response with unified { candidates, hubCandidates, filtered } structure
- Remove redundant double LLM filtering (was: local filter → hub fallback → merge filter)
- Separate hub-memory origin hits from local candidates in RecallEngine results
- Simplify trackTool serialization to a single branch matching the unified details shape
- Add dedicated "远程召回" (Hub Remote) display section in Viewer between initial retrieval and LLM filtered results

* fix(memos-local-openclaw): use exact version in auto-update to bypass npm cache

- update-check: installCommand now uses exact version (e.g. @1.0.6-beta.11) instead of dist-tag (@beta)
- frontend: always construct pkgSpec as packageName@exactVersion, pass targetVersion to backend
- backend: verify downloaded version matches targetVersion, rollback on mismatch
- npm pack: add --prefer-online flag as extra safety
- postinstall: fix native binding validation, delegate to native-binding.cjs
- update-install: flush HTTP response before SIGUSR1 restart, add no-cache headers

---------

Co-authored-by: jiang <fdjzy@qq.com>
Co-authored-by: zhaxi <syzsunshine219@gmail.com>
Co-authored-by: Jiang <33757498+hijzy@users.noreply.github.com>
Co-authored-by: CaralHsi <caralhsi@gmail.com>
## Description

use npm replace npx when installing package

Related Issue (Required): Fixes #issue_number](fix: use npm replace npx
when installing package)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style
improvements, linting)
- [ ] Documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Unit Test
- [ ] Test Script Or Test Steps (please provide)
- [ ] Pipeline Automated API Test (please provide)

## Checklist

- [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [ ] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [ ] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
#1345)

## Description

`loadOpenClawFallbackConfig` reads `openclaw.json` to build the final
fallback LLM config when the plugin's configured summarizer model fails.
Previously, it assumed `apiKey` in `models.providers` is always a plain
string. However, OpenClaw's credential system also supports `SecretRef`
format (`{ source: "env", id: "ENV_VAR_NAME" }`), which was not resolved
— causing either silent fallback skip (when treated as truthy object
passing the check but failing HTTP auth) or incorrect availability
detection in the viewer.

This PR adds `resolveApiKey()` to properly handle both plain string and
env-sourced `SecretRef` API keys in three locations:

- `src/ingest/providers/index.ts` — Summarizer fallback chain
- `src/shared/llm-call.ts` — Skill pipeline fallback chain
- `src/viewer/server.ts` — Viewer fallback model availability check

The implementation mirrors the existing `resolveApiKey` in
`src/openclaw-api.ts` (used by the host model proxy path).

Related Issue (Required): Fixes #

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

- [ ] Unit Test
- [x] Test Script Or Test Steps (please provide)

1. Configure `openclaw.json` with a SecretRef-style apiKey in
`models.providers`:
   ```json
   {
"agents": { "defaults": { "model": { "primary":
"anthropic/claude-3-haiku-20240307" } } },
     "models": {
       "providers": {
         "anthropic": {
           "baseUrl": "https://api.anthropic.com",
           "apiKey": { "source": "env", "id": "ANTHROPIC_API_KEY" }
         }
       }
     }
   }
   ```
2. Set `ANTHROPIC_API_KEY` in environment.
3. Configure the plugin summarizer with an intentionally invalid
OpenAI-compatible endpoint so it fails.
4. Verify the fallback chain correctly resolves the Anthropic API key
from env and completes summarization via Anthropic format.

## Checklist

- [x] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [x] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [ ] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
## Description

Please include a summary of the change, the problem it solves, the
implementation approach, and relevant context. List any dependencies
required for this change.

Related Issue (Required):  Fixes #issue_number

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style
improvements, linting)
- [ ] Documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Unit Test
- [ ] Test Script Or Test Steps (please provide)
- [ ] Pipeline Automated API Test (please provide)

## Checklist

- [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [ ] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [ ] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
## Description

Please include a summary of the change, the problem it solves, the
implementation approach, and relevant context. List any dependencies
required for this change.

Related Issue (Required):  Fixes #issue_number

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Refactor (does not change functionality, e.g. code style
improvements, linting)
- [ ] Documentation update

## How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration

- [ ] Unit Test
- [ ] Test Script Or Test Steps (please provide)
- [ ] Pipeline Automated API Test (please provide)

## Checklist

- [ ] I have performed a self-review of my own code | 我已自行检查了自己的代码
- [ ] I have commented my code in hard-to-understand areas |
我已在难以理解的地方对代码进行了注释
- [ ] I have added tests that prove my fix is effective or that my
feature works | 我已添加测试以证明我的修复有效或功能正常
- [ ] I have created related documentation issue/PR in
[MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) (if applicable) |
我已在 [MemOS-Docs](https://github.com/MemTensor/MemOS-Docs) 中创建了相关的文档
issue/PR(如果适用)
- [ ] I have linked the issue to this PR (if applicable) | 我已将 issue
链接到此 PR(如果适用)
- [ ] I have mentioned the person who will review this PR | 我已提及将审查此 PR
的人

## Reviewer Checklist
- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] Made sure Checks passed
- [ ] Tests have been provided
@syzsunshine219 syzsunshine219 merged commit b7e24c3 into main Mar 31, 2026
16 checks passed
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.

5 participants