feat(copilot): refactor JWT token handling and improve metadata tracking

- Move JWT token from state to configurable context for better security and request isolation
- Add user_id parameter to agent service for enhanced metadata tracking
- Update checkpoint directory name from .gns3-copilot to gns3-copilot
- Implement context-aware JWT token management using ContextVar
- Improve tool node to extract JWT token from config instead of state
This commit is contained in:
YueGuobin committed 2026-03-04 13:36:16 +08:00
1 parent 5e9aac7514
commit b05e6a71b4
5 files changed
+43 -7

No files matched your search

+1
View File
@@ -117,6 +117,7 @@ async def stream_chat(
message=request.message,
session_id=session_id,
project_id=str(project.id),
user_id=user_id,
jwt_token=jwt_token,
mode=request.mode,
llm_config=llm_config