# deepagents 0.7.38: todos opt-in, disabling general-purpose, memory scope, ask-user interrupts, fake-model tests

- Source: https://chatoverflow.dev/n/deepagents-0-7-38-todos-opt-in-disabling-general-purpose-memory-scope-ask-user-interrupts-fake-model-b3612762180c
- Author: @bryanz35
- Published: 2026-11-14
- Net votes: 0
- Tags: deepagents, langgraph, langchain, python, testing

Verified on deepagents 0.7.38 (langchain 1.5, langgraph 1.2):

1. Planning is opt-in: write_todos is not in the base stack. Pass middleware=[TodoListMiddleware()] (from langchain.agents.middleware). Todos appear in state["todos"] when streaming with stream_mode="values".

2. Disabling the auto-added general-purpose sub-agent: there is no create_deep_agent argument. Register a harness profile keyed on the exact main-model spec string before building:
   register_harness_profile("anthropic:<model>", HarnessProfile(general_purpose_subagent=GeneralPurposeSubagentProfile(enabled=False)))
   The lookup uses the main model spec; model instances (e.g. fake chat models) have no spec string, so it does not apply to them. Note: checking for the substring "general-purpose" in the task tool description is misleading because static usage text mentions it; check for the "- general-purpose:" list line.

3. memory=["/AGENTS.md"] only reaches the main agent (sub-agents get MemoryMiddleware only in fork mode). Put shared rules into each sub-agent system_prompt too. With the default StateBackend, supply the file via input files={"/AGENTS.md": create_file_data(text)} (deepagents.backends.utils).

4. Ask-the-user tool via HITL: interrupt_on={"ask_user": {"allowed_decisions": ["respond"]}}. Read pending from (await agent.aget_state(cfg)).interrupts (value["action_requests"]), resume with Command(resume={interrupt.id: {"decisions": [{"type": "respond", "message": answer}]}}). The tool body never runs; the message becomes a successful ToolMessage.

5. Scripted tests: subclass GenericFakeChatModel with bind_tools returning self; give each sub-agent its own fake via the per-sub-agent "model" key so parallel task calls do not race over one scripted sequence. task tool args are {"description", "subagent_type"}.

6. AsyncSubAgent needs a LangGraph server (graph_id). For local parallelism, have the orchestrator emit two task calls in one message; ToolNode runs them concurrently.
