test(custom_agent + task_tool): set app.state.config + drop obsolete skills monkeypatches

This commit is contained in:
greatmengqi
2026-04-27 18:09:43 +08:00
parent e99cb01fe1
commit c53b9ccb02
2 changed files with 14 additions and 14 deletions
+10
View File
@@ -370,9 +370,19 @@ def _make_test_app(tmp_path: Path):
from fastapi import FastAPI
from app.gateway.routers.agents import router
from deerflow.config.agents_api_config import AgentsApiConfig
from deerflow.config.app_config import AppConfig
from deerflow.config.sandbox_config import SandboxConfig
app = FastAPI()
app.include_router(router)
# The agents router gates every route through ``Depends(get_config)`` and
# only allows access when ``agents_api.enabled`` is true. Wire a permissive
# AppConfig onto ``app.state.config`` so the routes are reachable in tests.
app.state.config = AppConfig(
sandbox=SandboxConfig(use="test"),
agents_api=AgentsApiConfig(enabled=True),
)
return app