Repository navigation
Fix #2028: fix: memory error - #2030
Closed
Memtensor-AI wants to merge 0 commit into
Closed
Memtensor-AI wants to merge 0 commit into
Memtensor-AI wants to merge 0 commit into
Conversation
Memtensor-AI
requested review from
CarltonXiang,
MatthewZhuang,
World-controller and
syzsunshine219
July 2, 2026 04:08
Memtensor-AI
force-pushed
the
bugfix/autodev-2028
branch
from
July 2, 2026 04:08
3359962 to
a4f1b5b
Compare
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
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.
How Has This Been Tested?
Automated tests are pending.
Checklist
@MatthewZhuang, @CarltonXiang, @syzsunshine219, @World-controller please review this PR.
Reviewer Checklist