Skip to content

feat: per-call project/project_id routing on bm_* tools#4

Merged
groksrc merged 1 commit into
mainfrom
feat/bm-project-routing
May 12, 2026
Merged

feat: per-call project/project_id routing on bm_* tools#4
groksrc merged 1 commit into
mainfrom
feat/bm-project-routing

Conversation

@groksrc
Copy link
Copy Markdown
Member

@groksrc groksrc commented May 12, 2026

Summary

Every `bm_*` tool now accepts optional `project` (name) and `project_id` (UUID) parameters. `_translate_args` layers the override on top of the configured default: `project_id > project > provider._project`. Only one of the two ever reaches BM, with `project_id` winning when both are passed — UUID is the unambiguous form across cloud workspaces (the disambiguator BM itself documents in `list_memory_projects`).

Routing properties live in a single shared `_PROJECT_ROUTING_PROPS` constant applied to every entry in `TOOL_SCHEMAS` via a post-construction loop, so the param shape stays DRY and a new tool can't be added without inheriting routing automatically. `system_prompt_block` mentions the cross-project capability so the agent reaches for these params when the user names a project that isn't the active one.

Addresses friction documented in "Hermes Basic Memory Cloud Task Experience": the original failure mode was the agent silently operating against the active Hermes memory project when the user asked for a write to a different cloud project (`main` on personal workspace). With this change the agent can route per-call without reconfiguring the plugin.

First of four planned changes from that note. Follow-ups (tracked as separate tasks): `bm_projects` / `bm_workspaces` as agent tools, a `bm_import` tool for file-on-disk → BM-note, and SKILL.md doc updates for the cross-project workflow.

Test plan

  • Unit suite passes (`uv run --with pytest pytest`) — 236 passed, 12 skipped (integration, gated).
  • 14 new tests in `test_helpers.py` cover: default-when-no-override, project-name override, project_id override, both-passed precedence, non-string coercion, every-tool parametrization (all 8 tools), and a schema-shape regression test asserting every `bm_*` tool advertises both routing props as optional.
  • Smoke-test on a live Hermes session with two BM projects: call `bm_search(query=..., project="")` and `bm_write(..., project_id="")`, confirm the writes land in the targeted project. (Manual — depends on the deploy.)

🤖 Generated with Claude Code

Every bm_* tool now accepts optional `project` (name) and `project_id`
(UUID) params. _translate_args layers the override on top of the
configured default: project_id > project > provider._project. Only one
of the two ever reaches BM, with project_id winning when both are
passed — UUID is unambiguous across cloud workspaces, which is the
disambiguator BM itself documents in list_memory_projects.

Routing properties are added to every entry in TOOL_SCHEMAS via a
shared _PROJECT_ROUTING_PROPS constant + post-construction loop, so
the param shape stays DRY and a new tool can't be added without
inheriting routing automatically.

system_prompt_block now mentions cross-project routing so the agent
knows to reach for these params when the user names a project that
isn't the configured one.

Addresses friction documented in "Hermes Basic Memory Cloud Task
Experience" — the original failure mode was the agent silently
operating against the active Hermes memory project when the user
asked for a write to a different cloud project. With this change the
agent can route per-call without reconfiguring the plugin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@groksrc groksrc merged commit 583b603 into main May 12, 2026
5 checks passed
groksrc added a commit that referenced this pull request May 12, 2026
After evaluating bm_import: no new capability over read_file + bm_write
(now that #4 added project_id routing). Adding it would burn a tool
slot for what's already a clean two-call composition. Documenting the
read → write pattern in SKILL.md is the better fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant