Skip to content

[Bug] hermes adapter broken on main: MemosHttpClient is imported but not defined anywhere #2096

Closed

Description

@fancyboi999

Summary

The hermes adapter cannot be imported on current main: memos_provider/__init__.py imports MemosHttpClient from bridge_client, but that class does not exist anywhere in the repository.

Repro

cd apps/memos-local-plugin
python -m unittest tests.python.test_hermes_provider_pipeline
File ".../adapters/hermes/memos_provider/__init__.py", line 68, in <module>
    from bridge_client import BridgeError, MemosBridgeClient, MemosHttpClient  # noqa: E402
ImportError: cannot import name 'MemosHttpClient' from 'bridge_client'

git grep "class MemosHttpClient" across the repo → zero hits.

Impact

  • Every plugin test under apps/memos-local-plugin/tests/python/ fails at collection (import error before any test runs).
  • Any real Hermes host loading memos_provider hits the same ImportError at module load — the adapter is entirely non-functional on main, not just in tests.
  • CI does not catch this because python-tests.yml runs pytest tests (repo root) only; the plugin's Python tests are not wired into CI.

Where it came from

__init__.py references MemosHttpClient at lines 68, 282, 334, 336 (type union with MemosBridgeClient, plus an http_bridge = MemosHttpClient() construction path). These usages arrived via the pr/may27-fixes merge (0398e0ed, followed by ruff fixup c739e9f2), but the class definition itself was never committed — it looks like the branch was merged with half of an HTTP-client feature.

Suggested fix

Either commit the missing MemosHttpClient implementation in bridge_client.py, or revert the usages in __init__.py until the HTTP client feature is complete. Also worth adding apps/memos-local-plugin/tests/python to CI so import-level breakage like this fails fast.

Found while rebasing #2095 (the plugin tests there pass once this class is stubbed).

Activity

  1. Memtensor-AI commented on Jul 10, 2026

    @Memtensor-AI
    Collaborator

    🤖 AutoDev has picked up this issue and started working on it.

    Task ID: bbe9a1b0b80a6c1f
    Working branch: bugfix/autodev-2096-20260710041928689
    Target branch: latest dev* branch
    Workflow: opsp (analysis → coding → testing → PR)

    I will post the PR link here once done. If I need more information, I will ask in the comments.

  2. self-assigned this
    on Jul 10, 2026
  3. Memtensor-AI commented on Jul 10, 2026

    @Memtensor-AI
    Collaborator

    ✅ AutoDev task bbe9a1b0b80a6c1f completed.

    Summary: Fixes #2096. The hermes adapter at apps/memos-local-plugin/adapters/hermes/memos_provider/__init__.py was importing MemosHttpClient from bridge_client, but the class was never committed — every plugin python test failed at collection with ImportError and any real Hermes host loading memos_provider hit the same failure at module load. The offending references arrived via the pr/may27-fixes merge (0398e0e) as a half-committed HTTP-bridge feature.

    Chose the "revert usages" option from the issue's two suggested fixes because writing a real MemosHttpClient (subprocess lifecycle, keep-alive, viewer probe, host-handler reverse channel) is a feature commit not a bug hotfix, and a stub raising NotImplementedError would spam warning logs on every reconnect since _connect_http_bridge catches all exceptions and falls back to stdio. Removed the MemosHttpClient import, the type union on self._bridge, the _connect_http_bridge helper, and the HTTP-first branches in initialize and _reconnect_bridge. Also removed the now-unused probe_viewer_status / startup_lock_active imports (their definitions in daemon_manager.py are untouched for a future HTTP PR). Net diff: 31 additions / 54 deletions across the adapter plus the new regression test.

    Added test_module_imports_cleanly to tests/python/test_hermes_provider_pipeline.py asserting MemTensorProvider / MemosBridgeClient / BridgeError are on the module surface and MemosHttpClient is not — this way a future half-merge fails with a targeted message instead of a cascade of unrelated collection errors.

    Verification: python3 -m unittest discover -s apps/memos-local-plugin/tests/python runs 78 tests, all OK (was: collection ImportError). ruff check + ruff format --check clean on both modified files. opsp artifacts (task.md, proposal.md, spec.md, design.md, verification-report.md) archived to memos-autodev-specs main. Reviewers @whipser030 and @hijzy to be added by scheduler.

    Base branch: main
    Branch: bugfix/autodev-2096-20260710041928689
    Commit: 289eb84
    PR: #2097
    Assigned to: @CarltonXiang
    Reviewers: @whipser030, @hijzy

  4. added
    status:readyReady for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发
    status:in-progressSomeone or AI is working on it | 人工或 AI 正在处理
    and removed
    status:readyReady for implementation; waiting for assignee or AI dispatch | 可进入实现,等待认领或派发
    on Jul 10, 2026
  5. shinetata commented on Jul 16, 2026

    @shinetata
    Collaborator

    Fixed via #2097 (squashed into dev-v2.0.24 as c0f6c2cc).

    The half-merged MemosHttpClient usages introduced by pr/may27-fixes (0398e0ed) have been reverted: the phantom import, the self._bridge type union, the _connect_http_bridge helper, and the HTTP-first branches in initialize / _reconnect_bridge are removed. probe_viewer_status / startup_lock_active definitions in daemon_manager.py are kept for a future complete HTTP-bridge PR. A test_module_imports_cleanly regression test now guards both memos_provider and bridge_client against the class silently re-entering.

    Verified by @fancyboi999: 78 plugin tests pass on the branch; CI on the PR is green across ubuntu/windows/macos × py3.10–3.13.

    Will follow dev-v2.0.24 into main with the release. Closing this issue.

    Two follow-ups tracked separately (not blocking):

  6. shinetata commented on Jul 16, 2026

    @shinetata
    Collaborator

    Closing as completed — fixed by #2097 (merged into dev-v2.0.24, will reach main with the release).

  7. added a commit that references this issue on Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:pluginOpenClaw & Hermesstatus:in-progressSomeone or AI is working on it | 人工或 AI 正在处理

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions