d5cddae187
With memory.memory_enabled and memory.user_profile_enabled both false, agent_init never builds a MemoryStore -- but check_memory_requirements() returned True unconditionally and MEMORY_GUIDANCE was gated only on the tool being present in valid_tool_names. So the tool shipped in every request's schema while answering "Memory is not available" on every call, and the system prompt still told the model to save durable facts there. Gate both on the config flags, using the store predicate for the tool and the already-resolved agent state for the guidance (config is not re-read mid-conversation, so the prompt stays byte-stable). Either flag alone still backs the tool, so only turning both off removes it. This lets a user running a third-party provider (Hindsight, Mem0, ...) turn the built-in files off without paying for the dead surface on every API call. The provider's own tools are unaffected: hiding the built-in tool moves the decision onto the toolset gate, and listing memory under agent.disabled_toolsets remains the only switch that takes those down.