Repository navigation
Description
Summary
Memory tools are implemented and registered on the main/shared engine, but they appear to be missing from per-session engine catalogs. In this session the prompt included the tier-0 <memory-index> and <user-model> blocks instructing the agent to use Recall/SearchMemory/SearchUserModel, but the actual toolset exposed to the model did not include any memory tools.
Missing from the exposed toolset:
RememberRecallSearchMemoryRememberUserRecallUserSearchUserModel
Current wiring found in repo
Project memory tools exist and register correctly:
internal/adapter/memory/tools.godefinesRemember,Recall, andSearchMemory(RememberToolName,RecallToolName,SearchMemoryToolName).internal/adapter/memory/tools.gohasRegister(cat, store)for the project-memory family.
User-model tools exist and register correctly:
internal/adapter/memory/usermodeltools.godefinesRememberUser,RecallUser, andSearchUserModel.internal/adapter/memory/usermodeltools.gohasRegisterUserModel(cat, store).
The main catalog wires them:
internal/app/build.goregisters project memory only whencfg.MemoryDir != "".internal/app/build.gobuilds a default-on user-model store (unlessNoUserModel) and callsmemory.RegisterUserModel.cmd/mecatui/main.gocomputes a default per-project memory dir unless--no-memory, so embeddedmecatuishould enable project memory by default.- standalone
mecatedstill requires explicit--memory-dirfor project memory.
Suspected bug
sessionEngineFactory builds a fresh catalog for per-session engines but does not re-register memory/user-model tools.
The per-session path currently creates a new catalog, calls registerCoreTools, then mounts global/client MCP, Subagent/Team, etc. I did not find memory.Register or memory.RegisterUserModel in this path.
This path is used when a session needs a per-session engine, e.g.:
- non-default provider/model selection
- client-provided MCP servers / ACP session MCP
That means a session can still receive the prompt memory blocks (MemoryIndexAssembler / UserModelAssembler) but not receive the corresponding Recall/Search/Remember tools, creating an inconsistent contract.
Likely history suspects
4baf34a feat(acp): accept client-provided streaming-HTTP MCP servers on session/new (#7)introducedsessionEngineFactorywith a fresh per-session catalog.fa0346a feat(provider): gRPC model selector + ListModels + per-session routing (multi-provider P0, S3)expanded per-session engines to model-selection sessions.500e524 feat(memory): enable Remember/Recall by default on embedded mecatuienabled default project memory for embedded/shared catalog, but not the per-session catalog path.48b7af5 feat(soul): user-model learning loop — agent-curated, cross-sessionadded the user-model tools, also on the main catalog path only.
Expected behavior
If project memory/user-model is wired for the server and their turn-0 blocks are injected into the prompt, the same session catalog should expose the matching tools:
- project memory:
Remember,Recall,SearchMemory - user model:
RememberUser,RecallUser,SearchUserModel
This should hold for both the shared engine and per-session engines.
Suggested fix direction
Thread the already-open memory stores into sessionEngineFactory (project memStore and user userModelStore) and register the same memory families into the per-session catalog when non-nil.
Also add regression coverage for a per-session engine (provider selector or client MCP) asserting that enabled memory/user-model tools are present in the resulting catalog/toolset, and that the prompt/tool contract stays consistent.
Activity
feat(engine,agents,grpcdriver,app): agent-def + command source ports
feat(prompt): RulesSource port + .claude/rules discovery (#329) (#334)