feat(hermes): support an existing Basic Memory HTTP daemon - #1397
feat(hermes): support an existing Basic Memory HTTP daemon#1397scarabone wants to merge 2 commits into
Conversation
Signed-off-by: Brett Grane <24548810+scarabone@users.noreply.github.com>
Signed-off-by: Brett Grane <24548810+scarabone@users.noreply.github.com>
66f1c9c to
187cf61
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66f1c9cc05
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| "basic-memory: auto-install via uv failed. Run " | ||
| "`uv tool install basic-memory --prerelease=allow` manually to debug. " | ||
| "Provider will not initialize." | ||
| if not self._server_url: |
There was a problem hiding this comment.
Stop the previous HTTP actor before local setup
When a provider is already initialized with server_url, and configuration is changed to local/cloud mode while bm and uv are unavailable—or the requested local project fails validation—this block returns before the transport-mismatch cleanup below. The provider therefore remains _initialized with the old HTTP actor but the newly loaded mode and project, so subsequent reads and writes silently continue against the old remote daemon and may target the wrong backend. Detach or invalidate the existing actor before performing the new mode's preflight checks.
AGENTS.md reference: AGENTS.md:L132-L133
Useful? React with 👍 / 👎.
| if tool_name not in _HTTP_RETRYABLE_TOOLS: | ||
| raise original_failure |
There was a problem hiding this comment.
Reconcile ambiguous transcript creation before the next turn
If HTTP disconnects after the server commits the first automatic write_note, this branch raises without setting _session_note_id; the next captured turn therefore issues another write_note with the same deterministic title. With default conflict handling, the returned NOTE_ALREADY_EXISTS JSON is treated as success and the second turn is never appended; on a daemon configured to overwrite, the second write instead replaces the first turn's canonical content. Preserve an explicit ambiguous-create state and reconcile the existing transcript before accepting the next capture.
AGENTS.md reference: AGENTS.md:L156-L160
Useful? React with 👍 / 👎.
Summary
server_urlmode to the Hermes provider using the MCP SDK's streamable HTTP transportserver_urlis absentWhy
Hermes users may already have one long-running Basic Memory daemon serving a shared vault. The current local provider mode always starts its own
bm mcpchild, so it cannot safely attach to that daemon and use provider-managed recall/capture without introducing a second process.With this change, a provider can use:
{ "server_url": "http://127.0.0.1:8766/mcp", "project": "main" }URL mode does not look up/install
bm, create or register projects, mutate Basic Memory configuration, or spawn a subprocess.Reliability and safety
Verification
295 passed, 17 skipped3 passed, 2 explicitly gated fixtures skipped