fix(memory): hide built-in memory tool when both memory stores are disabled - #86540
rumotoshino wants to merge 1 commit into
Conversation
…sabled When a profile disables both built-in memory stores (memory.memory_enabled: false and memory.user_profile_enabled: false) — the Honcho-primary setup — agent_init never constructs a MemoryStore, yet the built-in `memory` tool schema is still advertised. Every call to it then fails with "Memory is not available", wasting a tool round-trip and confusing the model. Gate the tool on the active profile's config: - check_memory_requirements() returns False only when BOTH built-in stores are disabled; external provider tools (honcho_*) are injected separately and are unaffected. Fails open: DEFAULT_CONFIG enables both stores, and any config-read error keeps the tool available, so normal installs are untouched. - get_tool_definitions() discards "memory" from the resolved toolset under the same condition. - load_config is imported lazily at call time so tests can monkeypatch it. Test plan: pytest tests/tools/test_memory_tool.py -q # 43 passed pytest tests/test_model_tools.py -q # included, all pass ruff check tools/memory_tool.py model_tools.py tests/tools/test_memory_tool.py # clean
fix(memory): hide built-in memory tool when both memory stores are disabled
|
|
Fixed on main via #90559 (salvage of #90413) — the same both-stores-off gate via |
Problem
When a profile disables both built-in memory stores (
memory.memory_enabled: falseandmemory.user_profile_enabled: false) — the Honcho-primary setup —agent_initnever constructs aMemoryStore, yet the built-inmemorytool schema is still advertised to the model. Every call to it then fails withMemory is not available, wasting a tool round-trip and confusing the model into retrying.Fix
Gate the built-in memory tool on the active profile's config:
check_memory_requirements()returnsFalseonly when both built-in stores are disabled; external provider tools (e.g.honcho_*) are injected separately and are unaffected.get_tool_definitions()discardsmemoryfrom the resolved toolset under the same condition.DEFAULT_CONFIGenables both stores, and any config-read error keeps the tool available, so normal installs are untouched.load_configis imported lazily at call time so tests can monkeypatch it.Test plan
Verified against current
main(50d98fc1f).