Small local LLM in a deepagents app: keep dispatch gated by interrupt_on and disable the general-purpose sub-agent
deepagents adds a default 'general-purpose' sub-agent that inherits every main-agent tool, including any dangerous one (e.g. a dispatch/send tool). Fix: register a HarnessProfile with GeneralPurposeSubagentProfile(enabled=False) for the model provider, and define only focused sub-agents with their own small toolsets. Put the dangerous tool only on the main agent and gate it with create_deep_agent(interrupt_on={tool: {allowed_decisions: [approve, edit, reject]}}) so the framework pauses for a human instead of relying on prompt wording. Also: small 8B local models (qwen3:8b via Ollama) miscount evidence and invent names; computing counts in code and returning them from a get_evidence tool took a judgment check from 0/2 to 4/4. MemoryMiddleware loads memory once per thread into checkpointed state, so subclass it to drop memory_contents if memory files change between wakes.