5a581c78a2
Build / build (push) Has been cancelled
Docker / build (push) Has been cancelled
Lint / ruff (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.11) (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.12) (push) Has been cancelled
Test / pytest (windows-latest, 3.11) (push) Has been cancelled
Test / pytest (windows-latest, 3.12) (push) Has been cancelled
Introduce provider, model, and invocation contracts with encrypted configuration persistence. Add web runtime fencing, route fallback, recovery middleware, workspace scoping, and comprehensive tests.
38 lines
1.1 KiB
Python
38 lines
1.1 KiB
Python
"""Tests for bounded skill context in background memory-agent graphs."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
def test_memory_agent_factory_replaces_framework_skill_injection(monkeypatch, tmp_path):
|
|
from EvoScientist.memory.agents import _factory
|
|
from EvoScientist.middleware import BudgetedSkillsMiddleware
|
|
|
|
captured = {}
|
|
|
|
class _Agent:
|
|
def with_config(self, _config):
|
|
return self
|
|
|
|
def _create_deep_agent(**kwargs):
|
|
captured.update(kwargs)
|
|
return _Agent()
|
|
|
|
monkeypatch.setattr("deepagents.create_deep_agent", _create_deep_agent)
|
|
monkeypatch.setattr(
|
|
"EvoScientist.EvoScientist._ensure_auxiliary_chat_model", lambda: object()
|
|
)
|
|
|
|
_factory.build_memory_agent_graph(
|
|
name="test-memory-agent",
|
|
system_prompt="Test prompt",
|
|
memory_dir=tmp_path / "memory",
|
|
workspace_dir=tmp_path / "workspace",
|
|
tools=[],
|
|
middleware=[],
|
|
skills=["/skills/"],
|
|
backend=object(),
|
|
)
|
|
|
|
assert captured["skills"] is None
|
|
assert isinstance(captured["middleware"][-1], BudgetedSkillsMiddleware)
|