mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-22 17:55:03 +00:00
Add LangChain Deep Agents as a 7th agent backend, providing access to the LangGraph ecosystem with built-in planning, subagent delegation, and multi-provider LLM support via init_chat_model. - New DeepAgentsBackend in agents/deep_agents.py with streaming support - LangChain StructuredTool bridge in tool_bridge.py - Registry entry, config fields, optional dep (pocketpaw[deep-agents]) - Dashboard settings UI (model + max turns) - 16 new tests, full suite green (3491 passed)
26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
"""Tests for Deep Agents tool bridge."""
|
|
|
|
from unittest.mock import patch
|
|
|
|
from pocketpaw.config import Settings
|
|
|
|
|
|
class TestDeepAgentsToolBridge:
|
|
def test_build_deep_agents_tools_graceful_degradation(self):
|
|
"""Returns empty list when langchain-core is unavailable."""
|
|
from pocketpaw.agents.tool_bridge import build_deep_agents_tools
|
|
|
|
with patch.dict("sys.modules", {"langchain_core": None, "langchain_core.tools": None}):
|
|
result = build_deep_agents_tools(Settings(), backend="deep_agents")
|
|
assert result == []
|
|
|
|
def test_tools_not_excluded_for_deep_agents(self):
|
|
"""Deep Agents backend should not have Claude SDK exclusions applied."""
|
|
# The _CLAUDE_SDK_EXCLUDED set should not apply to deep_agents
|
|
# This test verifies the backend name is treated as a non-Claude backend
|
|
from pocketpaw.agents.tool_bridge import _CLAUDE_SDK_EXCLUDED
|
|
|
|
assert "deep_agents" != "claude_agent_sdk"
|
|
# ShellTool etc. are only excluded for claude_agent_sdk
|
|
assert len(_CLAUDE_SDK_EXCLUDED) > 0 # Sanity check
|