Files
EvoScientist-Multi/tests/test_middleware_name_collision.py
Xi Zhang f81a8b086e feat(deps): upgrade deepagents to 0.7.0 with todos restore and delete gating- #395
- Introduced TodoListMiddleware to the middleware stack for better task management.
- Updated HITL interrupt configuration to include 'delete' operations requiring approval.
- Implemented error handling for delete operations in read-only and memory backends.
- Enhanced approval prompt formatting to display file paths for delete actions.
- Added tests to ensure delete operations are correctly blocked or prompted for approval.
- Updated dependencies to use deepagents 0.7.0 and langchain 1.5.3 for improved functionality.
2026-07-30 10:41:12 +01:00

27 lines
1014 B
Python

"""deepagents 0.7.0 merges caller middleware into its default stack by `.name`:
a name match silently REPLACES the built-in. None of EvoScientist's middleware
may collide unintentionally. TodoListMiddleware is deliberately absent from the
forbidden set: we pass it on purpose and replacing a profile-added instance
(e.g. the Codex harness profile's) with our identical one is desired dedup.
"""
DEEPAGENTS_BASE_STACK_NAMES = {
"SkillsMiddleware",
"FilesystemMiddleware",
"SubAgentMiddleware",
"SummarizationMiddleware",
"PatchToolCallsMiddleware",
"AsyncSubAgentMiddleware",
"AnthropicPromptCachingMiddleware",
}
def test_no_name_collision_with_deepagents_base_stack():
from EvoScientist.EvoScientist import _get_default_middleware
ours = {m.name for m in _get_default_middleware()}
assert not ours & DEEPAGENTS_BASE_STACK_NAMES
ours_async = {m.name for m in _get_default_middleware(for_async_subagent=True)}
assert not ours_async & DEEPAGENTS_BASE_STACK_NAMES