Mem agent 0514#1774
Merged
Merged
Conversation
## 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
## 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
## Summary - add an embedding maintenance setting for rebuild request batch size - expose user-friendly 10/20/50/100/200/500 items-per-request options - persist the selected value in local storage and localize the UI in English and Chinese ## Tests - npm run lint
Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary - persist trace-policy evidence links in storage and expose a repo for historical lookup - include linked traces and episodes when recomputing L2 policy gain - add adaptive gain baseline and EMA smoothing config with focused L2 tests ## Tests - npm run lint - npx vitest run tests/unit/memory/l2/gain.test.ts tests/unit/memory/l2/l2.integration.test.ts tests/unit/memory/l2/subscriber.test.ts
Split episode rollups and trace memories under ## Memories, rename episode titles to Past task, add per-snippet memos_get and memos_timeline hints, and generate follow-up tool footers from the injected snippet kinds. Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary This change reorganizes tier-2 memory injection output so episode rollups and trace memories are easier to read, and it adds explicit follow-up tool guidance for expanding injected snippets. ## Changes - Split `## Memories` into `### Similar Past Tasks` and `### Relevant Trace Memories`. - Rename episode titles from `Sub-task` to `Past task`. - Add per-snippet `memos_timeline` / `memos_get` hints for episode, trace, experience, and world-model snippets. - Generate follow-up tool footers from the snippet kinds present in the injected packet. - Keep episode and trace entries in the same packet without suppressing member traces. ## Testing - `npm test -- tests/unit/retrieval/injector.test.ts` Made with [Cursor](https://cursor.com)
…ckage The files whitelist omitted telemetry.credentials.json, so published packages had no ARMS endpoint and telemetry stayed disabled for all users except those with a local credentials file. CI already generates this file before publish; listing it in files ensures it ships in the tarball. Co-authored-by: Cursor <cursoragent@cursor.com>
#1729) …ckage The files whitelist omitted telemetry.credentials.json, so published packages had no ARMS endpoint and telemetry stayed disabled for all users except those with a local credentials file. CI already generates this file before publish; listing it in files ensures it ships in the tarball. ## 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
- workflow_dispatch input git_ref to pin branch/tag/SHA (e.g. mem-agent-0512) - checkout uses git_ref when set, else the ref from Run workflow - concurrency group to avoid overlapping npm publishes Co-authored-by: Cursor <cursoragent@cursor.com>
GitHub Actions sidebar shows the workflow file top-level name field; align wording with @memtensor/memos-local-plugin (Hermes + OpenClaw). Release commit message uses memos-local-plugin; git tag unchanged (hermes-plugin-v*). Co-authored-by: Cursor <cursoragent@cursor.com>
…ridge hardening - Resolve Node via MEMOS_NODE_BINARY, .memos-node-bin, or PATH; prefer local tsx CLI when present. - Add Hermes viewer port probing, optional viewer lifecycle, and RLock for daemon state. - Adjust bridge server auth/health routes and bridge.cts wiring; extend Python tests.
…ridge hardening (#1731) ## Summary Hermes local plugin: improve how the bridge and optional Hermes viewer are discovered and started, harden daemon coordination, and align server routes with the bridge. ## Changes - **Node / bridge**: Resolve Node via `MEMOS_NODE_BINARY`, `.memos-node-bin`, or PATH; prefer local `tsx` CLI when present; centralize bridge argv construction. - **Daemon**: Use RLock for shared state; add viewer port probing (`HERMES_VIEWER_PORT`), TTL-cached status, and optional viewer subprocess lifecycle helpers. - **Server**: Small updates to `auth.ts` and `health.ts`; `bridge.cts` wiring adjustments. - **Tests**: Extended Python coverage in `test_bridge_client.py` and `test_hermes_provider_pipeline.py`. ## Checks - `ruff check` and `ruff format` on touched Python paths under `apps/memos-local-plugin`. Base: latest `upstream/mem-agent-0514` per repo workflow.
Co-authored-by: Cursor <cursoragent@cursor.com>
Read the Infini-AI embedding key from INFINI_AI_EMBEDDING_API_KEY so the test no longer stores a real credential in source. Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary - add configurable lightweight memory mode for memos-local-plugin capture/retrieval/orchestration - move lightweight memory control to Settings > General and place password protection above danger actions - keep lightweight trace data out of higher-level task/skill/policy/world-model views and add empty states - tighten password-protected /api/v1/ping gating to match auth expectations ## Tests - npm test - npm run lint - npm run build - npm run build:viewer - npm pack --silent
## Summary - default new configs to low-cost summary memory - present the setting as an opt-in memory self-evolution capability - update task, experience, environment, and skill empty states to guide users toward enabling self-evolution ## Tests - npm test -- tests/unit/config/load.test.ts tests/unit/config/writer.test.ts - npm run lint - npm run build
…he prompt. (#1743) Automated PR from mem-agent-0514-niu to mem-agent-0514.
Inject task context and tool outcomes into reflection synthesis, and keep alpha reasons visible in trace-level reflect logs. Co-authored-by: Cursor <cursoragent@cursor.com>
Automated PR from mem-agent-0514-niu to mem-agent-0514.
## Summary - start the Hermes stdio bridge before core.init() so startup recovery can use host LLM fallback safely - clean up stdio/heartbeat if core init fails - make the Hermes Python bridge client wait briefly for late reverse-RPC host handler registration - add regression coverage for delayed host.llm.complete handler registration ## Tests - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff format adapters/hermes/memos_provider/bridge_client.py tests/python/test_bridge_client.py - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff check adapters/hermes/memos_provider/bridge_client.py tests/python/test_bridge_client.py - npm run lint - npm test -- tests/unit/bridge/stdio.test.ts tests/unit/llm/client.test.ts - python3 -m unittest tests.python.test_bridge_client.BridgeClientTests
Automated PR from mem-agent-0514-niu to mem-agent-0514.
## Summary - Rework MemOS Local team Hub runtime with server/client auth, approval state, soft-delete sharing, and Hub memory search. - Update Hub sharing UI so Hub hosts and clients see role-specific controls, nickname/team-token flow, member removal, and refreshed status. - Merge Hub retrieval as one retrieval route, dedupe local/Hub hits, run a single local LLM filter, and cap OpenClaw injected memory context. - Persist Hub sharing metadata and add Hub runtime/storage tests. ## Verification - PASS: `git diff --check -- apps/memos-local-plugin` - PASS: `bash -n install.sh` - PASS: `npm run lint` - PASS: `npx vitest run tests/unit/hub/runtime.test.ts tests/unit/retrieval/integration.test.ts tests/unit/viewer/share.test.ts tests/unit/server/http.test.ts` - KNOWN FAIL: `npx vitest run tests/unit/pipeline/memory-core.test.ts` currently has 8 failing legacy behavior assertions around subagent timeline visibility, feedback priority, and restart/rescore expectations. ## Scope Only files under `apps/memos-local-plugin` are included, per `AGENTS_jiang.md`.
## Summary - batch memory bundle import writes and cache native import scans to reduce UI stalls during large imports - make memories pagination avoid expensive total counts while preserving navigation - fix overview model cards so connected status cannot render as [object Object] ## Tests - npm run lint - npm run build:viewer - npx vitest run tests/unit/viewer/overview-model-status.test.ts - npx vitest run tests/unit/server/http.test.ts - npx vitest run tests/unit/pipeline/memory-core.test.ts -t "repairs missing and wrong-dimension imported trace embeddings" No Python files changed, so ruff was not applicable.
## Summary - prefer the compiled dist/bridge.cjs runtime for packaged Hermes bridge launches - resolve bridge runtime imports from compiled dist JS with source fallback - print full fatal stack traces and update installers to use the packaged bridge entry ## Verification - npm run build - npm run lint - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff format apps/memos-local-plugin/adapters/hermes/memos_provider - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff check apps/memos-local-plugin/adapters/hermes/memos_provider - bash -n apps/memos-local-plugin/install.sh - node dist/bridge.cjs --agent=hermes --no-viewer - npm pack --dry-run --json --ignore-scripts (confirmed dist/bridge.cjs, bridge.cts, dist/core/pipeline/index.js, viewer/dist/index.html)
Each `hermes chat` session spawns a new bridge.cts process. When the
chat session ends (stdin closes), the bridge transitions to a
"staying alive as daemon" state to keep the Memory Viewer accessible.
However, the next chat session spawns yet another bridge without
killing the previous one, causing unbounded process accumulation
(observed: 10+ zombie bridge pairs on long-running servers).
Root cause: bridge.cts has no mechanism to detect or clean up a
previously running instance before starting.
Fix: introduce a PID file (`~/<agent>/memos-plugin/daemon/bridge.pid`)
as a lightweight singleton lock:
- On startup (unless --no-viewer), read the PID file; if the
recorded process is still alive, send SIGTERM and wait up to 5s
before SIGKILL.
- Write own PID to the file after acquiring the slot.
- Remove the PID file on all exit paths (SIGTERM/SIGINT handler,
daemon shutdown, headless exit, keepalive viewer-closed check).
- --no-viewer (headless) bridges skip the kill — they don't need
the port and coexist with the daemon that owns it.
The existing install.sh kill logic is preserved as a deployment-time
fallback; the two mechanisms are complementary.
Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary - Bridge processes accumulate indefinitely: each `hermes chat` session spawns a new bridge.cts, and the previous one stays alive as a "daemon" but is never cleaned up. On long-running servers this results in 10+ zombie bridge pairs. - Introduces a PID file (`daemon/bridge.pid`) as a lightweight singleton lock. On startup, the new bridge reads the PID file, kills the stale process (SIGTERM → 5s → SIGKILL), writes its own PID, and removes it on all exit paths. - `--no-viewer` (headless) bridges skip the kill — they coexist with the daemon that owns the viewer port. - The existing `install.sh` kill logic is preserved as a complementary deployment-time fallback. ## Test plan - [ ] Start bridge daemon → verify `daemon/bridge.pid` is created with correct PID - [ ] Start a second bridge → verify the first is killed and PID file updated - [ ] SIGTERM the running bridge → verify PID file is removed - [ ] Run `hermes chat` twice in sequence → verify only 1 bridge pair remains (no accumulation) - [ ] Run `--no-viewer` bridge alongside daemon → verify both coexist (no kill)
## Summary - add a cross-process startup lock around the Hermes viewer daemon launch path - re-probe :18800 after acquiring the lock so concurrent no-viewer sessions reuse the daemon - keep --no-viewer stdio bridges out of the viewer daemon pid file ## Tests - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff format apps/memos-local-plugin/adapters/hermes/memos_provider/daemon_manager.py apps/memos-local-plugin/tests/python/test_bridge_client.py - /Users/jiang/MyProject/MemOS-jiang/.venv/bin/ruff check apps/memos-local-plugin/adapters/hermes/memos_provider/daemon_manager.py apps/memos-local-plugin/tests/python/test_bridge_client.py - python3 -m unittest tests.python.test_bridge_client - npm run lint - npx vitest run tests/unit/bridge/methods.test.ts tests/unit/bridge/stdio.test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
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
Checklist
Reviewer Checklist