feat(copilot): replace LangGraph config with request-scoped context variables

- Refactor `llm_call` and `generate_title` nodes to retrieve `llm_config` from request-scoped context variable instead of LangGraph config
- Remove `jwt_token` and `llm_config` from LangGraph configurable parameters in `AgentService.stream`
- Add `set_current_llm_config` and `get_current_llm_config` functions to `connector_factory` and export them in `__init__.py`
- Update `tool_node` to no longer extract `jwt_token` from config as it is now handled via context variable
- Improves thread safety and decouples configuration from LangGraph's state management
This commit is contained in:
YueGuobin committed 2026-03-04 13:49:17 +08:00
1 parent b05e6a71b4
commit eec4ebe3fd
4 files changed
+43 -20

No files matched your search

@@ -27,6 +27,8 @@ from .connector_factory import (
get_llm_config,
set_current_jwt_token,
get_current_jwt_token,
set_current_llm_config,
get_current_llm_config,
)
from .custom_gns3fy import (
CONSOLE_TYPES,
@@ -66,4 +68,6 @@ __all__ = [
"get_llm_config",
"set_current_jwt_token",
"get_current_jwt_token",
"set_current_llm_config",
"get_current_llm_config",
]