From 8957e93f3d92d3f6db473d20461bea17a0c569d5 Mon Sep 17 00:00:00 2001 From: Yunxiao Xu Date: Mon, 23 Feb 2026 04:34:28 -0800 Subject: [PATCH] feat(graph): Extend AgentState with checklist, current_step, and vfs --- backend/src/ea_chatbot/graph/state.py | 10 ++++++++++ backend/tests/test_state_extensions.py | 15 +++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 backend/tests/test_state_extensions.py diff --git a/backend/src/ea_chatbot/graph/state.py b/backend/src/ea_chatbot/graph/state.py index 0885782..b7bb191 100644 --- a/backend/src/ea_chatbot/graph/state.py +++ b/backend/src/ea_chatbot/graph/state.py @@ -34,3 +34,13 @@ class AgentState(AS): # Number of execution attempts iterations: int + + # --- DeepAgents Extensions --- + # High-level plan/checklist: List of Task objects (dicts) + checklist: List[Dict[str, Any]] + + # Current active step in the checklist + current_step: int + + # Virtual File System (VFS): Map of filenames to content/metadata + vfs: Dict[str, Any] diff --git a/backend/tests/test_state_extensions.py b/backend/tests/test_state_extensions.py new file mode 100644 index 0000000..07eee10 --- /dev/null +++ b/backend/tests/test_state_extensions.py @@ -0,0 +1,15 @@ +from typing import get_type_hints, List, Dict, Any +from ea_chatbot.graph.state import AgentState + +def test_agent_state_extensions(): + """Verify that AgentState has the new DeepAgents fields.""" + hints = get_type_hints(AgentState) + + assert "checklist" in hints + # checklist: List[Dict[str, Any]] (or similar for tasks) + + assert "current_step" in hints + assert hints["current_step"] == int + + assert "vfs" in hints + # vfs: Dict[str, Any]