mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-04-25 11:18:22 +00:00
Phase 2 Task P2-2 (Category G): replace AppConfig.current() with the typed Depends(get_config) FastAPI dependency in every gateway router. - routers/models.py: list_models / get_model take config via Depends - routers/mcp.py: get_mcp_configuration / update_mcp_configuration via Depends; reload path now swaps app.state.config alongside AppConfig.init() so both the new primitive and legacy current() callers see the fresh config - routers/memory.py: get_memory_config_endpoint / get_memory_status via Depends - routers/skills.py: update_skill via Depends; reload swaps app.state.config - deps.py: get_run_context and langgraph_runtime read from app.state.config instead of calling AppConfig.current() - auth/reset_admin.py: CLI constructs AppConfig.from_file() explicitly at the top (it is a standalone entry point, not a request handler) - channels/service.py: from_app_config accepts optional AppConfig parameter; legacy fallback to AppConfig.current() preserved until P2-10 Test fix: test_update_skill_refreshes_prompt_cache_before_return now sets app.state.config on the test FastAPI instance so Depends(get_config) resolves. All 2379+ tests pass (one pre-existing flaky test_client_e2e unrelated).