Skip to content

Fix #2028: fix: memory error - #2030

Closed
Memtensor-AI wants to merge 0 commit into
MemTensor:dev-20260624-v2.0.22from
Memtensor-AI:bugfix/autodev-2028
Closed

Memtensor-AI wants to merge 0 commit into
MemTensor:dev-20260624-v2.0.22from
Memtensor-AI:bugfix/autodev-2028

Conversation

@Memtensor-AI

Copy link
Copy Markdown
Collaborator

Description

Fixes Hermes plugin memory_search / turn.end 30 s timeout regression reported in issue #2028. The Python-side JSON-RPC bridge client silently allowed callers to park for the full per-request timeout whenever the Node bridge subprocess died or hung, and the keepalive path only recovered from transport_closed — a BridgeError("timeout") was logged at DEBUG and dropped, so the dead bridge was reused forever.

Three cooperating fixes were applied to apps/memos-local-plugin/adapters/hermes/memos_provider/: (1) MemosBridgeClient._read_loop now uses try/finally + a new _abort_pending helper so reader-thread exit immediately wakes every parked waiter with transport_closed; (2) MemosBridgeClient.request checks Popen.poll() before writing to stdin, so a dead subprocess fast-fails; (3) MemTensorProvider.handle_tool_call now routes memos_search / memos_get / memos_timeline / memos_skill_list / memos_environment / memos_skill_get through a new _bridge_request_with_retry helper that reconnects and retries once on transport_closed. Keepalive reconnects on timeout / dead subprocess in addition to transport_closed via _should_reconnect_after_keepalive_failure. Write-path (sync_turn) retry semantics are unchanged.

Tests: added 7 BridgeRecoveryTests covering all four layers (reader-exit wake-up, dead-subprocess fast-fail, keepalive-timeout reconnect, keepalive-dead-subprocess reconnect, keepalive-generic-error no reconnect, tool retry success, tool retry failure surfaced). Full runs: python3 -m unittest tests.python.test_bridge_client → 33 tests OK (26 → 33); tests.python.test_hermes_provider_pipeline → 16 tests OK; ruff check + ruff format --check clean.

Note: issue #2028 is a re-report of the closed #1722 regression because the fix landed on bugfix/autodev-1722 against the same base branch (dev-20260624-v2.0.22) and was not merged forward. The same design applies verbatim.

Related Issue (Required): Fixes #2028

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?

Automated tests are pending.

  • 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)
  • I have linked the issue to this PR (if applicable)
  • I have mentioned the person who will review this PR

@MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller please review this PR.

Reviewer Checklist

@Memtensor-AI Memtensor-AI added ai:generated Generated or modified by AI | 由 AI 生成或修改 types:bug Something isn't working | 功能异常 labels Jul 2, 2026
@Memtensor-AI Memtensor-AI mentioned this pull request Jul 2, 2026
5 tasks done
@Memtensor-AI
Memtensor-AI force-pushed the bugfix/autodev-2028 branch from 3359962 to a4f1b5b Compare July 2, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:generated Generated or modified by AI | 由 AI 生成或修改 types:bug Something isn't working | 功能异常

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants