2025-12-04 11:02:51,315 - root - INFO - Logging configured successfully 2025-12-04 11:02:51,440 - root - INFO - Logging configured successfully 2025-12-04 11:02:51,630 - root - INFO - Starting up TH-Agenter application... 2025-12-04 11:02:51,660 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 11:02:51,799 - root - INFO - Database tables created 2025-12-04 11:02:51,799 - root - INFO - Database initialized 2025-12-04 13:10:14,338 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:14,340 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:14,341 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:14,342 - root - INFO - Clearing user context 2025-12-04 13:10:14,805 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:14,805 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:14,805 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:14,806 - root - INFO - Clearing user context 2025-12-04 13:10:15,152 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:15,152 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:15,152 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:15,153 - root - INFO - Clearing user context 2025-12-04 13:10:16,868 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:16,868 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:16,869 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:16,869 - root - INFO - Clearing user context 2025-12-04 13:10:17,206 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:17,207 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:17,207 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:17,207 - root - INFO - Clearing user context 2025-12-04 13:10:17,343 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:17,343 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:17,344 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:17,344 - root - INFO - Clearing user context 2025-12-04 13:10:17,501 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:17,502 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:17,502 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:17,502 - root - INFO - Clearing user context 2025-12-04 13:10:18,639 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:18,639 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:18,640 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:18,640 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:18,653 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:19,955 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:19,956 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:19,956 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:19,956 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:19,961 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:20,489 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:20,490 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:20,490 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:20,490 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:20,493 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:20,696 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:20,696 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:20,696 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:20,696 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:20,699 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:20,871 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:20,872 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:20,872 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:20,872 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:20,875 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:21,071 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:21,071 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:21,072 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:21,072 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:21,075 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:21,263 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:21,263 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:21,263 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:21,264 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:21,267 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:24,880 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:24,880 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:24,880 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:24,881 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:24,884 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:28,598 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:28,599 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,599 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:28,599 - root - INFO - Clearing user context 2025-12-04 13:10:28,625 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:28,626 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,626 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:28,627 - root - INFO - Clearing user context 2025-12-04 13:10:28,833 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:28,834 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,834 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:28,834 - root - INFO - Clearing user context 2025-12-04 13:10:28,840 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:10:28,841 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,841 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:10:28,841 - root - INFO - Clearing user context 2025-12-04 13:10:28,844 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:10:28,845 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,845 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:10:28,845 - root - INFO - Clearing user context 2025-12-04 13:10:28,852 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:10:28,853 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,853 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:10:28,853 - root - INFO - Clearing user context 2025-12-04 13:10:28,857 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:10:28,858 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,858 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:10:28,859 - root - INFO - Clearing user context 2025-12-04 13:10:28,862 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:10:28,863 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,863 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:10:28,864 - root - INFO - Clearing user context 2025-12-04 13:10:28,870 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:10:28,870 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:28,870 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:10:28,871 - root - INFO - Clearing user context 2025-12-04 13:10:31,010 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:31,010 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:31,011 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:31,011 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:31,013 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:10:58,228 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:10:58,228 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:10:58,229 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:10:58,229 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:10:58,232 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:11:12,492 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:11:12,493 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:11:12,493 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:11:12,493 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:11:12,496 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:11:13,239 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:11:13,239 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:11:13,240 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:11:13,240 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:11:13,243 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:11:13,449 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:11:13,450 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:11:13,450 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:11:13,450 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:11:13,454 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:11:13,657 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:11:13,657 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:11:13,657 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:11:13,658 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:11:13,661 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-04 13:13:12,453 - root - INFO - Shutting down TH-Agenter application... 2025-12-04 13:13:19,714 - root - INFO - Logging configured successfully 2025-12-04 13:13:19,817 - root - INFO - Logging configured successfully 2025-12-04 13:13:20,007 - root - INFO - Starting up TH-Agenter application... 2025-12-04 13:13:20,037 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 13:13:20,043 - root - INFO - Database tables created 2025-12-04 13:13:20,043 - root - INFO - Database initialized 2025-12-04 13:14:21,552 - root - INFO - Shutting down TH-Agenter application... 2025-12-04 13:14:42,425 - root - INFO - Logging configured successfully 2025-12-04 13:14:42,531 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 13:14:42,535 - root - INFO - Database tables created 2025-12-04 13:14:42,790 - th_agenter.th_agenter.services.user - INFO - User created successfully: test 2025-12-04 13:15:01,086 - root - INFO - Logging configured successfully 2025-12-04 13:15:01,183 - root - INFO - Logging configured successfully 2025-12-04 13:15:01,329 - root - INFO - Starting up TH-Agenter application... 2025-12-04 13:15:01,347 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 13:15:01,352 - root - INFO - Database tables created 2025-12-04 13:15:01,352 - root - INFO - Database initialized 2025-12-04 13:19:26,858 - root - INFO - Shutting down TH-Agenter application... 2025-12-04 13:20:43,291 - root - INFO - Logging configured successfully 2025-12-04 13:20:43,383 - root - INFO - Logging configured successfully 2025-12-04 13:20:43,531 - root - INFO - Starting up TH-Agenter application... 2025-12-04 13:20:43,548 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 13:20:43,552 - root - INFO - Database tables created 2025-12-04 13:20:43,552 - root - INFO - Database initialized 2025-12-04 13:20:54,188 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:20:54,188 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:54,189 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:20:54,189 - root - INFO - Clearing user context 2025-12-04 13:20:54,243 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:54,243 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:54,243 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:54,244 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:54,247 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:54,247 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764828763} 2025-12-04 13:20:54,248 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:54,250 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:54,250 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:54,250 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:54,258 - root - INFO - Clearing user context 2025-12-04 13:20:54,269 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-04 13:20:54,270 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:54,270 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-04 13:20:54,270 - root - INFO - Clearing user context 2025-12-04 13:20:54,273 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:54,273 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:54,273 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:54,274 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:54,275 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:54,276 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764828763} 2025-12-04 13:20:54,276 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:54,277 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:54,278 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:54,278 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:54,283 - root - INFO - Clearing user context 2025-12-04 13:20:55,495 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-04 13:20:55,496 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,496 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-04 13:20:55,496 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-04 13:20:55,734 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:20:55,735 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,735 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:20:55,735 - root - INFO - Clearing user context 2025-12-04 13:20:55,737 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,737 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,738 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,738 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,740 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:55,740 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:20:55,740 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:55,742 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:55,742 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,742 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:55,744 - root - INFO - Clearing user context 2025-12-04 13:20:55,751 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-04 13:20:55,752 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,752 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-04 13:20:55,752 - root - INFO - Clearing user context 2025-12-04 13:20:55,754 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,755 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,755 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,755 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,757 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:55,757 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:20:55,757 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:55,759 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:55,759 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,760 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:55,762 - root - INFO - Clearing user context 2025-12-04 13:20:55,904 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:20:55,905 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,905 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:20:55,905 - root - INFO - Clearing user context 2025-12-04 13:20:55,908 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,908 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,908 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,909 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,910 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:20:55,911 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,911 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:20:55,911 - root - INFO - Clearing user context 2025-12-04 13:20:55,913 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,914 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,914 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,914 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,930 - root - INFO - Clearing user context 2025-12-04 13:20:55,932 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:55,932 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:20:55,933 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:55,935 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:55,935 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,935 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:55,960 - root - INFO - Clearing user context 2025-12-04 13:20:55,962 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:20:55,962 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,963 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:20:55,963 - root - INFO - Clearing user context 2025-12-04 13:20:55,966 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,967 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,967 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,967 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,969 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:20:55,970 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,970 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:20:55,970 - root - INFO - Clearing user context 2025-12-04 13:20:55,972 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,973 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,973 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,973 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,980 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:20:55,981 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,981 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:20:55,981 - root - INFO - Clearing user context 2025-12-04 13:20:55,983 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:55,983 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,983 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:55,984 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:55,986 - root - INFO - Clearing user context 2025-12-04 13:20:55,988 - root - INFO - Clearing user context 2025-12-04 13:20:55,992 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:20:55,993 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:20:55,994 - root - INFO - Looking for user with username: admin 2025-12-04 13:20:55,996 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:20:55,996 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:55,997 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:20:55,997 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:20:55,997 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:55,998 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:20:55,998 - root - INFO - Clearing user context 2025-12-04 13:20:56,000 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:56,000 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:56,000 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:56,000 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:56,008 - root - INFO - Clearing user context 2025-12-04 13:20:56,009 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:20:56,010 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:56,010 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:20:56,010 - root - INFO - Clearing user context 2025-12-04 13:20:56,012 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:56,012 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:56,013 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:56,013 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:56,018 - root - INFO - Clearing user context 2025-12-04 13:20:56,024 - root - INFO - Clearing user context 2025-12-04 13:20:56,034 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:20:56,034 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:20:56,034 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:20:56,035 - root - INFO - Clearing user context 2025-12-04 13:20:56,036 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:20:56,036 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:20:56,037 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:20:56,037 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:20:56,039 - root - INFO - Clearing user context 2025-12-04 13:21:04,714 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/45 2025-12-04 13:21:04,715 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/45 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:04,716 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/45 2025-12-04 13:21:04,716 - root - INFO - Clearing user context 2025-12-04 13:21:04,722 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:04,722 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:04,722 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:04,722 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:04,729 - root - INFO - Clearing user context 2025-12-04 13:21:04,744 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/45/messages 2025-12-04 13:21:04,744 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/45/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:04,745 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/45/messages 2025-12-04 13:21:04,745 - root - INFO - Clearing user context 2025-12-04 13:21:04,747 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:04,747 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:04,747 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:04,747 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:04,756 - root - INFO - Clearing user context 2025-12-04 13:21:05,324 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/44 2025-12-04 13:21:05,325 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/44 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:05,325 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/44 2025-12-04 13:21:05,325 - root - INFO - Clearing user context 2025-12-04 13:21:05,326 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:05,327 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:05,327 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:05,327 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:05,330 - root - INFO - Clearing user context 2025-12-04 13:21:05,345 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/44/messages 2025-12-04 13:21:05,346 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/44/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:05,346 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/44/messages 2025-12-04 13:21:05,346 - root - INFO - Clearing user context 2025-12-04 13:21:05,348 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:05,348 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:05,349 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:05,349 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:05,352 - root - INFO - Clearing user context 2025-12-04 13:21:05,734 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/43 2025-12-04 13:21:05,734 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/43 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:05,735 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/43 2025-12-04 13:21:05,735 - root - INFO - Clearing user context 2025-12-04 13:21:05,737 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:05,737 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:05,737 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:05,737 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:05,740 - root - INFO - Clearing user context 2025-12-04 13:21:05,753 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/43/messages 2025-12-04 13:21:05,754 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/43/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:05,754 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/43/messages 2025-12-04 13:21:05,754 - root - INFO - Clearing user context 2025-12-04 13:21:05,755 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:05,756 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:05,756 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:05,756 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:05,758 - root - INFO - Clearing user context 2025-12-04 13:21:06,085 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/42 2025-12-04 13:21:06,085 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/42 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:06,086 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/42 2025-12-04 13:21:06,086 - root - INFO - Clearing user context 2025-12-04 13:21:06,088 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:06,089 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:06,089 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:06,089 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:06,092 - root - INFO - Clearing user context 2025-12-04 13:21:06,105 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/42/messages 2025-12-04 13:21:06,106 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/42/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:06,106 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/42/messages 2025-12-04 13:21:06,106 - root - INFO - Clearing user context 2025-12-04 13:21:06,108 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:06,108 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:06,108 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:06,108 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:06,111 - root - INFO - Clearing user context 2025-12-04 13:21:06,388 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/40 2025-12-04 13:21:06,389 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/40 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:06,389 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/40 2025-12-04 13:21:06,389 - root - INFO - Clearing user context 2025-12-04 13:21:06,390 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:06,391 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:06,391 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:06,391 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:06,394 - root - INFO - Clearing user context 2025-12-04 13:21:06,406 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/40/messages 2025-12-04 13:21:06,406 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/40/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:06,407 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/40/messages 2025-12-04 13:21:06,407 - root - INFO - Clearing user context 2025-12-04 13:21:06,408 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:06,409 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:06,409 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:06,409 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:06,412 - root - INFO - Clearing user context 2025-12-04 13:21:27,175 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:21:27,175 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,176 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:21:27,176 - root - INFO - Clearing user context 2025-12-04 13:21:27,178 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,178 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,179 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,179 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,181 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:27,182 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:27,182 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:27,184 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:27,184 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,185 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:27,188 - root - INFO - Clearing user context 2025-12-04 13:21:27,208 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-04 13:21:27,209 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,209 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-04 13:21:27,209 - root - INFO - Clearing user context 2025-12-04 13:21:27,211 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,212 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,212 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,213 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,215 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:27,215 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:27,216 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:27,218 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:27,218 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,218 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:27,224 - root - INFO - Clearing user context 2025-12-04 13:21:27,785 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:21:27,786 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,786 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:21:27,786 - root - INFO - Clearing user context 2025-12-04 13:21:27,788 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,788 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,789 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,789 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,790 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:21:27,790 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,791 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:21:27,791 - root - INFO - Clearing user context 2025-12-04 13:21:27,794 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,794 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,795 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,795 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,800 - root - INFO - Clearing user context 2025-12-04 13:21:27,801 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:27,801 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:27,802 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:27,803 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:27,804 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,804 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:27,812 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:21:27,812 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,812 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:21:27,813 - root - INFO - Clearing user context 2025-12-04 13:21:27,816 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,817 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,817 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,817 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,819 - root - INFO - Clearing user context 2025-12-04 13:21:27,821 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:21:27,821 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,821 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:21:27,821 - root - INFO - Clearing user context 2025-12-04 13:21:27,824 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,824 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,825 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,825 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,834 - root - INFO - Clearing user context 2025-12-04 13:21:27,838 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 13:21:27,838 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,838 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 13:21:27,839 - root - INFO - Clearing user context 2025-12-04 13:21:27,841 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,842 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,842 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,842 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,847 - root - INFO - Clearing user context 2025-12-04 13:21:27,849 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:21:27,850 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,850 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:21:27,850 - root - INFO - Clearing user context 2025-12-04 13:21:27,852 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,853 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,853 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,853 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,856 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:27,857 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:27,857 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:27,858 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:21:27,859 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:27,859 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,859 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,859 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:21:27,860 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:27,860 - root - INFO - Clearing user context 2025-12-04 13:21:27,862 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,862 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,862 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,863 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,869 - root - INFO - Clearing user context 2025-12-04 13:21:27,871 - root - INFO - Clearing user context 2025-12-04 13:21:27,877 - root - INFO - Clearing user context 2025-12-04 13:21:27,883 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:21:27,884 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:27,884 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:21:27,884 - root - INFO - Clearing user context 2025-12-04 13:21:27,886 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:27,886 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:27,887 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:27,887 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:27,890 - root - INFO - Clearing user context 2025-12-04 13:21:29,610 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 13:21:29,611 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:29,611 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 13:21:29,611 - root - INFO - Clearing user context 2025-12-04 13:21:29,613 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:29,614 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:29,614 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:29,614 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:29,617 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:29,617 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:29,618 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:29,619 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:29,620 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:29,620 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:29,636 - root - INFO - Clearing user context 2025-12-04 13:21:32,906 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 13:21:32,907 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:32,907 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 13:21:32,907 - root - INFO - Clearing user context 2025-12-04 13:21:32,909 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:32,909 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:32,909 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:32,910 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:32,912 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:32,912 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:32,913 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:32,916 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:32,916 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:32,916 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:32,919 - root - INFO - Clearing user context 2025-12-04 13:21:32,938 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-04 13:21:32,938 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:32,938 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-04 13:21:32,939 - root - INFO - Clearing user context 2025-12-04 13:21:32,940 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:32,941 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:32,941 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:32,941 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:32,943 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:32,944 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:32,944 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:32,946 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:32,946 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:32,946 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:32,950 - root - INFO - Clearing user context 2025-12-04 13:21:33,277 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 13:21:33,278 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:33,278 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 13:21:33,278 - root - INFO - Clearing user context 2025-12-04 13:21:33,280 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:33,280 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:33,281 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:33,281 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:33,283 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 13:21:33,283 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:33,284 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 13:21:33,284 - root - INFO - Clearing user context 2025-12-04 13:21:33,285 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:33,286 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:33,286 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:33,286 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:33,292 - root - INFO - Clearing user context 2025-12-04 13:21:33,293 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:33,294 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:33,295 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:33,297 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:33,297 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:33,297 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:33,305 - root - INFO - Clearing user context 2025-12-04 13:21:33,307 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 13:21:33,307 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:33,308 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 13:21:33,308 - root - INFO - Clearing user context 2025-12-04 13:21:33,311 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:33,312 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:33,312 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:33,312 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:33,315 - root - INFO - Clearing user context 2025-12-04 13:21:34,847 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 13:21:34,847 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:34,847 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 13:21:34,848 - root - INFO - Clearing user context 2025-12-04 13:21:34,849 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:34,850 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,850 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:34,850 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:34,852 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:34,852 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:34,852 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:34,853 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:34,854 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,854 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:34,861 - root - INFO - Clearing user context 2025-12-04 13:21:34,871 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 13:21:34,871 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:34,872 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 13:21:34,872 - root - INFO - Clearing user context 2025-12-04 13:21:34,873 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:34,874 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,874 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:34,874 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:34,875 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:34,876 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:34,876 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:34,878 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:34,879 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,879 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:34,887 - root - INFO - Clearing user context 2025-12-04 13:21:34,898 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 13:21:34,898 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:34,899 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:34,899 - root - INFO - Clearing user context 2025-12-04 13:21:34,900 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:34,901 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,901 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:34,901 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:34,903 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:34,903 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:34,904 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:34,905 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:34,905 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:34,905 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:34,910 - root - INFO - Clearing user context 2025-12-04 13:21:37,977 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:21:37,977 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:37,977 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:37,978 - root - INFO - Clearing user context 2025-12-04 13:21:37,979 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:37,980 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:37,980 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:37,980 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:37,983 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:37,983 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:37,984 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:37,985 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:37,985 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:37,985 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:38,009 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:21:38,010 - root - INFO - Clearing user context 2025-12-04 13:21:43,133 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:21:43,133 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:43,133 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:43,134 - root - INFO - Clearing user context 2025-12-04 13:21:43,135 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:43,136 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:43,136 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:43,136 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:43,138 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:43,139 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:43,139 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:43,140 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:43,141 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:43,141 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:43,152 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:21:43,153 - root - INFO - Clearing user context 2025-12-04 13:21:45,966 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 13:21:45,967 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:45,967 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 13:21:45,967 - root - INFO - Clearing user context 2025-12-04 13:21:45,969 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:45,969 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:45,969 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:45,969 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:45,971 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:45,972 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:45,972 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:45,973 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:45,974 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:45,974 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:45,981 - root - INFO - Clearing user context 2025-12-04 13:21:46,974 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 13:21:46,974 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:46,974 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 13:21:46,975 - root - INFO - Clearing user context 2025-12-04 13:21:46,976 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:46,976 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:46,977 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:46,977 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:46,978 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:46,979 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:46,979 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:46,980 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:46,981 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:46,981 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:46,988 - root - INFO - Clearing user context 2025-12-04 13:21:46,999 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 13:21:47,000 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:47,000 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 13:21:47,000 - root - INFO - Clearing user context 2025-12-04 13:21:47,001 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:47,002 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:47,002 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:47,002 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:47,004 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:47,004 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:47,004 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:47,006 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:47,006 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:47,007 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:47,009 - root - INFO - Clearing user context 2025-12-04 13:21:47,026 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 13:21:47,026 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:47,027 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:47,027 - root - INFO - Clearing user context 2025-12-04 13:21:47,029 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:47,030 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:47,030 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:47,030 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:47,032 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:47,032 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:47,033 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:47,034 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:47,034 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:47,034 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:47,036 - root - INFO - Clearing user context 2025-12-04 13:21:52,086 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:21:52,086 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:52,086 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:52,086 - root - INFO - Clearing user context 2025-12-04 13:21:52,088 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:52,088 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:52,088 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:52,089 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:52,091 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:52,091 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:52,091 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:52,092 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:52,093 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:52,093 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:52,101 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:21:52,102 - root - INFO - Clearing user context 2025-12-04 13:21:54,088 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:21:54,089 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:54,089 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:54,089 - root - INFO - Clearing user context 2025-12-04 13:21:54,090 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:54,091 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:54,091 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:54,091 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:54,093 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:54,093 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:54,094 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:54,095 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:54,095 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:54,095 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:54,102 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:21:54,103 - root - INFO - Clearing user context 2025-12-04 13:21:58,301 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:21:58,301 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:21:58,301 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:21:58,302 - root - INFO - Clearing user context 2025-12-04 13:21:58,303 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:21:58,304 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:58,304 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:21:58,304 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:21:58,307 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:21:58,307 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:21:58,307 - root - INFO - Looking for user with username: admin 2025-12-04 13:21:58,309 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:21:58,309 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:21:58,309 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:21:58,319 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:21:58,321 - root - INFO - Clearing user context 2025-12-04 13:26:57,110 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:26:57,110 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:26:57,110 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:26:57,110 - root - INFO - Clearing user context 2025-12-04 13:26:57,112 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:26:57,112 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:26:57,112 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:26:57,113 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:26:57,115 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:26:57,116 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:26:57,116 - root - INFO - Looking for user with username: admin 2025-12-04 13:26:57,118 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:26:57,118 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:26:57,118 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:26:57,126 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:26:57,128 - root - INFO - Clearing user context 2025-12-04 13:27:03,458 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:27:03,458 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:27:03,459 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:27:03,459 - root - INFO - Clearing user context 2025-12-04 13:27:03,460 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:27:03,461 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:03,461 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:27:03,461 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:27:03,463 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:27:03,463 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:27:03,463 - root - INFO - Looking for user with username: admin 2025-12-04 13:27:03,465 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:27:03,465 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:03,465 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:27:03,474 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:27:03,475 - root - INFO - Clearing user context 2025-12-04 13:27:13,258 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:27:13,258 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:27:13,258 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:27:13,259 - root - INFO - Clearing user context 2025-12-04 13:27:13,260 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:27:13,260 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:13,260 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:27:13,261 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:27:13,262 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:27:13,263 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:27:13,263 - root - INFO - Looking for user with username: admin 2025-12-04 13:27:13,264 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:27:13,264 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:13,264 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:27:13,281 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:27:13,282 - root - INFO - Clearing user context 2025-12-04 13:27:15,107 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:27:15,107 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:27:15,108 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:27:15,108 - root - INFO - Clearing user context 2025-12-04 13:27:15,109 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:27:15,110 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:15,110 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:27:15,110 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:27:15,112 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:27:15,112 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:27:15,112 - root - INFO - Looking for user with username: admin 2025-12-04 13:27:15,114 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:27:15,114 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:15,114 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:27:15,121 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:27:15,123 - root - INFO - Clearing user context 2025-12-04 13:27:17,494 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:27:17,495 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:27:17,495 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:27:17,495 - root - INFO - Clearing user context 2025-12-04 13:27:17,497 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:27:17,497 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:17,497 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:27:17,497 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:27:17,499 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:27:17,500 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:27:17,500 - root - INFO - Looking for user with username: admin 2025-12-04 13:27:17,501 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:27:17,501 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:17,501 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:27:17,508 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:27:17,509 - root - INFO - Clearing user context 2025-12-04 13:27:20,474 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 13:27:20,475 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 13:27:20,475 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 13:27:20,475 - root - INFO - Clearing user context 2025-12-04 13:27:20,477 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 13:27:20,477 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:20,477 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 13:27:20,477 - root - INFO - Verified current user ID in context: 2 2025-12-04 13:27:20,479 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 13:27:20,480 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 13:27:20,480 - root - INFO - Looking for user with username: admin 2025-12-04 13:27:20,481 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 13:27:20,481 - root - INFO - Verification - ContextVar user: admin 2025-12-04 13:27:20,481 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 13:27:20,489 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 13:27:20,490 - root - INFO - Clearing user context 2025-12-04 14:07:57,592 - root - INFO - Logging configured successfully 2025-12-04 14:07:57,705 - root - INFO - Logging configured successfully 2025-12-04 14:07:57,910 - root - INFO - Starting up TH-Agenter application... 2025-12-04 14:07:57,958 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-04 14:07:57,972 - root - INFO - Database tables created 2025-12-04 14:07:57,973 - root - INFO - Database initialized 2025-12-04 14:16:08,129 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-04 14:16:08,129 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:08,129 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-04 14:16:08,130 - root - INFO - Clearing user context 2025-12-04 14:16:08,197 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:08,197 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:08,198 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:08,198 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:08,201 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:16:08,202 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:16:08,202 - root - INFO - Looking for user with username: admin 2025-12-04 14:16:08,204 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:16:08,204 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:08,204 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:16:08,222 - root - INFO - Clearing user context 2025-12-04 14:16:08,235 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-04 14:16:08,235 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:08,235 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-04 14:16:08,235 - root - INFO - Clearing user context 2025-12-04 14:16:08,238 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:08,238 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:08,238 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:08,238 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:08,240 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:16:08,241 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:16:08,241 - root - INFO - Looking for user with username: admin 2025-12-04 14:16:08,243 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:16:08,244 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:08,244 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:16:08,250 - root - INFO - Clearing user context 2025-12-04 14:16:09,125 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 14:16:09,126 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,126 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 14:16:09,126 - root - INFO - Clearing user context 2025-12-04 14:16:09,127 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,127 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,128 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,128 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,129 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 14:16:09,129 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,130 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 14:16:09,130 - root - INFO - Clearing user context 2025-12-04 14:16:09,132 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,132 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,132 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,133 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,149 - root - INFO - Clearing user context 2025-12-04 14:16:09,150 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:16:09,151 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:16:09,151 - root - INFO - Looking for user with username: admin 2025-12-04 14:16:09,153 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:16:09,154 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,155 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 14:16:09,155 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:16:09,155 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,156 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 14:16:09,156 - root - INFO - Clearing user context 2025-12-04 14:16:09,161 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,161 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,161 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,161 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,183 - root - INFO - Clearing user context 2025-12-04 14:16:09,190 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 14:16:09,197 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,197 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 14:16:09,197 - root - INFO - Clearing user context 2025-12-04 14:16:09,201 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,201 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,202 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,202 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,203 - root - INFO - Clearing user context 2025-12-04 14:16:09,205 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-04 14:16:09,206 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,206 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-04 14:16:09,206 - root - INFO - Clearing user context 2025-12-04 14:16:09,208 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,208 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,208 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,209 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,212 - root - INFO - Clearing user context 2025-12-04 14:16:09,215 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-04 14:16:09,215 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,216 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-04 14:16:09,216 - root - INFO - Clearing user context 2025-12-04 14:16:09,218 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,218 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,219 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,219 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,221 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:16:09,222 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:16:09,223 - root - INFO - Looking for user with username: admin 2025-12-04 14:16:09,226 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:16:09,226 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,228 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 14:16:09,228 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:16:09,228 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,229 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 14:16:09,229 - root - INFO - Clearing user context 2025-12-04 14:16:09,230 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,231 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,231 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,231 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,232 - root - INFO - Clearing user context 2025-12-04 14:16:09,238 - root - INFO - Clearing user context 2025-12-04 14:16:09,242 - root - INFO - Clearing user context 2025-12-04 14:16:09,251 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-04 14:16:09,251 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:16:09,252 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-04 14:16:09,252 - root - INFO - Clearing user context 2025-12-04 14:16:09,253 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:16:09,254 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:16:09,254 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:16:09,254 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:16:09,257 - root - INFO - Clearing user context 2025-12-04 14:22:37,976 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:22:37,977 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:37,977 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:22:37,977 - root - INFO - Clearing user context 2025-12-04 14:22:37,979 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:37,980 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:37,980 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:37,980 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:37,982 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:37,982 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:37,982 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:37,984 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:37,984 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:37,984 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:38,000 - root - INFO - Clearing user context 2025-12-04 14:22:40,162 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:22:40,163 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:40,163 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:22:40,163 - root - INFO - Clearing user context 2025-12-04 14:22:40,165 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:40,166 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,166 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:40,166 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:40,168 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:40,168 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:40,169 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:40,171 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:40,171 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,171 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:40,178 - root - INFO - Clearing user context 2025-12-04 14:22:40,188 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:22:40,188 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:40,189 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:22:40,189 - root - INFO - Clearing user context 2025-12-04 14:22:40,190 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:40,191 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,191 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:40,191 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:40,193 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:40,193 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:40,193 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:40,195 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:40,195 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,195 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:40,200 - root - INFO - Clearing user context 2025-12-04 14:22:40,210 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/2 2025-12-04 14:22:40,210 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:40,211 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:22:40,211 - root - INFO - Clearing user context 2025-12-04 14:22:40,212 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:40,212 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,213 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:40,213 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:40,214 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:40,214 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:40,215 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:40,215 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:40,216 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:40,216 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:40,219 - root - INFO - Clearing user context 2025-12-04 14:22:51,717 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:22:51,717 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:51,717 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:22:51,717 - root - INFO - Clearing user context 2025-12-04 14:22:51,719 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:51,719 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:51,720 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:51,720 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:51,722 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:51,722 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:51,722 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:51,723 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:51,724 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:51,724 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:51,735 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:22:51,736 - root - INFO - Clearing user context 2025-12-04 14:22:53,744 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:22:53,744 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:53,744 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:22:53,744 - root - INFO - Clearing user context 2025-12-04 14:22:53,746 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:53,746 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:53,747 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:53,747 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:53,749 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:53,749 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:53,749 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:53,751 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:53,751 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:53,751 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:53,768 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:22:53,770 - root - INFO - Clearing user context 2025-12-04 14:22:57,124 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:22:57,124 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:22:57,125 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:22:57,125 - root - INFO - Clearing user context 2025-12-04 14:22:57,126 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:22:57,126 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:57,127 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:22:57,127 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:22:57,128 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:22:57,129 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:22:57,129 - root - INFO - Looking for user with username: admin 2025-12-04 14:22:57,130 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:22:57,130 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:22:57,131 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:22:57,137 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:22:57,138 - root - INFO - Clearing user context 2025-12-04 14:23:06,944 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:23:06,945 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:23:06,945 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:23:06,945 - root - INFO - Clearing user context 2025-12-04 14:23:06,946 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:23:06,946 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:06,947 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:23:06,947 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:23:06,948 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:23:06,949 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:23:06,949 - root - INFO - Looking for user with username: admin 2025-12-04 14:23:06,950 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:23:06,950 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:06,950 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:23:06,965 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:23:06,967 - root - INFO - Clearing user context 2025-12-04 14:23:12,408 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:23:12,408 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:23:12,408 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:23:12,409 - root - INFO - Clearing user context 2025-12-04 14:23:12,410 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:23:12,410 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:12,410 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:23:12,410 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:23:12,412 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:23:12,412 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:23:12,412 - root - INFO - Looking for user with username: admin 2025-12-04 14:23:12,413 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:23:12,413 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:12,413 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:23:12,421 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:23:12,423 - root - INFO - Clearing user context 2025-12-04 14:23:37,040 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:23:37,040 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:23:37,040 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:23:37,041 - root - INFO - Clearing user context 2025-12-04 14:23:37,042 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:23:37,042 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:37,042 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:23:37,043 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:23:37,044 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:23:37,044 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:23:37,045 - root - INFO - Looking for user with username: admin 2025-12-04 14:23:37,046 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:23:37,046 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:37,046 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:23:37,061 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:23:37,063 - root - INFO - Clearing user context 2025-12-04 14:23:40,765 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:23:40,765 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:23:40,765 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:23:40,766 - root - INFO - Clearing user context 2025-12-04 14:23:40,767 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:23:40,767 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:40,767 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:23:40,767 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:23:40,769 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:23:40,769 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:23:40,770 - root - INFO - Looking for user with username: admin 2025-12-04 14:23:40,771 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:23:40,771 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:40,771 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:23:40,777 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:23:40,778 - root - INFO - Clearing user context 2025-12-04 14:23:53,043 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:23:53,043 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:23:53,044 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:23:53,044 - root - INFO - Clearing user context 2025-12-04 14:23:53,045 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:23:53,045 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:53,045 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:23:53,046 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:23:53,048 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:23:53,049 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:23:53,049 - root - INFO - Looking for user with username: admin 2025-12-04 14:23:53,050 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:23:53,051 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:23:53,051 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:23:53,058 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:23:53,059 - root - INFO - Clearing user context 2025-12-04 14:24:09,610 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:24:09,610 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:24:09,611 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:24:09,611 - root - INFO - Clearing user context 2025-12-04 14:24:09,612 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:24:09,613 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:09,613 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:24:09,613 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:24:09,615 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:24:09,615 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:24:09,616 - root - INFO - Looking for user with username: admin 2025-12-04 14:24:09,617 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:24:09,618 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:09,618 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:24:09,635 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:24:09,636 - root - INFO - Clearing user context 2025-12-04 14:24:11,846 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:24:11,847 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:24:11,847 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:24:11,847 - root - INFO - Clearing user context 2025-12-04 14:24:11,848 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:24:11,849 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:11,849 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:24:11,849 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:24:11,851 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:24:11,851 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:24:11,851 - root - INFO - Looking for user with username: admin 2025-12-04 14:24:11,852 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:24:11,852 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:11,852 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:24:11,868 - th_agenter.workflow_api - INFO - Updated workflow: qw3233 by user admin 2025-12-04 14:24:11,869 - root - INFO - Clearing user context 2025-12-04 14:24:15,771 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:24:15,771 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:24:15,771 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:24:15,771 - root - INFO - Clearing user context 2025-12-04 14:24:15,773 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:24:15,773 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:15,773 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:24:15,773 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:24:15,775 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:24:15,775 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:24:15,775 - root - INFO - Looking for user with username: admin 2025-12-04 14:24:15,776 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:24:15,776 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:24:15,776 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:24:15,779 - root - ERROR - Database session error: [{'type': 'enum', 'loc': ('body', 'definition', 'nodes', 10, 'type'), 'msg': "Input should be 'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'", 'input': 'weather', 'ctx': {'expected': "'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'"}}] 2025-12-04 14:24:15,780 - root - INFO - Clearing user context 2025-12-04 14:31:43,954 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:31:43,954 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:31:43,955 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:31:43,955 - root - INFO - Clearing user context 2025-12-04 14:31:43,956 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:31:43,956 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:31:43,956 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:31:43,957 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:31:43,958 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:31:43,958 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:31:43,959 - root - INFO - Looking for user with username: admin 2025-12-04 14:31:43,960 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:31:43,960 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:31:43,960 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:31:43,961 - root - ERROR - Database session error: [{'type': 'enum', 'loc': ('body', 'definition', 'nodes', 10, 'type'), 'msg': "Input should be 'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'", 'input': 'weather', 'ctx': {'expected': "'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'"}}] 2025-12-04 14:31:43,962 - root - INFO - Clearing user context 2025-12-04 14:32:20,663 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:32:20,664 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:20,664 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:32:20,664 - root - INFO - Clearing user context 2025-12-04 14:32:20,666 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:20,666 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:20,666 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:20,666 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:20,669 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:20,669 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:20,669 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:20,671 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:20,671 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:20,671 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:20,672 - root - ERROR - Database session error: [{'type': 'enum', 'loc': ('body', 'definition', 'nodes', 10, 'type'), 'msg': "Input should be 'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'", 'input': 'weather', 'ctx': {'expected': "'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'"}}] 2025-12-04 14:32:20,673 - root - INFO - Clearing user context 2025-12-04 14:32:25,181 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/2 2025-12-04 14:32:25,181 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:25,181 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/2 2025-12-04 14:32:25,181 - root - INFO - Clearing user context 2025-12-04 14:32:25,183 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:25,183 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:25,183 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:25,184 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:25,185 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:25,186 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:25,186 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:25,188 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:25,189 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:25,189 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:25,190 - root - ERROR - Database session error: [{'type': 'enum', 'loc': ('body', 'definition', 'nodes', 10, 'type'), 'msg': "Input should be 'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'", 'input': 'weather', 'ctx': {'expected': "'start', 'end', 'llm', 'condition', 'loop', 'code', 'http' or 'tool'"}}] 2025-12-04 14:32:25,191 - root - INFO - Clearing user context 2025-12-04 14:32:36,767 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:36,767 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:36,767 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:36,767 - root - INFO - Clearing user context 2025-12-04 14:32:36,769 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:36,769 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:36,769 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:36,769 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:36,771 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:36,771 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:36,771 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:36,773 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:36,773 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:36,773 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:36,781 - root - INFO - Clearing user context 2025-12-04 14:32:37,707 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:37,708 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:37,708 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:37,708 - root - INFO - Clearing user context 2025-12-04 14:32:37,709 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:37,710 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,710 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:37,710 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:37,711 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:37,712 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:37,712 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:37,713 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:37,713 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,713 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:37,718 - root - INFO - Clearing user context 2025-12-04 14:32:37,726 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:32:37,727 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:37,727 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:32:37,727 - root - INFO - Clearing user context 2025-12-04 14:32:37,728 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:37,728 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,729 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:37,729 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:37,730 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:37,730 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:37,730 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:37,731 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:37,731 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,732 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:37,734 - root - INFO - Clearing user context 2025-12-04 14:32:37,744 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:32:37,745 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:37,745 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:32:37,745 - root - INFO - Clearing user context 2025-12-04 14:32:37,747 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:37,747 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,747 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:37,747 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:37,749 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:37,750 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:37,750 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:37,752 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:37,752 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:37,752 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:37,754 - root - INFO - Clearing user context 2025-12-04 14:32:39,843 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:32:39,843 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:39,843 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:32:39,843 - root - INFO - Clearing user context 2025-12-04 14:32:39,845 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:39,845 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:39,845 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:39,846 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:39,847 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:39,847 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:39,848 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:39,849 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:39,849 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:39,849 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:39,865 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:32:39,866 - root - INFO - Clearing user context 2025-12-04 14:32:42,232 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:32:42,233 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:42,233 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:32:42,233 - root - INFO - Clearing user context 2025-12-04 14:32:42,235 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:42,235 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:42,235 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:42,236 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:42,238 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:42,239 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:42,239 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:42,241 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:42,241 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:42,241 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:42,249 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:32:42,250 - root - INFO - Clearing user context 2025-12-04 14:32:54,152 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:54,152 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:54,153 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:54,153 - root - INFO - Clearing user context 2025-12-04 14:32:54,154 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:54,155 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:54,155 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:54,155 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:54,157 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:54,157 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:54,157 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:54,159 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:54,160 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:54,160 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:54,169 - root - INFO - Clearing user context 2025-12-04 14:32:55,078 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:55,079 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:55,079 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:55,079 - root - INFO - Clearing user context 2025-12-04 14:32:55,081 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:55,081 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,081 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:55,081 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:55,083 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:55,083 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:55,083 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:55,085 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:55,085 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,085 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:55,092 - root - INFO - Clearing user context 2025-12-04 14:32:55,099 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:32:55,100 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:55,100 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:32:55,100 - root - INFO - Clearing user context 2025-12-04 14:32:55,102 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:55,102 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,102 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:55,102 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:55,104 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:55,104 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:55,104 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:55,106 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:55,106 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,106 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:55,109 - root - INFO - Clearing user context 2025-12-04 14:32:55,119 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/8 2025-12-04 14:32:55,119 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/8 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:55,119 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/8 2025-12-04 14:32:55,120 - root - INFO - Clearing user context 2025-12-04 14:32:55,122 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:55,122 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,122 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:55,122 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:55,124 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:55,124 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:55,125 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:55,127 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:55,127 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:55,127 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:55,129 - root - INFO - Clearing user context 2025-12-04 14:32:56,813 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:56,813 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:56,814 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:56,814 - root - INFO - Clearing user context 2025-12-04 14:32:56,815 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:56,816 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:56,816 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:56,816 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:56,818 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:56,819 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:56,819 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:56,820 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:56,821 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:56,821 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:56,828 - root - INFO - Clearing user context 2025-12-04 14:32:57,970 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:32:57,970 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:57,970 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:32:57,970 - root - INFO - Clearing user context 2025-12-04 14:32:57,972 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:57,972 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:57,973 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:57,973 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:57,975 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:57,975 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:57,975 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:57,976 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:57,977 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:57,977 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:57,989 - root - INFO - Clearing user context 2025-12-04 14:32:58,003 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:32:58,004 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:58,004 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:32:58,004 - root - INFO - Clearing user context 2025-12-04 14:32:58,006 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:58,007 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:58,007 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:58,007 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:58,008 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:58,009 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:58,009 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:58,010 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:58,011 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:58,011 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:58,013 - root - INFO - Clearing user context 2025-12-04 14:32:58,021 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:32:58,021 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:32:58,021 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:32:58,022 - root - INFO - Clearing user context 2025-12-04 14:32:58,024 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:32:58,024 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:58,024 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:32:58,025 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:32:58,026 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:32:58,026 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:32:58,026 - root - INFO - Looking for user with username: admin 2025-12-04 14:32:58,028 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:32:58,029 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:32:58,029 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:32:58,031 - root - INFO - Clearing user context 2025-12-04 14:33:00,493 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:33:00,493 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:00,493 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:33:00,494 - root - INFO - Clearing user context 2025-12-04 14:33:00,495 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:00,495 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:00,495 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:00,495 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:00,497 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:00,497 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:00,497 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:00,498 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:00,499 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:00,499 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:00,505 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:33:00,506 - root - INFO - Clearing user context 2025-12-04 14:33:02,302 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:33:02,302 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:02,302 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:33:02,302 - root - INFO - Clearing user context 2025-12-04 14:33:02,304 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:02,304 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:02,308 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:02,309 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:02,310 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:02,311 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:02,311 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:02,312 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:02,313 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:02,313 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:02,319 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:33:02,320 - root - INFO - Clearing user context 2025-12-04 14:33:02,697 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:02,698 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:02,698 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:02,698 - root - INFO - Clearing user context 2025-12-04 14:33:02,699 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:02,700 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:02,700 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:02,700 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:02,701 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:02,702 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:02,703 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:02,705 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:02,705 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:02,705 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:02,711 - root - INFO - Clearing user context 2025-12-04 14:33:03,606 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:03,606 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:03,606 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:03,607 - root - INFO - Clearing user context 2025-12-04 14:33:03,608 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:03,608 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,609 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:03,609 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:03,611 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:03,611 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:03,612 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:03,613 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:03,613 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,614 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:03,623 - root - INFO - Clearing user context 2025-12-04 14:33:03,630 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:33:03,630 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:03,631 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:33:03,631 - root - INFO - Clearing user context 2025-12-04 14:33:03,633 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:03,633 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,633 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:03,634 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:03,635 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:03,636 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:03,636 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:03,638 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:03,638 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,639 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:03,642 - root - INFO - Clearing user context 2025-12-04 14:33:03,651 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:33:03,652 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:03,652 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:33:03,652 - root - INFO - Clearing user context 2025-12-04 14:33:03,654 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:03,654 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,654 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:03,655 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:03,656 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:03,657 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:03,657 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:03,658 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:03,658 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:03,658 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:03,661 - root - INFO - Clearing user context 2025-12-04 14:33:05,789 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:33:05,790 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:05,790 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:33:05,790 - root - INFO - Clearing user context 2025-12-04 14:33:05,792 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:05,792 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:05,792 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:05,792 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:05,794 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:05,794 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:05,794 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:05,795 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:05,795 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:05,795 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:05,801 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:33:05,802 - root - INFO - Clearing user context 2025-12-04 14:33:05,858 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:05,858 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:05,859 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:05,859 - root - INFO - Clearing user context 2025-12-04 14:33:05,860 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:05,860 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:05,861 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:05,861 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:05,862 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:05,862 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:05,863 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:05,864 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:05,864 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:05,864 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:05,870 - root - INFO - Clearing user context 2025-12-04 14:33:06,668 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:06,669 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:06,669 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:06,669 - root - INFO - Clearing user context 2025-12-04 14:33:06,670 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:06,671 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,671 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:06,671 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:06,673 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:06,673 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:06,674 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:06,675 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:06,675 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,675 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:06,682 - root - INFO - Clearing user context 2025-12-04 14:33:06,691 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:33:06,692 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:06,692 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:33:06,692 - root - INFO - Clearing user context 2025-12-04 14:33:06,693 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:06,693 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,694 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:06,694 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:06,695 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:06,695 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:06,695 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:06,696 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:06,696 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,696 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:06,699 - root - INFO - Clearing user context 2025-12-04 14:33:06,708 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:33:06,709 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:06,709 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:33:06,709 - root - INFO - Clearing user context 2025-12-04 14:33:06,711 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:06,711 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,712 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:06,712 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:06,713 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:06,713 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:06,714 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:06,715 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:06,715 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:06,715 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:06,718 - root - INFO - Clearing user context 2025-12-04 14:33:08,426 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:33:08,426 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:08,426 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:33:08,426 - root - INFO - Clearing user context 2025-12-04 14:33:08,428 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:08,428 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:08,428 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:08,428 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:08,430 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:08,430 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:08,430 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:08,431 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:08,432 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:08,432 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:08,438 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:33:08,439 - root - INFO - Clearing user context 2025-12-04 14:33:11,646 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:33:11,646 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:11,646 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:33:11,647 - root - INFO - Clearing user context 2025-12-04 14:33:11,648 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:11,648 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:11,648 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:11,649 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:11,650 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:11,651 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:11,651 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:11,652 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:11,652 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:11,653 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:11,659 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:33:11,660 - root - INFO - Clearing user context 2025-12-04 14:33:33,112 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:33:33,112 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:33,112 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:33:33,113 - root - INFO - Clearing user context 2025-12-04 14:33:33,114 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:33,114 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:33,114 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:33,115 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:33,116 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:33,117 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:33,117 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:33,119 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:33,119 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:33,119 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:33,136 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:33:33,138 - root - INFO - Clearing user context 2025-12-04 14:33:35,869 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:35,869 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:35,870 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:35,870 - root - INFO - Clearing user context 2025-12-04 14:33:35,871 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:35,871 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:35,872 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:35,872 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:35,873 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:35,874 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:35,874 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:35,875 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:35,875 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:35,876 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:35,882 - root - INFO - Clearing user context 2025-12-04 14:33:37,254 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:37,255 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:37,255 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:37,255 - root - INFO - Clearing user context 2025-12-04 14:33:37,257 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:37,257 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,258 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:37,258 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:37,259 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:37,260 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:37,260 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:37,262 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:37,262 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,262 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:37,268 - root - INFO - Clearing user context 2025-12-04 14:33:37,275 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:33:37,276 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:37,276 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:33:37,276 - root - INFO - Clearing user context 2025-12-04 14:33:37,278 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:37,278 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,278 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:37,278 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:37,279 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:37,280 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:37,280 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:37,281 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:37,281 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,281 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:37,283 - root - INFO - Clearing user context 2025-12-04 14:33:37,291 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/5 2025-12-04 14:33:37,291 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:37,292 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:33:37,292 - root - INFO - Clearing user context 2025-12-04 14:33:37,294 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:37,294 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,294 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:37,294 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:37,296 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:37,296 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:37,296 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:37,298 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:37,299 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:37,299 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:37,301 - root - INFO - Clearing user context 2025-12-04 14:33:38,312 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:38,313 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:38,313 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:38,313 - root - INFO - Clearing user context 2025-12-04 14:33:38,315 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:38,315 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:38,315 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:38,315 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:38,317 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:38,317 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:38,318 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:38,319 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:38,319 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:38,319 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:38,330 - root - INFO - Clearing user context 2025-12-04 14:33:39,210 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:39,211 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:39,211 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:39,211 - root - INFO - Clearing user context 2025-12-04 14:33:39,213 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:39,213 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,213 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:39,213 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:39,215 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:39,215 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:39,216 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:39,217 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:39,217 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,217 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:39,223 - root - INFO - Clearing user context 2025-12-04 14:33:39,230 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:33:39,230 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:39,230 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:33:39,231 - root - INFO - Clearing user context 2025-12-04 14:33:39,232 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:39,232 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,232 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:39,232 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:39,233 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:39,234 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:39,234 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:39,235 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:39,235 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,235 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:39,239 - root - INFO - Clearing user context 2025-12-04 14:33:39,247 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:33:39,247 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:39,247 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:33:39,248 - root - INFO - Clearing user context 2025-12-04 14:33:39,250 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:39,250 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,250 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:39,251 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:39,252 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:39,252 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:39,252 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:39,254 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:39,254 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:39,254 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:39,257 - root - INFO - Clearing user context 2025-12-04 14:33:41,227 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:33:41,227 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:33:41,227 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:33:41,227 - root - INFO - Clearing user context 2025-12-04 14:33:41,228 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:33:41,229 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:41,229 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:33:41,229 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:33:41,230 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:33:41,231 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:33:41,231 - root - INFO - Looking for user with username: admin 2025-12-04 14:33:41,232 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:33:41,232 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:33:41,233 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:33:41,238 - root - INFO - Clearing user context 2025-12-04 14:34:36,973 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:34:36,973 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:34:36,973 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:34:36,973 - root - INFO - Clearing user context 2025-12-04 14:34:36,976 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:34:36,976 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:36,976 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:34:36,976 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:34:36,978 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:34:36,978 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:34:36,979 - root - INFO - Looking for user with username: admin 2025-12-04 14:34:36,980 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:34:36,980 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:36,981 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:34:36,988 - root - INFO - Clearing user context 2025-12-04 14:34:36,999 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:34:36,999 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:34:36,999 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:34:37,000 - root - INFO - Clearing user context 2025-12-04 14:34:37,002 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:34:37,002 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:37,003 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:34:37,003 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:34:37,004 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:34:37,005 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:34:37,005 - root - INFO - Looking for user with username: admin 2025-12-04 14:34:37,006 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:34:37,007 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:37,007 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:34:37,011 - root - INFO - Clearing user context 2025-12-04 14:34:37,019 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:34:37,019 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:34:37,019 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:34:37,020 - root - INFO - Clearing user context 2025-12-04 14:34:37,021 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:34:37,021 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:37,021 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:34:37,022 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:34:37,023 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:34:37,024 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:34:37,024 - root - INFO - Looking for user with username: admin 2025-12-04 14:34:37,026 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:34:37,026 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:37,026 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:34:37,029 - root - INFO - Clearing user context 2025-12-04 14:34:44,248 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:34:44,248 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:34:44,249 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:34:44,249 - root - INFO - Clearing user context 2025-12-04 14:34:44,250 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:34:44,250 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:44,251 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:34:44,251 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:34:44,253 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:34:44,253 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:34:44,253 - root - INFO - Looking for user with username: admin 2025-12-04 14:34:44,254 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:34:44,255 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:34:44,255 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:34:44,272 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:34:44,273 - root - INFO - Clearing user context 2025-12-04 14:35:00,349 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:00,349 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:00,350 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:00,350 - root - INFO - Clearing user context 2025-12-04 14:35:00,351 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:00,352 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,352 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:00,352 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:00,354 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:00,355 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:00,355 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:00,356 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:00,356 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,357 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:00,362 - root - INFO - Clearing user context 2025-12-04 14:35:00,385 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:00,386 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:00,386 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:00,386 - root - INFO - Clearing user context 2025-12-04 14:35:00,387 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:00,387 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,388 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:00,388 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:00,389 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:00,389 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:00,390 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:00,391 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:00,391 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,391 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:00,394 - root - INFO - Clearing user context 2025-12-04 14:35:00,400 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:35:00,400 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:00,401 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:00,401 - root - INFO - Clearing user context 2025-12-04 14:35:00,402 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:00,402 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,402 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:00,402 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:00,403 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:00,404 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:00,404 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:00,405 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:00,405 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:00,405 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:00,407 - root - INFO - Clearing user context 2025-12-04 14:35:13,567 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:13,568 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:13,568 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:13,568 - root - INFO - Clearing user context 2025-12-04 14:35:13,570 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:13,570 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:13,570 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:13,571 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:13,572 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:13,572 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:13,572 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:13,574 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:13,574 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:13,574 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:13,582 - root - INFO - Clearing user context 2025-12-04 14:35:14,492 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:14,492 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:14,493 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:14,493 - root - INFO - Clearing user context 2025-12-04 14:35:14,494 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:14,495 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,495 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:14,495 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:14,496 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:14,497 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:14,497 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:14,498 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:14,499 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,499 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:14,506 - root - INFO - Clearing user context 2025-12-04 14:35:14,513 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:14,514 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:14,514 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:14,514 - root - INFO - Clearing user context 2025-12-04 14:35:14,515 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:14,516 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,516 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:14,516 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:14,517 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:14,518 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:14,518 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:14,519 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:14,520 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,520 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:14,523 - root - INFO - Clearing user context 2025-12-04 14:35:14,533 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/8 2025-12-04 14:35:14,533 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/8 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:14,533 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/8 2025-12-04 14:35:14,533 - root - INFO - Clearing user context 2025-12-04 14:35:14,535 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:14,536 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,536 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:14,536 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:14,538 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:14,538 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:14,538 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:14,540 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:14,540 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:14,540 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:14,542 - root - INFO - Clearing user context 2025-12-04 14:35:15,825 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:15,825 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:15,826 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:15,826 - root - INFO - Clearing user context 2025-12-04 14:35:15,827 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:15,827 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:15,828 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:15,828 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:15,829 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:15,830 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:15,830 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:15,831 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:15,832 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:15,832 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:15,838 - root - INFO - Clearing user context 2025-12-04 14:35:16,606 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:16,607 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:16,607 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:16,607 - root - INFO - Clearing user context 2025-12-04 14:35:16,609 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:16,609 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,609 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:16,609 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:16,611 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:16,611 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:16,612 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:16,613 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:16,614 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,614 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:16,624 - root - INFO - Clearing user context 2025-12-04 14:35:16,632 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:16,633 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:16,633 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:16,633 - root - INFO - Clearing user context 2025-12-04 14:35:16,634 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:16,635 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,635 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:16,635 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:16,637 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:16,638 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:16,638 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:16,640 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:16,640 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,640 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:16,645 - root - INFO - Clearing user context 2025-12-04 14:35:16,652 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:35:16,652 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:16,653 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:35:16,653 - root - INFO - Clearing user context 2025-12-04 14:35:16,655 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:16,655 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,655 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:16,656 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:16,657 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:16,658 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:16,658 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:16,660 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:16,661 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:16,661 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:16,664 - root - INFO - Clearing user context 2025-12-04 14:35:17,431 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:17,431 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:17,432 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:17,432 - root - INFO - Clearing user context 2025-12-04 14:35:17,433 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:17,433 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,434 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:17,434 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:17,435 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:17,435 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:17,435 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:17,437 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:17,437 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,438 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:17,445 - root - INFO - Clearing user context 2025-12-04 14:35:17,473 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:17,473 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:17,474 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:17,474 - root - INFO - Clearing user context 2025-12-04 14:35:17,476 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:17,476 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,476 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:17,476 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:17,477 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:17,478 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:17,478 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:17,479 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:17,479 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,480 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:17,482 - root - INFO - Clearing user context 2025-12-04 14:35:17,492 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:35:17,492 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:17,492 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:35:17,493 - root - INFO - Clearing user context 2025-12-04 14:35:17,494 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:17,494 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,494 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:17,494 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:17,496 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:17,496 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:17,497 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:17,498 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:17,498 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:17,498 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:17,500 - root - INFO - Clearing user context 2025-12-04 14:35:18,139 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:18,139 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:18,140 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:18,140 - root - INFO - Clearing user context 2025-12-04 14:35:18,141 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:18,142 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,142 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:18,142 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:18,144 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:18,144 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:18,144 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:18,145 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:18,146 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,146 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:18,152 - root - INFO - Clearing user context 2025-12-04 14:35:18,893 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:18,894 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:18,895 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:18,896 - root - INFO - Clearing user context 2025-12-04 14:35:18,898 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:18,899 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,899 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:18,899 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:18,901 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:18,902 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:18,902 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:18,903 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:18,904 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,904 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:18,914 - root - INFO - Clearing user context 2025-12-04 14:35:18,925 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:18,925 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:18,925 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:18,926 - root - INFO - Clearing user context 2025-12-04 14:35:18,927 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:18,928 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,928 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:18,928 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:18,930 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:18,931 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:18,931 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:18,932 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:18,933 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,933 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:18,937 - root - INFO - Clearing user context 2025-12-04 14:35:18,947 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:35:18,947 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:18,948 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:18,948 - root - INFO - Clearing user context 2025-12-04 14:35:18,949 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:18,950 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,950 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:18,950 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:18,952 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:18,952 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:18,952 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:18,954 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:18,955 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:18,955 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:18,958 - root - INFO - Clearing user context 2025-12-04 14:35:24,108 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:24,109 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:24,109 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:24,109 - root - INFO - Clearing user context 2025-12-04 14:35:24,111 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:24,111 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:24,112 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:24,112 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:24,115 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:24,115 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:24,115 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:24,117 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:24,117 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:24,117 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:24,126 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:24,128 - root - INFO - Clearing user context 2025-12-04 14:35:28,778 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:28,779 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:28,779 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:28,779 - root - INFO - Clearing user context 2025-12-04 14:35:28,781 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:28,781 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:28,781 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:28,781 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:28,783 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:28,783 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:28,783 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:28,785 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:28,785 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:28,785 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:28,792 - root - INFO - Clearing user context 2025-12-04 14:35:29,636 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:29,636 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:29,637 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:29,637 - root - INFO - Clearing user context 2025-12-04 14:35:29,638 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:29,639 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,639 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:29,639 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:29,641 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:29,641 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:29,641 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:29,643 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:29,643 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,643 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:29,649 - root - INFO - Clearing user context 2025-12-04 14:35:29,656 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:29,657 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:29,657 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:29,657 - root - INFO - Clearing user context 2025-12-04 14:35:29,659 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:29,659 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,660 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:29,660 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:29,662 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:29,663 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:29,663 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:29,666 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:29,669 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,669 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:29,673 - root - INFO - Clearing user context 2025-12-04 14:35:29,684 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:35:29,684 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:29,685 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:35:29,685 - root - INFO - Clearing user context 2025-12-04 14:35:29,687 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:29,688 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,688 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:29,688 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:29,690 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:29,691 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:29,691 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:29,693 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:29,693 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:29,694 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:29,697 - root - INFO - Clearing user context 2025-12-04 14:35:31,809 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:31,809 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:31,810 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:31,810 - root - INFO - Clearing user context 2025-12-04 14:35:31,811 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:31,812 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:31,812 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:31,812 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:31,814 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:31,814 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:31,814 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:31,815 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:31,815 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:31,816 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:31,823 - root - INFO - Clearing user context 2025-12-04 14:35:32,636 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:35:32,636 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:32,636 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:35:32,636 - root - INFO - Clearing user context 2025-12-04 14:35:32,638 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:32,638 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,638 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:32,639 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:32,640 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:32,640 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:32,641 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:32,642 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:32,642 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,642 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:32,650 - root - INFO - Clearing user context 2025-12-04 14:35:32,657 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:35:32,658 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:32,658 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:35:32,658 - root - INFO - Clearing user context 2025-12-04 14:35:32,660 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:32,660 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,661 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:32,661 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:32,662 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:32,663 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:32,663 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:32,664 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:32,665 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,665 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:32,668 - root - INFO - Clearing user context 2025-12-04 14:35:32,678 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:35:32,679 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:32,679 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:32,679 - root - INFO - Clearing user context 2025-12-04 14:35:32,681 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:32,681 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,682 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:32,682 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:32,683 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:32,684 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:32,684 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:32,686 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:32,686 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:32,687 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:32,689 - root - INFO - Clearing user context 2025-12-04 14:35:39,433 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:39,433 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:39,434 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:39,434 - root - INFO - Clearing user context 2025-12-04 14:35:39,435 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:39,435 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:39,435 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:39,435 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:39,437 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:39,437 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:39,437 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:39,439 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:39,439 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:39,439 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:39,456 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:39,457 - root - INFO - Clearing user context 2025-12-04 14:35:50,180 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:50,180 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:50,181 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:50,181 - root - INFO - Clearing user context 2025-12-04 14:35:50,182 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:50,182 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:50,183 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:50,183 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:50,184 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:50,185 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:50,185 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:50,186 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:50,186 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:50,186 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:50,192 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:50,193 - root - INFO - Clearing user context 2025-12-04 14:35:53,210 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:53,210 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:53,210 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:53,211 - root - INFO - Clearing user context 2025-12-04 14:35:53,212 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:53,212 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:53,212 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:53,213 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:53,214 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:53,214 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:53,214 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:53,216 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:53,216 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:53,216 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:53,222 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:53,223 - root - INFO - Clearing user context 2025-12-04 14:35:56,611 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:56,611 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:56,612 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:56,612 - root - INFO - Clearing user context 2025-12-04 14:35:56,613 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:56,614 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:56,614 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:56,614 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:56,616 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:56,616 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:56,617 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:56,618 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:56,618 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:56,619 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:56,635 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:56,636 - root - INFO - Clearing user context 2025-12-04 14:35:58,898 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:35:58,898 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:35:58,899 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:35:58,899 - root - INFO - Clearing user context 2025-12-04 14:35:58,900 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:35:58,900 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:58,900 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:35:58,901 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:35:58,902 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:35:58,902 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:35:58,902 - root - INFO - Looking for user with username: admin 2025-12-04 14:35:58,903 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:35:58,904 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:35:58,904 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:35:58,911 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:35:58,913 - root - INFO - Clearing user context 2025-12-04 14:36:03,187 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:03,188 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:03,188 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:03,188 - root - INFO - Clearing user context 2025-12-04 14:36:03,190 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:03,190 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:03,190 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:03,191 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:03,193 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:03,193 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:03,194 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:03,195 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:03,196 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:03,196 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:03,203 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:03,205 - root - INFO - Clearing user context 2025-12-04 14:36:06,891 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:06,891 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:06,892 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:06,892 - root - INFO - Clearing user context 2025-12-04 14:36:06,893 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:06,893 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:06,894 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:06,894 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:06,895 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:06,896 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:06,896 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:06,897 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:06,898 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:06,898 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:06,914 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:06,915 - root - INFO - Clearing user context 2025-12-04 14:36:13,633 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:13,633 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:13,633 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:13,634 - root - INFO - Clearing user context 2025-12-04 14:36:13,635 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:13,635 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:13,635 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:13,636 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:13,637 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:13,638 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:13,638 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:13,640 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:13,640 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:13,640 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:13,658 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:13,660 - root - INFO - Clearing user context 2025-12-04 14:36:21,352 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:21,352 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:21,352 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:21,353 - root - INFO - Clearing user context 2025-12-04 14:36:21,354 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:21,354 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:21,354 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:21,354 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:21,356 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:21,356 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:21,356 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:21,357 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:21,358 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:21,358 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:21,373 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:21,375 - root - INFO - Clearing user context 2025-12-04 14:36:26,419 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:26,419 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:26,420 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:26,420 - root - INFO - Clearing user context 2025-12-04 14:36:26,421 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:26,426 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:26,426 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:26,426 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:26,428 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:26,429 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:26,429 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:26,431 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:26,431 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:26,432 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:26,439 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:26,440 - root - INFO - Clearing user context 2025-12-04 14:36:36,411 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:36,412 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:36,412 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:36,412 - root - INFO - Clearing user context 2025-12-04 14:36:36,413 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:36,414 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:36,414 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:36,414 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:36,415 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:36,416 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:36,416 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:36,417 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:36,417 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:36,417 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:36,423 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:36,425 - root - INFO - Clearing user context 2025-12-04 14:36:38,414 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:36:38,414 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:38,414 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:36:38,415 - root - INFO - Clearing user context 2025-12-04 14:36:38,416 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:38,416 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:38,417 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:38,417 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:38,420 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:38,420 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:38,420 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:38,422 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:38,422 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:38,422 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:38,428 - root - INFO - Clearing user context 2025-12-04 14:36:39,360 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:36:39,361 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:39,361 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:36:39,361 - root - INFO - Clearing user context 2025-12-04 14:36:39,363 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:39,363 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,363 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:39,363 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:39,365 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:39,365 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:39,365 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:39,366 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:39,367 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,367 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:39,376 - root - INFO - Clearing user context 2025-12-04 14:36:39,383 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:36:39,383 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:39,384 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:36:39,384 - root - INFO - Clearing user context 2025-12-04 14:36:39,385 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:39,385 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,386 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:39,386 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:39,387 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:39,387 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:39,388 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:39,389 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:39,389 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,389 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:39,392 - root - INFO - Clearing user context 2025-12-04 14:36:39,399 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:36:39,399 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:39,399 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:39,399 - root - INFO - Clearing user context 2025-12-04 14:36:39,401 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:39,401 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,401 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:39,401 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:39,402 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:39,403 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:39,403 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:39,405 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:39,405 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:39,405 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:39,408 - root - INFO - Clearing user context 2025-12-04 14:36:41,348 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:36:41,348 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:41,349 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:36:41,349 - root - INFO - Clearing user context 2025-12-04 14:36:41,350 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:41,350 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:41,350 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:41,351 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:41,352 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:41,352 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:41,352 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:41,353 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:41,354 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:41,354 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:41,369 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:36:41,371 - root - INFO - Clearing user context 2025-12-04 14:36:41,840 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:36:41,841 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:41,841 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:36:41,841 - root - INFO - Clearing user context 2025-12-04 14:36:41,843 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:41,843 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:41,843 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:41,843 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:41,845 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:41,845 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:41,845 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:41,847 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:41,847 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:41,847 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:41,853 - root - INFO - Clearing user context 2025-12-04 14:36:42,758 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:36:42,759 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:42,759 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:36:42,759 - root - INFO - Clearing user context 2025-12-04 14:36:42,760 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:42,760 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,761 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:42,761 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:42,763 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:42,763 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:42,763 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:42,764 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:42,765 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,765 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:42,771 - root - INFO - Clearing user context 2025-12-04 14:36:42,780 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:36:42,781 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:42,781 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:36:42,781 - root - INFO - Clearing user context 2025-12-04 14:36:42,782 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:42,783 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,783 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:42,783 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:42,784 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:42,785 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:42,785 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:42,786 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:42,786 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,786 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:42,788 - root - INFO - Clearing user context 2025-12-04 14:36:42,797 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/5 2025-12-04 14:36:42,797 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:42,797 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:42,798 - root - INFO - Clearing user context 2025-12-04 14:36:42,799 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:42,800 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,800 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:42,800 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:42,801 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:42,802 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:42,802 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:42,803 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:42,803 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:42,803 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:42,806 - root - INFO - Clearing user context 2025-12-04 14:36:45,510 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:36:45,510 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:45,511 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:45,511 - root - INFO - Clearing user context 2025-12-04 14:36:45,513 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:45,513 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:45,514 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:45,514 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:45,515 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:45,516 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:45,516 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:45,517 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:45,517 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:45,518 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:45,525 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:36:45,526 - root - INFO - Clearing user context 2025-12-04 14:36:48,047 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:36:48,047 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:48,048 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:48,048 - root - INFO - Clearing user context 2025-12-04 14:36:48,049 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:48,049 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:48,050 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:48,050 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:48,051 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:48,052 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:48,052 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:48,053 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:48,053 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:48,053 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:48,070 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:36:48,071 - root - INFO - Clearing user context 2025-12-04 14:36:52,403 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:36:52,403 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:52,403 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:52,404 - root - INFO - Clearing user context 2025-12-04 14:36:52,405 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:52,405 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:52,405 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:52,405 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:52,407 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:52,407 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:52,407 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:52,408 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:52,408 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:52,409 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:52,421 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:36:52,422 - root - INFO - Clearing user context 2025-12-04 14:36:55,635 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:36:55,635 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:55,635 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:55,636 - root - INFO - Clearing user context 2025-12-04 14:36:55,637 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:55,637 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:55,638 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:55,638 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:55,639 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:55,640 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:55,640 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:55,641 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:55,641 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:55,641 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:55,650 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:36:55,651 - root - INFO - Clearing user context 2025-12-04 14:36:58,967 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:36:58,968 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:36:58,968 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:36:58,968 - root - INFO - Clearing user context 2025-12-04 14:36:58,969 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:36:58,970 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:58,970 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:36:58,970 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:36:58,972 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:36:58,972 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:36:58,972 - root - INFO - Looking for user with username: admin 2025-12-04 14:36:58,973 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:36:58,973 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:36:58,974 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:36:58,981 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:36:58,982 - root - INFO - Clearing user context 2025-12-04 14:37:11,007 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:11,007 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:11,007 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:11,008 - root - INFO - Clearing user context 2025-12-04 14:37:11,009 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:11,009 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:11,009 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:11,009 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:11,011 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:11,011 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:11,011 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:11,013 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:11,013 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:11,013 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:11,020 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:11,021 - root - INFO - Clearing user context 2025-12-04 14:37:17,724 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:17,724 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:17,724 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:17,725 - root - INFO - Clearing user context 2025-12-04 14:37:17,726 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:17,726 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:17,726 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:17,727 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:17,728 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:17,729 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:17,729 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:17,731 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:17,732 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:17,732 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:17,748 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:17,749 - root - INFO - Clearing user context 2025-12-04 14:37:28,102 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:28,102 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:28,102 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:28,103 - root - INFO - Clearing user context 2025-12-04 14:37:28,104 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:28,104 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:28,104 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:28,104 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:28,106 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:28,106 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:28,106 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:28,107 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:28,107 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:28,107 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:28,114 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:28,114 - root - INFO - Clearing user context 2025-12-04 14:37:29,741 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:29,741 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:29,742 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:29,742 - root - INFO - Clearing user context 2025-12-04 14:37:29,743 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:29,743 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:29,743 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:29,744 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:29,745 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:29,746 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:29,746 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:29,747 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:29,747 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:29,747 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:29,754 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:29,755 - root - INFO - Clearing user context 2025-12-04 14:37:34,915 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:34,916 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:34,916 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:34,916 - root - INFO - Clearing user context 2025-12-04 14:37:34,917 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:34,918 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:34,918 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:34,918 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:34,919 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:34,920 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:34,920 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:34,921 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:34,921 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:34,921 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:34,936 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:34,937 - root - INFO - Clearing user context 2025-12-04 14:37:37,250 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:37,250 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:37,250 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:37,250 - root - INFO - Clearing user context 2025-12-04 14:37:37,252 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:37,252 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:37,252 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:37,253 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:37,254 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:37,254 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:37,255 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:37,256 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:37,256 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:37,256 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:37,263 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:37,264 - root - INFO - Clearing user context 2025-12-04 14:37:42,173 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:42,173 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:42,173 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:42,173 - root - INFO - Clearing user context 2025-12-04 14:37:42,175 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:42,175 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:42,175 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:42,175 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:42,176 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:42,177 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:42,177 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:42,178 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:42,178 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:42,178 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:42,195 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:42,197 - root - INFO - Clearing user context 2025-12-04 14:37:45,619 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:45,619 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:45,620 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:45,620 - root - INFO - Clearing user context 2025-12-04 14:37:45,621 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:45,621 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:45,622 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:45,622 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:45,623 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:45,624 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:45,624 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:45,625 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:45,625 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:45,625 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:45,641 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:45,642 - root - INFO - Clearing user context 2025-12-04 14:37:50,501 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/5 2025-12-04 14:37:50,501 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:50,501 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:50,502 - root - INFO - Clearing user context 2025-12-04 14:37:50,503 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:50,503 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:50,503 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:50,503 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:50,505 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:50,505 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:50,505 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:50,507 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:50,507 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:50,507 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:50,515 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 - 副本 by user admin 2025-12-04 14:37:50,516 - root - INFO - Clearing user context 2025-12-04 14:37:57,432 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:37:57,433 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:57,433 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:37:57,433 - root - INFO - Clearing user context 2025-12-04 14:37:57,434 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:57,434 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,434 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:57,435 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:57,436 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:57,436 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:57,436 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:57,437 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:57,437 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,437 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:57,442 - root - INFO - Clearing user context 2025-12-04 14:37:57,451 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:37:57,452 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:57,452 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:37:57,452 - root - INFO - Clearing user context 2025-12-04 14:37:57,453 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:57,453 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,453 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:57,454 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:57,455 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:57,455 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:57,455 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:57,456 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:57,456 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,456 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:57,458 - root - INFO - Clearing user context 2025-12-04 14:37:57,467 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/5 2025-12-04 14:37:57,467 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:37:57,468 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/5 2025-12-04 14:37:57,468 - root - INFO - Clearing user context 2025-12-04 14:37:57,469 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:37:57,469 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,470 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:37:57,470 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:37:57,472 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:37:57,472 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:37:57,472 - root - INFO - Looking for user with username: admin 2025-12-04 14:37:57,474 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:37:57,474 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:37:57,474 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:37:57,477 - root - INFO - Clearing user context 2025-12-04 14:38:00,991 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:38:00,991 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:00,991 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:38:00,992 - root - INFO - Clearing user context 2025-12-04 14:38:00,993 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:00,994 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:00,994 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:00,994 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:00,996 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:00,996 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:00,997 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:00,998 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:00,999 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:00,999 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:01,009 - root - INFO - Clearing user context 2025-12-04 14:38:03,751 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:38:03,751 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:03,752 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:38:03,752 - root - INFO - Clearing user context 2025-12-04 14:38:03,753 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:03,753 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,754 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:03,754 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:03,755 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:03,756 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:03,757 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:03,758 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:03,759 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,759 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:03,766 - root - INFO - Clearing user context 2025-12-04 14:38:03,774 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:38:03,774 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:03,774 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:38:03,775 - root - INFO - Clearing user context 2025-12-04 14:38:03,776 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:03,776 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,777 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:03,777 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:03,778 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:03,779 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:03,779 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:03,782 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:03,782 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,782 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:03,786 - root - INFO - Clearing user context 2025-12-04 14:38:03,793 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:38:03,794 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:03,794 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:38:03,794 - root - INFO - Clearing user context 2025-12-04 14:38:03,796 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:03,796 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,796 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:03,796 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:03,798 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:03,799 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:03,799 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:03,801 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:03,801 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:03,802 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:03,804 - root - INFO - Clearing user context 2025-12-04 14:38:05,861 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:38:05,861 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:05,861 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:38:05,862 - root - INFO - Clearing user context 2025-12-04 14:38:05,863 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:05,863 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:05,864 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:05,864 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:05,865 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:05,866 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:05,866 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:05,867 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:05,867 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:05,867 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:05,874 - root - INFO - Clearing user context 2025-12-04 14:38:07,092 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:38:07,093 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:07,093 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:38:07,093 - root - INFO - Clearing user context 2025-12-04 14:38:07,096 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:07,096 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,096 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:07,096 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:07,098 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:07,098 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:07,099 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:07,100 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:07,100 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,100 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:07,108 - root - INFO - Clearing user context 2025-12-04 14:38:07,118 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:38:07,118 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:07,118 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:38:07,118 - root - INFO - Clearing user context 2025-12-04 14:38:07,120 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:07,120 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,120 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:07,120 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:07,122 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:07,122 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:07,122 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:07,123 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:07,124 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,124 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:07,126 - root - INFO - Clearing user context 2025-12-04 14:38:07,135 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:38:07,136 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:07,136 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:07,136 - root - INFO - Clearing user context 2025-12-04 14:38:07,138 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:07,138 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,139 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:07,139 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:07,140 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:07,140 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:07,140 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:07,142 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:07,142 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:07,142 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:07,144 - root - INFO - Clearing user context 2025-12-04 14:38:10,314 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:38:10,314 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:10,314 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:10,315 - root - INFO - Clearing user context 2025-12-04 14:38:10,316 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:10,317 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:10,317 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:10,317 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:10,319 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:10,319 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:10,320 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:10,321 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:10,321 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:10,321 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:10,329 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:38:10,330 - root - INFO - Clearing user context 2025-12-04 14:38:11,872 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:38:11,872 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:11,872 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:11,872 - root - INFO - Clearing user context 2025-12-04 14:38:11,874 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:11,874 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:11,874 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:11,874 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:11,876 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:11,876 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:11,877 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:11,878 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:11,878 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:11,878 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:11,885 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:38:11,886 - root - INFO - Clearing user context 2025-12-04 14:38:18,109 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:38:18,110 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:18,110 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:18,110 - root - INFO - Clearing user context 2025-12-04 14:38:18,111 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:18,112 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:18,112 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:18,112 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:18,114 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:18,114 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:18,114 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:18,115 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:18,115 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:18,116 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:18,123 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:38:18,124 - root - INFO - Clearing user context 2025-12-04 14:38:20,386 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:38:20,386 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:20,386 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:20,386 - root - INFO - Clearing user context 2025-12-04 14:38:20,388 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:20,388 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:20,388 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:20,388 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:20,390 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:20,390 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:20,390 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:20,391 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:20,391 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:20,392 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:20,408 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:38:20,409 - root - INFO - Clearing user context 2025-12-04 14:38:26,002 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:38:26,003 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:38:26,003 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:38:26,003 - root - INFO - Clearing user context 2025-12-04 14:38:26,005 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:38:26,005 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:26,005 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:38:26,005 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:38:26,007 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:38:26,007 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:38:26,007 - root - INFO - Looking for user with username: admin 2025-12-04 14:38:26,009 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:38:26,009 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:38:26,009 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:38:26,026 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:38:26,027 - root - INFO - Clearing user context 2025-12-04 14:39:19,598 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:19,599 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:19,599 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:19,599 - root - INFO - Clearing user context 2025-12-04 14:39:19,600 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:19,601 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:19,601 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:19,601 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:19,603 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:19,604 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:19,604 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:19,605 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:19,605 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:19,606 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:19,617 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:19,619 - root - INFO - Clearing user context 2025-12-04 14:39:24,135 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:24,136 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:24,136 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:24,136 - root - INFO - Clearing user context 2025-12-04 14:39:24,138 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:24,138 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:24,138 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:24,139 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:24,140 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:24,141 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:24,141 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:24,143 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:24,143 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:24,143 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:24,152 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:24,154 - root - INFO - Clearing user context 2025-12-04 14:39:26,208 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:26,208 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:26,209 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:26,209 - root - INFO - Clearing user context 2025-12-04 14:39:26,210 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:26,210 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:26,211 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:26,211 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:26,213 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:26,213 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:26,213 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:26,215 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:26,215 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:26,215 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:26,223 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:26,224 - root - INFO - Clearing user context 2025-12-04 14:39:28,072 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:28,072 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:28,073 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:28,073 - root - INFO - Clearing user context 2025-12-04 14:39:28,074 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:28,075 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:28,075 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:28,075 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:28,077 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:28,078 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:28,078 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:28,079 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:28,080 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:28,080 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:28,088 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:28,089 - root - INFO - Clearing user context 2025-12-04 14:39:31,310 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:31,311 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:31,311 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:31,311 - root - INFO - Clearing user context 2025-12-04 14:39:31,313 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:31,313 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:31,313 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:31,313 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:31,315 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:31,316 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:31,316 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:31,317 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:31,318 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:31,318 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:31,327 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:31,328 - root - INFO - Clearing user context 2025-12-04 14:39:35,917 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:35,917 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:35,918 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:35,918 - root - INFO - Clearing user context 2025-12-04 14:39:35,919 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:35,919 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:35,919 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:35,920 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:35,921 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:35,921 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:35,922 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:35,922 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:35,923 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:35,923 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:35,929 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:35,930 - root - INFO - Clearing user context 2025-12-04 14:39:37,771 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:39:37,771 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:37,771 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:37,771 - root - INFO - Clearing user context 2025-12-04 14:39:37,773 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:37,773 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:37,773 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:37,773 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:37,774 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:37,775 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:37,775 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:37,776 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:37,776 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:37,776 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:37,782 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:39:37,783 - root - INFO - Clearing user context 2025-12-04 14:39:40,220 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:40,220 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:40,221 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:40,221 - root - INFO - Clearing user context 2025-12-04 14:39:40,222 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:40,222 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:40,223 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:40,223 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:40,224 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:40,225 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:40,225 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:40,226 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:40,226 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:40,226 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:40,233 - root - INFO - Clearing user context 2025-12-04 14:39:41,144 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:41,144 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:41,144 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:41,145 - root - INFO - Clearing user context 2025-12-04 14:39:41,146 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:41,147 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,147 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:41,147 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:41,149 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:41,149 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:41,150 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:41,151 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:41,151 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,152 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:41,156 - root - INFO - Clearing user context 2025-12-04 14:39:41,165 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:39:41,165 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:41,166 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:39:41,166 - root - INFO - Clearing user context 2025-12-04 14:39:41,168 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:41,169 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,169 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:41,169 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:41,171 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:41,171 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:41,171 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:41,172 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:41,173 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,173 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:41,175 - root - INFO - Clearing user context 2025-12-04 14:39:41,184 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:39:41,184 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:41,185 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:39:41,185 - root - INFO - Clearing user context 2025-12-04 14:39:41,187 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:41,187 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,187 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:41,187 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:41,189 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:41,189 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:41,189 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:41,191 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:41,191 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:41,192 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:41,194 - root - INFO - Clearing user context 2025-12-04 14:39:45,242 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:39:45,242 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:45,243 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:39:45,243 - root - INFO - Clearing user context 2025-12-04 14:39:45,244 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:45,244 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:45,244 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:45,245 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:45,246 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:45,246 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:45,246 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:45,247 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:45,248 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:45,248 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:45,262 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:39:45,263 - root - INFO - Clearing user context 2025-12-04 14:39:45,854 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:45,855 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:45,855 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:45,855 - root - INFO - Clearing user context 2025-12-04 14:39:45,856 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:45,857 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:45,857 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:45,857 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:45,859 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:45,859 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:45,859 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:45,860 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:45,860 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:45,861 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:45,867 - root - INFO - Clearing user context 2025-12-04 14:39:46,893 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:46,894 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:46,894 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:46,894 - root - INFO - Clearing user context 2025-12-04 14:39:46,896 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:46,896 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,896 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:46,896 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:46,898 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:46,899 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:46,900 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:46,902 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:46,903 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,903 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:46,913 - root - INFO - Clearing user context 2025-12-04 14:39:46,926 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:39:46,926 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:46,926 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:39:46,926 - root - INFO - Clearing user context 2025-12-04 14:39:46,928 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:46,928 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,928 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:46,928 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:46,930 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:46,931 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:46,931 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:46,932 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:46,933 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,933 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:46,938 - root - INFO - Clearing user context 2025-12-04 14:39:46,948 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:39:46,948 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:46,949 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:39:46,949 - root - INFO - Clearing user context 2025-12-04 14:39:46,952 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:46,952 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,953 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:46,953 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:46,955 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:46,956 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:46,956 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:46,958 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:46,958 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:46,959 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:46,961 - root - INFO - Clearing user context 2025-12-04 14:39:48,856 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:48,856 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:48,856 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:48,857 - root - INFO - Clearing user context 2025-12-04 14:39:48,858 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:48,858 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:48,859 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:48,859 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:48,860 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:48,860 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:48,861 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:48,862 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:48,862 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:48,862 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:48,868 - root - INFO - Clearing user context 2025-12-04 14:39:49,685 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:39:49,685 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:49,685 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:39:49,685 - root - INFO - Clearing user context 2025-12-04 14:39:49,687 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:49,687 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,687 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:49,688 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:49,689 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:49,689 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:49,689 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:49,690 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:49,691 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,691 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:49,699 - root - INFO - Clearing user context 2025-12-04 14:39:49,711 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:39:49,711 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:49,711 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:39:49,712 - root - INFO - Clearing user context 2025-12-04 14:39:49,713 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:49,713 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,714 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:49,714 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:49,715 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:49,716 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:49,716 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:49,718 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:49,719 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,719 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:49,723 - root - INFO - Clearing user context 2025-12-04 14:39:49,732 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/4 2025-12-04 14:39:49,732 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:49,733 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:39:49,733 - root - INFO - Clearing user context 2025-12-04 14:39:49,735 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:49,736 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,736 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:49,736 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:49,738 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:49,738 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:49,739 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:49,740 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:49,741 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:49,741 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:49,743 - root - INFO - Clearing user context 2025-12-04 14:39:54,932 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:39:54,932 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:39:54,933 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:39:54,933 - root - INFO - Clearing user context 2025-12-04 14:39:54,935 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:39:54,936 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:54,936 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:39:54,936 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:39:54,938 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:39:54,939 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:39:54,939 - root - INFO - Looking for user with username: admin 2025-12-04 14:39:54,940 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:39:54,941 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:39:54,941 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:39:54,947 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:39:54,948 - root - INFO - Clearing user context 2025-12-04 14:40:03,539 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:40:03,539 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:03,540 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:40:03,540 - root - INFO - Clearing user context 2025-12-04 14:40:03,541 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:03,541 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:03,542 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:03,542 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:03,543 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:03,544 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:03,544 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:03,545 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:03,545 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:03,545 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:03,553 - th_agenter.workflow_api - INFO - Updated workflow: qw - 副本 by user admin 2025-12-04 14:40:03,554 - root - INFO - Clearing user context 2025-12-04 14:40:11,962 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:40:11,963 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:11,963 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:40:11,963 - root - INFO - Clearing user context 2025-12-04 14:40:11,964 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:11,965 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:11,965 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:11,965 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:11,967 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:11,967 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:11,967 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:11,968 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:11,968 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:11,968 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:11,970 - root - ERROR - Database session error: [{'type': 'string_too_short', 'loc': ('body', 'definition', 'nodes', 1, 'parameters', 'outputs', 0, 'name'), 'msg': 'String should have at least 1 character', 'input': '', 'ctx': {'min_length': 1}}] 2025-12-04 14:40:11,971 - root - INFO - Clearing user context 2025-12-04 14:40:17,596 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:40:17,597 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:17,597 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:40:17,597 - root - INFO - Clearing user context 2025-12-04 14:40:17,598 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:17,599 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:17,599 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:17,599 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:17,601 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:17,601 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:17,601 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:17,602 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:17,602 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:17,603 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:17,604 - root - ERROR - Database session error: [{'type': 'string_too_short', 'loc': ('body', 'definition', 'nodes', 1, 'parameters', 'outputs', 0, 'name'), 'msg': 'String should have at least 1 character', 'input': '', 'ctx': {'min_length': 1}}] 2025-12-04 14:40:17,604 - root - INFO - Clearing user context 2025-12-04 14:40:20,249 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:40:20,249 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:20,250 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:40:20,250 - root - INFO - Clearing user context 2025-12-04 14:40:20,251 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:20,251 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:20,251 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:20,252 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:20,253 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:20,253 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:20,254 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:20,255 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:20,255 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:20,255 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:20,256 - root - ERROR - Database session error: [{'type': 'string_too_short', 'loc': ('body', 'definition', 'nodes', 1, 'parameters', 'outputs', 0, 'name'), 'msg': 'String should have at least 1 character', 'input': '', 'ctx': {'min_length': 1}}] 2025-12-04 14:40:20,256 - root - INFO - Clearing user context 2025-12-04 14:40:23,533 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/4 2025-12-04 14:40:23,533 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:23,533 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/4 2025-12-04 14:40:23,533 - root - INFO - Clearing user context 2025-12-04 14:40:23,535 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:23,544 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:23,545 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:23,545 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:23,547 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:23,547 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:23,547 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:23,548 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:23,549 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:23,549 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:23,550 - root - ERROR - Database session error: [{'type': 'string_too_short', 'loc': ('body', 'definition', 'nodes', 1, 'parameters', 'outputs', 0, 'name'), 'msg': 'String should have at least 1 character', 'input': '', 'ctx': {'min_length': 1}}] 2025-12-04 14:40:23,551 - root - INFO - Clearing user context 2025-12-04 14:40:24,440 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:40:24,440 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:24,440 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:40:24,441 - root - INFO - Clearing user context 2025-12-04 14:40:24,442 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:24,443 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:24,443 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:24,443 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:24,444 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:24,445 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:24,445 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:24,446 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:24,447 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:24,447 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:24,456 - root - INFO - Clearing user context 2025-12-04 14:40:25,392 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-04 14:40:25,392 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:25,393 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-04 14:40:25,393 - root - INFO - Clearing user context 2025-12-04 14:40:25,394 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:25,395 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,395 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:25,395 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:25,397 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:25,397 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:25,398 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:25,399 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:25,399 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,400 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:25,405 - root - INFO - Clearing user context 2025-12-04 14:40:25,415 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-04 14:40:25,416 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:25,416 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-04 14:40:25,416 - root - INFO - Clearing user context 2025-12-04 14:40:25,419 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:25,419 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,419 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:25,419 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:25,421 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:25,421 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:25,421 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:25,423 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:25,423 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,423 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:25,425 - root - INFO - Clearing user context 2025-12-04 14:40:25,436 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/3 2025-12-04 14:40:25,436 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:25,437 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:25,437 - root - INFO - Clearing user context 2025-12-04 14:40:25,439 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:25,439 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,440 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:25,440 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:25,441 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:25,441 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:25,442 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:25,443 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:25,443 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:25,443 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:25,445 - root - INFO - Clearing user context 2025-12-04 14:40:37,160 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:40:37,160 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:37,160 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:37,160 - root - INFO - Clearing user context 2025-12-04 14:40:37,162 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:37,162 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:37,162 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:37,163 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:37,164 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:37,164 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:37,165 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:37,166 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:37,166 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:37,166 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:37,167 - root - ERROR - Database session error: [{'type': 'string_too_short', 'loc': ('body', 'definition', 'nodes', 1, 'parameters', 'outputs', 0, 'name'), 'msg': 'String should have at least 1 character', 'input': '', 'ctx': {'min_length': 1}}] 2025-12-04 14:40:37,167 - root - INFO - Clearing user context 2025-12-04 14:40:40,585 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:40:40,586 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:40,586 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:40,586 - root - INFO - Clearing user context 2025-12-04 14:40:40,587 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:40,588 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:40,588 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:40,588 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:40,590 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:40,590 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:40,590 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:40,591 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:40,592 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:40,592 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:40,601 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:40:40,603 - root - INFO - Clearing user context 2025-12-04 14:40:45,309 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:40:45,309 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:45,310 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:45,310 - root - INFO - Clearing user context 2025-12-04 14:40:45,311 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:45,311 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:45,312 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:45,312 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:45,313 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:45,314 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:45,314 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:45,315 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:45,315 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:45,315 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:45,323 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:40:45,324 - root - INFO - Clearing user context 2025-12-04 14:40:51,648 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:40:51,648 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:51,649 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:51,649 - root - INFO - Clearing user context 2025-12-04 14:40:51,650 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:51,650 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:51,650 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:51,651 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:51,652 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:51,653 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:51,653 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:51,654 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:51,654 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:51,654 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:51,669 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:40:51,670 - root - INFO - Clearing user context 2025-12-04 14:40:57,629 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:40:57,629 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:40:57,630 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:40:57,630 - root - INFO - Clearing user context 2025-12-04 14:40:57,631 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:40:57,631 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:57,632 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:40:57,632 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:40:57,633 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:40:57,634 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:40:57,634 - root - INFO - Looking for user with username: admin 2025-12-04 14:40:57,635 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:40:57,635 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:40:57,635 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:40:57,651 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:40:57,652 - root - INFO - Clearing user context 2025-12-04 14:41:32,811 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:41:32,811 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:41:32,812 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:41:32,812 - root - INFO - Clearing user context 2025-12-04 14:41:32,813 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:41:32,813 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:41:32,814 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:41:32,814 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:41:32,815 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:41:32,816 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:41:32,816 - root - INFO - Looking for user with username: admin 2025-12-04 14:41:32,817 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:41:32,817 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:41:32,818 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:41:32,825 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:41:32,826 - root - INFO - Clearing user context 2025-12-04 14:41:35,305 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/workflows/3 2025-12-04 14:41:35,305 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-04 14:41:35,305 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/3 2025-12-04 14:41:35,306 - root - INFO - Clearing user context 2025-12-04 14:41:35,307 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-04 14:41:35,307 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:41:35,308 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-04 14:41:35,308 - root - INFO - Verified current user ID in context: 2 2025-12-04 14:41:35,309 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-04 14:41:35,310 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1764843655} 2025-12-04 14:41:35,310 - root - INFO - Looking for user with username: admin 2025-12-04 14:41:35,311 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-04 14:41:35,311 - root - INFO - Verification - ContextVar user: admin 2025-12-04 14:41:35,311 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-04 14:41:35,326 - th_agenter.workflow_api - INFO - Updated workflow: qw -eee233444 by user admin 2025-12-04 14:41:35,327 - root - INFO - Clearing user context 2025-12-04 14:42:15,152 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 14:05:36,099 - root - INFO - Logging configured successfully 2025-12-11 14:05:36,213 - root - INFO - Logging configured successfully 2025-12-11 14:05:36,411 - root - INFO - Starting up TH-Agenter application... 2025-12-11 14:05:36,421 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-11 14:05:36,615 - root - INFO - Database tables created 2025-12-11 14:05:36,615 - root - INFO - Database initialized 2025-12-11 14:09:44,478 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 15:30:24,555 - root - INFO - Logging configured successfully 2025-12-11 15:30:24,675 - root - INFO - Logging configured successfully 2025-12-11 15:30:24,868 - root - INFO - Starting up TH-Agenter application... 2025-12-11 15:30:24,872 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-11 15:30:26,628 - root - INFO - Database tables created 2025-12-11 15:30:26,629 - root - INFO - Database initialized 2025-12-11 15:31:28,282 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 15:33:53,870 - root - INFO - Logging configured successfully 2025-12-11 15:33:53,998 - root - INFO - Logging configured successfully 2025-12-11 15:33:54,161 - root - INFO - Starting up TH-Agenter application... 2025-12-11 15:33:54,165 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-11 15:33:54,241 - root - INFO - Database tables created 2025-12-11 15:33:54,241 - root - INFO - Database initialized 2025-12-11 15:35:49,747 - root - INFO - [MIDDLEWARE] Processing request: GET / 2025-12-11 15:35:49,750 - root - INFO - [MIDDLEWARE] Checking path: / against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:35:49,750 - root - INFO - [MIDDLEWARE] Processing authenticated request: / 2025-12-11 15:35:49,751 - root - INFO - Clearing user context 2025-12-11 15:35:50,605 - root - INFO - [MIDDLEWARE] Processing request: GET / 2025-12-11 15:35:50,606 - root - INFO - [MIDDLEWARE] Checking path: / against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:35:50,606 - root - INFO - [MIDDLEWARE] Processing authenticated request: / 2025-12-11 15:35:50,606 - root - INFO - Clearing user context 2025-12-11 15:35:50,705 - root - INFO - [MIDDLEWARE] Processing request: GET /favicon.ico 2025-12-11 15:35:50,705 - root - INFO - [MIDDLEWARE] Checking path: /favicon.ico against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:35:50,706 - root - INFO - [MIDDLEWARE] Processing authenticated request: /favicon.ico 2025-12-11 15:35:50,706 - root - INFO - Clearing user context 2025-12-11 15:36:00,528 - root - INFO - [MIDDLEWARE] Processing request: GET / 2025-12-11 15:36:00,529 - root - INFO - [MIDDLEWARE] Checking path: / against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:36:00,529 - root - INFO - [MIDDLEWARE] Processing authenticated request: / 2025-12-11 15:36:00,529 - root - INFO - Clearing user context 2025-12-11 15:36:00,577 - root - INFO - [MIDDLEWARE] Processing request: GET /favicon.ico 2025-12-11 15:36:00,578 - root - INFO - [MIDDLEWARE] Checking path: /favicon.ico against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:36:00,578 - root - INFO - [MIDDLEWARE] Processing authenticated request: /favicon.ico 2025-12-11 15:36:00,579 - root - INFO - Clearing user context 2025-12-11 15:36:42,044 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 15:39:58,050 - root - INFO - Logging configured successfully 2025-12-11 15:39:58,144 - root - INFO - Logging configured successfully 2025-12-11 15:39:58,291 - root - INFO - Starting up TH-Agenter application... 2025-12-11 15:39:58,293 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-11 15:39:58,371 - root - INFO - Database tables created 2025-12-11 15:39:58,371 - root - INFO - Database initialized 2025-12-11 15:40:05,444 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 15:40:31,921 - root - INFO - Logging configured successfully 2025-12-11 15:40:32,027 - root - INFO - Logging configured successfully 2025-12-11 15:40:32,115 - root - INFO - Starting up TH-Agenter application... 2025-12-11 15:40:32,119 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-11 15:40:32,203 - root - INFO - Database tables created 2025-12-11 15:40:32,204 - root - INFO - Database initialized 2025-12-11 15:40:54,397 - root - INFO - [MIDDLEWARE] Processing request: GET / 2025-12-11 15:40:54,398 - root - INFO - [MIDDLEWARE] Checking path: / against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:40:54,399 - root - INFO - [MIDDLEWARE] Processing authenticated request: / 2025-12-11 15:40:54,399 - root - INFO - Clearing user context 2025-12-11 15:40:54,488 - root - INFO - [MIDDLEWARE] Processing request: GET /favicon.ico 2025-12-11 15:40:54,488 - root - INFO - [MIDDLEWARE] Checking path: /favicon.ico against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-11 15:40:54,489 - root - INFO - [MIDDLEWARE] Processing authenticated request: /favicon.ico 2025-12-11 15:40:54,489 - root - INFO - Clearing user context 2025-12-11 15:45:36,847 - root - INFO - Shutting down TH-Agenter application... 2025-12-11 15:56:40,689 - root - INFO - Logging configured successfully 2025-12-11 15:56:40,791 - root - INFO - Logging configured successfully 2025-12-11 15:56:40,882 - root - INFO - Starting up TH-Agenter application... 2025-12-11 15:56:40,886 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-11 15:56:40,922 - root - INFO - Database tables created 2025-12-11 15:56:40,923 - root - INFO - Database initialized 2025-12-11 16:31:10,650 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 08:57:02,091 - root - INFO - Logging configured successfully 2025-12-12 08:57:02,270 - root - INFO - Logging configured successfully 2025-12-12 08:57:02,566 - root - INFO - Starting up TH-Agenter application... 2025-12-12 08:57:02,574 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-12 08:57:02,717 - root - INFO - Database tables created 2025-12-12 08:57:02,717 - root - INFO - Database initialized 2025-12-12 09:06:11,221 - root - INFO - Logging configured successfully 2025-12-12 09:06:11,365 - root - INFO - Logging configured successfully 2025-12-12 09:06:11,550 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:06:11,554 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-12 09:06:11,620 - root - INFO - Database tables created 2025-12-12 09:06:11,620 - root - INFO - Database initialized 2025-12-12 09:06:11,622 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:06:36,627 - root - INFO - Logging configured successfully 2025-12-12 09:06:36,815 - root - INFO - Logging configured successfully 2025-12-12 09:06:37,113 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:06:37,121 - root - INFO - PostgreSQL database engine created: postgresql://iagent:iagent@192.168.10.11:5432/iagent 2025-12-12 09:06:37,185 - root - INFO - Database tables created 2025-12-12 09:06:37,185 - root - INFO - Database initialized 2025-12-12 09:06:37,186 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:09:41,021 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:09:41,022 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:09:41,023 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:09:41,024 - root - INFO - Clearing user context 2025-12-12 09:09:41,030 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:09:41,031 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:09:41,032 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:09:41,032 - root - INFO - Clearing user context 2025-12-12 09:09:41,036 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:09:41,037 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:09:41,038 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:09:41,038 - root - INFO - Clearing user context 2025-12-12 09:09:41,043 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:09:41,043 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:09:41,044 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:09:41,044 - root - INFO - Clearing user context 2025-12-12 09:09:41,047 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:09:41,047 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:09:41,048 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:09:41,048 - root - INFO - Clearing user context 2025-12-12 09:10:53,183 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/register 2025-12-12 09:10:53,184 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/register against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:53,184 - root - INFO - [MIDDLEWARE] Path /api/auth/register exactly matches exclude_path /api/auth/register 2025-12-12 09:10:53,184 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/register 2025-12-12 09:10:53,541 - th_agenter.th_agenter.services.user - INFO - User created successfully: jcq 2025-12-12 09:10:57,862 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:10:57,862 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:57,863 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:10:57,864 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:10:58,514 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:10:58,515 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:58,516 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:10:58,516 - root - INFO - Clearing user context 2025-12-12 09:10:58,522 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:58,522 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:58,522 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:58,522 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:58,526 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:10:58,529 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:10:58,530 - root - INFO - Looking for user with username: jcq 2025-12-12 09:10:58,537 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:10:58,545 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:58,545 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:10:58,552 - root - INFO - Clearing user context 2025-12-12 09:10:58,777 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/1 2025-12-12 09:10:58,777 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/1 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:58,777 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/1 2025-12-12 09:10:58,778 - root - INFO - Clearing user context 2025-12-12 09:10:58,782 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:58,782 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:58,783 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:58,783 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:58,786 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:10:58,786 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:10:58,786 - root - INFO - Looking for user with username: jcq 2025-12-12 09:10:58,791 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:10:58,792 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:58,793 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:10:58,803 - root - INFO - Clearing user context 2025-12-12 09:10:59,280 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:10:59,282 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,283 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:10:59,284 - root - INFO - Clearing user context 2025-12-12 09:10:59,291 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,292 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,293 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,294 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,297 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:10:59,297 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,298 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:10:59,298 - root - INFO - Clearing user context 2025-12-12 09:10:59,304 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,307 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,307 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,308 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,324 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:10:59,325 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:10:59,326 - root - INFO - Clearing user context 2025-12-12 09:10:59,326 - root - INFO - Looking for user with username: jcq 2025-12-12 09:10:59,334 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:10:59,334 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:10:59,335 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,336 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,336 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:10:59,337 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:10:59,338 - root - INFO - Clearing user context 2025-12-12 09:10:59,362 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,367 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,368 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,368 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,383 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:10:59,386 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,387 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:10:59,387 - root - INFO - Clearing user context 2025-12-12 09:10:59,396 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,396 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,397 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,404 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,411 - root - INFO - Clearing user context 2025-12-12 09:10:59,430 - root - INFO - Clearing user context 2025-12-12 09:10:59,436 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:10:59,440 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,440 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:10:59,441 - root - INFO - Clearing user context 2025-12-12 09:10:59,446 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,446 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,446 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,446 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,449 - root - INFO - Clearing user context 2025-12-12 09:10:59,451 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:10:59,452 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,452 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:10:59,453 - root - INFO - Clearing user context 2025-12-12 09:10:59,460 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,460 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,460 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,460 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,464 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:10:59,465 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:10:59,465 - root - INFO - Looking for user with username: jcq 2025-12-12 09:10:59,472 - root - INFO - Clearing user context 2025-12-12 09:10:59,474 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:10:59,475 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,476 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:10:59,483 - root - INFO - Clearing user context 2025-12-12 09:10:59,762 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:10:59,763 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:10:59,764 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:10:59,764 - root - INFO - Clearing user context 2025-12-12 09:10:59,768 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:10:59,768 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:10:59,769 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:10:59,770 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:10:59,776 - root - INFO - Clearing user context 2025-12-12 09:11:00,094 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:11:00,098 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:00,099 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:11:00,099 - root - INFO - Clearing user context 2025-12-12 09:11:00,107 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:00,124 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:00,126 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:00,127 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:00,138 - root - INFO - Clearing user context 2025-12-12 09:11:01,589 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:11:01,590 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:01,590 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:11:01,591 - root - INFO - Clearing user context 2025-12-12 09:11:01,596 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:01,597 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:01,597 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:01,598 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:01,601 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:11:01,602 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:11:01,603 - root - INFO - Looking for user with username: jcq 2025-12-12 09:11:01,608 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:11:01,610 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:01,610 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:11:01,615 - root - INFO - Clearing user context 2025-12-12 09:11:06,676 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/ 2025-12-12 09:11:06,676 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:06,677 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:11:06,677 - root - INFO - Clearing user context 2025-12-12 09:11:06,681 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:06,681 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:06,682 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:06,682 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:06,685 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:11:06,685 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:11:06,686 - root - INFO - Looking for user with username: jcq 2025-12-12 09:11:06,689 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:11:06,690 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:06,690 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:11:06,736 - th_agenter.services.knowledge_base - INFO - Created knowledge base: 1 (ID: 1) 2025-12-12 09:11:06,738 - root - INFO - Clearing user context 2025-12-12 09:11:24,013 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:11:24,013 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:24,014 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:11:24,014 - root - INFO - Clearing user context 2025-12-12 09:11:24,019 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:24,020 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:24,021 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:24,022 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:24,028 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:11:24,030 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:11:24,032 - root - INFO - Looking for user with username: jcq 2025-12-12 09:11:24,038 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:11:24,039 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:24,039 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:11:24,063 - root - INFO - Clearing user context 2025-12-12 09:11:32,728 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/1/documents 2025-12-12 09:11:32,729 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:32,730 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:11:32,731 - root - INFO - Clearing user context 2025-12-12 09:11:32,738 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:32,738 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:32,738 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:32,739 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:32,745 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:11:32,746 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:11:32,747 - root - INFO - Looking for user with username: jcq 2025-12-12 09:11:32,752 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:11:32,753 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:32,753 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:11:32,987 - th_agenter.services.document - INFO - Uploaded document: 高速公路低空算法验证方案.docx to KB 1 (Doc ID: 1) 2025-12-12 09:11:33,089 - th_agenter.llm_config_service - WARNING - 未找到默认嵌入模型配置 2025-12-12 09:11:33,090 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 09:11:33,346 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 09:11:33,348 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 09:11:33,355 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 1, 路径: e:\Work\HXF\backend\data\uploads\kb_1\4e71f1b4-df3c-4ad4-b839-e8af49c00c76_高速公路低空算法验证方案.docx 2025-12-12 09:11:33,358 - th_agenter.services.document_processor - ERROR - 加载文档失败 e:\Work\HXF\backend\data\uploads\kb_1\4e71f1b4-df3c-4ad4-b839-e8af49c00c76_高速公路低空算法验证方案.docx: No module named 'docx2txt' 2025-12-12 09:11:33,358 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 1: No module named 'docx2txt' 2025-12-12 09:11:33,372 - root - INFO - Clearing user context 2025-12-12 09:11:35,387 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:11:35,388 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:11:35,388 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:11:35,389 - root - INFO - Clearing user context 2025-12-12 09:11:35,395 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:11:35,396 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:35,396 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:11:35,397 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:11:35,401 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:11:35,402 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765519858} 2025-12-12 09:11:35,402 - root - INFO - Looking for user with username: jcq 2025-12-12 09:11:35,408 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:11:35,408 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:11:35,408 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:11:35,420 - root - INFO - Clearing user context 2025-12-12 09:12:00,168 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/1/search 2025-12-12 09:12:00,169 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:12:00,169 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/search 2025-12-12 09:12:00,170 - root - INFO - Clearing user context 2025-12-12 09:12:00,176 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:12:00,176 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:12:00,177 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:12:00,177 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:12:00,179 - root - INFO - Clearing user context 2025-12-12 09:15:45,155 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:15:45,155 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:15:45,156 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:15:45,156 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:15:45,163 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:15:48,798 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:15:48,798 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:15:48,798 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:15:48,799 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:15:48,807 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:16:10,910 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:16:10,910 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:16:10,910 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:16:10,911 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:16:10,916 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:17:02,248 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:17:02,248 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:02,249 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:17:02,249 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:17:02,930 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:17:02,932 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:02,932 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:17:02,933 - root - INFO - Clearing user context 2025-12-12 09:17:02,939 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:02,953 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:02,954 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:02,960 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:02,964 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:02,965 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:02,965 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:02,971 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:02,971 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:02,971 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:02,977 - root - INFO - Clearing user context 2025-12-12 09:17:03,192 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/1 2025-12-12 09:17:03,193 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/1 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,193 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/1 2025-12-12 09:17:03,193 - root - INFO - Clearing user context 2025-12-12 09:17:03,196 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,197 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,197 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,197 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,199 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:03,199 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:03,199 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:03,202 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:03,202 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,202 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:03,207 - root - INFO - Clearing user context 2025-12-12 09:17:03,303 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:17:03,304 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,304 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:17:03,305 - root - INFO - Clearing user context 2025-12-12 09:17:03,310 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,310 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,310 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,311 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,314 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:03,315 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:03,315 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:03,321 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:03,321 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,321 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:03,333 - root - INFO - Clearing user context 2025-12-12 09:17:03,570 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:17:03,570 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,571 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:17:03,571 - root - INFO - Clearing user context 2025-12-12 09:17:03,576 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,576 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,577 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,577 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,579 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:17:03,581 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,581 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:17:03,582 - root - INFO - Clearing user context 2025-12-12 09:17:03,589 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,589 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,590 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,590 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,610 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:03,612 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:03,613 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:03,611 - root - INFO - Clearing user context 2025-12-12 09:17:03,619 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:03,622 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,622 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:03,635 - root - INFO - Clearing user context 2025-12-12 09:17:03,641 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:17:03,643 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,645 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:17:03,646 - root - INFO - Clearing user context 2025-12-12 09:17:03,659 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,669 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,671 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,672 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,686 - root - INFO - Clearing user context 2025-12-12 09:17:03,933 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:17:03,934 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,935 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:17:03,935 - root - INFO - Clearing user context 2025-12-12 09:17:03,941 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,941 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,941 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,941 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,943 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:17:03,944 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:03,944 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:17:03,944 - root - INFO - Clearing user context 2025-12-12 09:17:03,948 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:03,950 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:03,951 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:03,951 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:03,962 - root - INFO - Clearing user context 2025-12-12 09:17:03,963 - root - INFO - Clearing user context 2025-12-12 09:17:04,011 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:17:04,014 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:04,015 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:17:04,015 - root - INFO - Clearing user context 2025-12-12 09:17:04,021 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:04,025 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:04,025 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:04,026 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:04,037 - root - INFO - Clearing user context 2025-12-12 09:17:04,272 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:17:04,273 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:04,273 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:17:04,273 - root - INFO - Clearing user context 2025-12-12 09:17:04,278 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:04,278 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:04,278 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:04,278 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:04,286 - root - INFO - Clearing user context 2025-12-12 09:17:06,349 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:17:06,349 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:06,349 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:17:06,349 - root - INFO - Clearing user context 2025-12-12 09:17:06,355 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:06,355 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:06,355 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:06,356 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:06,358 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:06,359 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:06,360 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:06,366 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:06,369 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:06,369 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:06,382 - root - INFO - Clearing user context 2025-12-12 09:17:08,772 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:17:08,773 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:08,773 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:17:08,774 - root - INFO - Clearing user context 2025-12-12 09:17:08,779 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:08,780 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:08,780 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:08,780 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:08,786 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:08,787 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:08,788 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:08,800 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:08,801 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:08,801 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:08,812 - root - INFO - Clearing user context 2025-12-12 09:17:24,440 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/ 2025-12-12 09:17:24,440 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:24,441 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:17:24,441 - root - INFO - Clearing user context 2025-12-12 09:17:24,445 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:24,445 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:24,445 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:24,446 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:24,449 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:24,449 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:24,450 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:24,453 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:24,454 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:24,455 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:24,495 - th_agenter.services.knowledge_base - INFO - Created knowledge base: test (ID: 2) 2025-12-12 09:17:24,498 - root - INFO - Clearing user context 2025-12-12 09:17:27,279 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:17:27,280 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:27,280 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:17:27,280 - root - INFO - Clearing user context 2025-12-12 09:17:27,285 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:27,286 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:27,286 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:27,286 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:27,288 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:27,289 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:27,289 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:27,294 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:27,295 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:27,295 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:27,312 - root - INFO - Clearing user context 2025-12-12 09:17:43,272 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:17:43,273 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:43,273 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:17:43,274 - root - INFO - Clearing user context 2025-12-12 09:17:43,279 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:43,280 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:43,281 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:43,281 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:43,284 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:43,285 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:43,285 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:43,290 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:43,291 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:43,291 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:43,301 - root - INFO - Clearing user context 2025-12-12 09:17:52,306 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/2/documents 2025-12-12 09:17:52,314 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:52,315 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:17:52,315 - root - INFO - Clearing user context 2025-12-12 09:17:52,320 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:52,322 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:52,323 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:52,323 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:52,391 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:52,392 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:52,392 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:52,397 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:52,398 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:52,399 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:52,445 - th_agenter.services.document - INFO - Uploaded document: 陕西算法分析统计1023.docx to KB 2 (Doc ID: 2) 2025-12-12 09:17:52,453 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 2, 路径: e:\Work\HXF\backend\data\uploads\kb_2\758a9e60-82a4-4099-818a-186aa0440db6_陕西算法分析统计1023.docx 2025-12-12 09:17:52,455 - th_agenter.services.document_processor - ERROR - 加载文档失败 e:\Work\HXF\backend\data\uploads\kb_2\758a9e60-82a4-4099-818a-186aa0440db6_陕西算法分析统计1023.docx: No module named 'docx2txt' 2025-12-12 09:17:52,455 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 2: No module named 'docx2txt' 2025-12-12 09:17:52,469 - root - INFO - Clearing user context 2025-12-12 09:17:54,483 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:17:54,483 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:17:54,483 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:17:54,483 - root - INFO - Clearing user context 2025-12-12 09:17:54,488 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:17:54,488 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:54,488 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:17:54,488 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:17:54,491 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:17:54,491 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:17:54,491 - root - INFO - Looking for user with username: jcq 2025-12-12 09:17:54,495 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:17:54,500 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:17:54,503 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:17:54,530 - root - INFO - Clearing user context 2025-12-12 09:18:11,960 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-12 09:18:11,961 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:11,961 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-12 09:18:11,962 - root - INFO - Clearing user context 2025-12-12 09:18:11,968 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:11,969 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:11,969 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:11,970 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:11,973 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:11,973 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:11,973 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:11,978 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:11,978 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:11,979 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:11,996 - root - INFO - Clearing user context 2025-12-12 09:18:12,233 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:18:12,235 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:12,238 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:18:12,239 - root - INFO - Clearing user context 2025-12-12 09:18:12,250 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:12,251 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,251 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:12,251 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:12,255 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:12,256 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:12,257 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:12,263 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:12,264 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,264 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:12,268 - root - INFO - Clearing user context 2025-12-12 09:18:12,275 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/1 2025-12-12 09:18:12,276 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/1 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:12,276 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/1 2025-12-12 09:18:12,277 - root - INFO - Clearing user context 2025-12-12 09:18:12,281 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:12,282 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,282 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:12,283 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:12,287 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:12,288 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:12,289 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:12,294 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:12,295 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,296 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:12,302 - root - INFO - Clearing user context 2025-12-12 09:18:12,689 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:18:12,689 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:12,690 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:18:12,690 - root - INFO - Clearing user context 2025-12-12 09:18:12,696 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:12,707 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,707 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:12,707 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:12,709 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:18:12,710 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:12,711 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:18:12,712 - root - INFO - Clearing user context 2025-12-12 09:18:12,719 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:12,720 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,722 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:12,725 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:12,730 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:12,733 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:12,734 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:12,738 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:12,740 - root - INFO - Clearing user context 2025-12-12 09:18:12,741 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,741 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:12,759 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:18:12,760 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:12,761 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:18:12,762 - root - INFO - Clearing user context 2025-12-12 09:18:12,768 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:12,774 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:12,774 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:12,774 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:12,779 - root - INFO - Clearing user context 2025-12-12 09:18:12,796 - root - INFO - Clearing user context 2025-12-12 09:18:20,234 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:18:20,235 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:20,235 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:18:20,236 - root - INFO - Clearing user context 2025-12-12 09:18:20,243 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:20,244 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:20,244 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:20,244 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:20,248 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:20,249 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:20,250 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:20,255 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:20,256 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:20,257 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:20,268 - root - INFO - Clearing user context 2025-12-12 09:18:22,221 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:18:22,222 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:22,222 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:18:22,223 - root - INFO - Clearing user context 2025-12-12 09:18:22,229 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:22,230 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:22,230 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:22,230 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:22,233 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:22,234 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:22,235 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:22,243 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:22,243 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:22,244 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:22,263 - root - INFO - Clearing user context 2025-12-12 09:18:23,154 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:18:23,154 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:23,154 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:18:23,155 - root - INFO - Clearing user context 2025-12-12 09:18:23,160 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:23,160 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:23,160 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:23,160 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:23,163 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:23,163 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:23,163 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:23,168 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:23,176 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:23,178 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:23,192 - root - INFO - Clearing user context 2025-12-12 09:18:35,789 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:18:35,789 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:35,789 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:18:35,789 - root - INFO - Clearing user context 2025-12-12 09:18:35,795 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:35,796 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:35,796 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:35,796 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:35,799 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:35,799 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:35,800 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:35,805 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:35,805 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:35,806 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:35,817 - root - INFO - Clearing user context 2025-12-12 09:18:55,049 - root - INFO - [MIDDLEWARE] Processing request: GET /api/workflows/ 2025-12-12 09:18:55,051 - root - INFO - [MIDDLEWARE] Checking path: /api/workflows/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:55,053 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/workflows/ 2025-12-12 09:18:55,054 - root - INFO - Clearing user context 2025-12-12 09:18:55,060 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:55,063 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:55,063 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:55,063 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:55,069 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:55,069 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:55,070 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:55,076 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:55,076 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:55,076 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:55,083 - root - INFO - Clearing user context 2025-12-12 09:18:58,165 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:18:58,165 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:58,166 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:18:58,166 - root - INFO - Clearing user context 2025-12-12 09:18:58,171 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:58,172 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,173 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:58,173 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:58,177 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:58,178 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:58,178 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:58,183 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:58,184 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,185 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:58,190 - root - INFO - Clearing user context 2025-12-12 09:18:58,198 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/1 2025-12-12 09:18:58,199 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/1 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:58,200 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/1 2025-12-12 09:18:58,200 - root - INFO - Clearing user context 2025-12-12 09:18:58,204 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:58,206 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,207 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:58,207 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:58,210 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:18:58,211 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:18:58,212 - root - INFO - Looking for user with username: jcq 2025-12-12 09:18:58,216 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:18:58,217 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,217 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:18:58,224 - root - INFO - Clearing user context 2025-12-12 09:18:58,609 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:18:58,609 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:58,610 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:18:58,610 - root - INFO - Clearing user context 2025-12-12 09:18:58,615 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:58,616 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,618 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:58,619 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:58,629 - root - INFO - Clearing user context 2025-12-12 09:18:58,639 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:18:58,639 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:18:58,640 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:18:58,640 - root - INFO - Clearing user context 2025-12-12 09:18:58,651 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:18:58,651 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:18:58,652 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:18:58,652 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:18:58,667 - root - INFO - Clearing user context 2025-12-12 09:19:02,259 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:19:02,260 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:02,260 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:19:02,261 - root - INFO - Clearing user context 2025-12-12 09:19:02,268 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:02,268 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:02,268 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:02,269 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:02,280 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:02,282 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:02,283 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:02,291 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:02,294 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:02,294 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:02,312 - root - INFO - Clearing user context 2025-12-12 09:19:05,060 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:19:05,061 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:05,061 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:19:05,062 - root - INFO - Clearing user context 2025-12-12 09:19:05,067 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:05,067 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:05,068 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:05,068 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:05,070 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:05,071 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:05,071 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:05,075 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:05,076 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:05,076 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:05,086 - root - INFO - Clearing user context 2025-12-12 09:19:32,732 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:19:32,733 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:32,733 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:19:32,734 - root - INFO - Clearing user context 2025-12-12 09:19:32,739 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:32,740 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:32,740 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:32,741 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:32,744 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:32,745 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:32,745 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:32,749 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:32,749 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:32,750 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:32,755 - root - INFO - Clearing user context 2025-12-12 09:19:32,763 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/1 2025-12-12 09:19:32,764 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/1 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:32,764 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/1 2025-12-12 09:19:32,765 - root - INFO - Clearing user context 2025-12-12 09:19:32,770 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:32,771 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:32,771 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:32,771 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:32,775 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:32,775 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:32,775 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:32,780 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:32,780 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:32,781 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:32,789 - root - INFO - Clearing user context 2025-12-12 09:19:33,046 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:19:33,047 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:33,047 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:19:33,047 - root - INFO - Clearing user context 2025-12-12 09:19:33,053 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:33,053 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:33,054 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:33,054 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:33,066 - root - INFO - Clearing user context 2025-12-12 09:19:33,076 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 09:19:33,076 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:33,077 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 09:19:33,078 - root - INFO - Clearing user context 2025-12-12 09:19:33,085 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:33,085 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:33,088 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:33,088 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:33,098 - root - INFO - Clearing user context 2025-12-12 09:19:43,326 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:19:43,326 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:43,327 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:19:43,327 - root - INFO - Clearing user context 2025-12-12 09:19:43,333 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:43,333 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:43,333 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:43,334 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:43,338 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:43,338 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:43,338 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:43,351 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:43,351 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:43,352 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:43,370 - root - INFO - Clearing user context 2025-12-12 09:19:53,123 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:19:53,124 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:19:53,124 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:19:53,124 - root - INFO - Clearing user context 2025-12-12 09:19:53,132 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:19:53,133 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:53,133 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:19:53,133 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:19:53,137 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:19:53,138 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:19:53,139 - root - INFO - Looking for user with username: jcq 2025-12-12 09:19:53,145 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:19:53,146 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:19:53,146 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:19:53,157 - root - INFO - Clearing user context 2025-12-12 09:22:48,126 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:22:48,126 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:22:48,127 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:22:48,127 - root - INFO - Clearing user context 2025-12-12 09:22:48,132 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:22:48,133 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:48,133 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:22:48,133 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:22:48,136 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:22:48,136 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:22:48,137 - root - INFO - Looking for user with username: jcq 2025-12-12 09:22:48,142 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:22:48,142 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:48,142 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:22:48,150 - root - INFO - Clearing user context 2025-12-12 09:22:48,494 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:22:48,494 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:22:48,495 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:22:48,495 - root - INFO - Clearing user context 2025-12-12 09:22:48,501 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:22:48,502 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:48,503 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:22:48,503 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:22:48,507 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:22:48,507 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:22:48,507 - root - INFO - Looking for user with username: jcq 2025-12-12 09:22:48,512 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:22:48,513 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:48,513 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:22:48,524 - root - INFO - Clearing user context 2025-12-12 09:22:53,061 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:22:53,061 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:22:53,062 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:22:53,062 - root - INFO - Clearing user context 2025-12-12 09:22:53,066 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:22:53,067 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:53,067 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:22:53,067 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:22:53,069 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:22:53,069 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:22:53,069 - root - INFO - Looking for user with username: jcq 2025-12-12 09:22:53,073 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:22:53,075 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:53,075 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:22:53,083 - root - INFO - Clearing user context 2025-12-12 09:22:58,805 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:22:58,806 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:22:58,806 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:22:58,806 - root - INFO - Clearing user context 2025-12-12 09:22:58,812 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:22:58,813 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:58,813 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:22:58,813 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:22:58,816 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:22:58,816 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:22:58,817 - root - INFO - Looking for user with username: jcq 2025-12-12 09:22:58,821 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:22:58,821 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:22:58,822 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:22:58,831 - root - INFO - Clearing user context 2025-12-12 09:23:00,832 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:23:00,833 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:23:00,833 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:23:00,833 - root - INFO - Clearing user context 2025-12-12 09:23:00,838 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:23:00,839 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:00,839 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:23:00,840 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:23:00,842 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:23:00,843 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:23:00,843 - root - INFO - Looking for user with username: jcq 2025-12-12 09:23:00,847 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:23:00,848 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:00,848 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:23:00,855 - root - INFO - Clearing user context 2025-12-12 09:23:05,525 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/1/documents 2025-12-12 09:23:05,526 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/1/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:23:05,526 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/1/documents 2025-12-12 09:23:05,526 - root - INFO - Clearing user context 2025-12-12 09:23:05,531 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:23:05,532 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:05,532 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:23:05,533 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:23:05,535 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:23:05,536 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:23:05,536 - root - INFO - Looking for user with username: jcq 2025-12-12 09:23:05,541 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:23:05,541 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:05,541 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:23:05,550 - root - INFO - Clearing user context 2025-12-12 09:23:13,823 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/2/documents 2025-12-12 09:23:13,824 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/2/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:23:13,825 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/2/documents 2025-12-12 09:23:13,825 - root - INFO - Clearing user context 2025-12-12 09:23:13,830 - root - INFO - Setting user in context with token: jcq (ID: 1) 2025-12-12 09:23:13,831 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:13,831 - root - INFO - User jcq (ID: 1) authenticated and set in context 2025-12-12 09:23:13,831 - root - INFO - Verified current user ID in context: 1 2025-12-12 09:23:13,834 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:23:13,834 - root - INFO - Token payload: {'sub': 'jcq', 'exp': 1765520222} 2025-12-12 09:23:13,835 - root - INFO - Looking for user with username: jcq 2025-12-12 09:23:13,839 - root - INFO - Setting user in context: jcq (ID: 1) 2025-12-12 09:23:13,839 - root - INFO - Verification - ContextVar user: jcq 2025-12-12 09:23:13,839 - root - INFO - User jcq (ID: 1) set in UserContext 2025-12-12 09:23:13,847 - root - INFO - Clearing user context 2025-12-12 09:25:45,370 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:26:29,905 - root - INFO - Logging configured successfully 2025-12-12 09:26:29,997 - root - INFO - Logging configured successfully 2025-12-12 09:26:30,153 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:26:30,163 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:26:30,172 - root - INFO - Database tables created 2025-12-12 09:26:30,173 - root - INFO - Database initialized 2025-12-12 09:27:36,728 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:27:36,729 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:27:36,729 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:27:36,729 - root - INFO - Clearing user context 2025-12-12 09:27:37,066 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:27:37,066 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:27:37,066 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:27:37,066 - root - INFO - Clearing user context 2025-12-12 09:27:37,388 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:27:37,389 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:27:37,389 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:27:37,390 - root - INFO - Clearing user context 2025-12-12 09:27:41,299 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:27:41,300 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:27:41,300 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:27:41,300 - root - INFO - Clearing user context 2025-12-12 09:28:01,605 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:28:01,605 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:28:01,605 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:28:01,606 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:28:01,611 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:28:22,819 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:28:22,823 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:28:22,824 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:28:22,824 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:28:22,838 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:28:26,965 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:28:26,966 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:28:26,967 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:28:26,967 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:28:26,969 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:28:56,642 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:28:56,643 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:28:56,644 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:28:56,644 - root - INFO - Clearing user context 2025-12-12 09:28:56,883 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:28:56,884 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:28:56,885 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:28:56,885 - root - INFO - Clearing user context 2025-12-12 09:29:04,402 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:29:28,454 - root - INFO - Logging configured successfully 2025-12-12 09:29:28,564 - root - INFO - Logging configured successfully 2025-12-12 09:29:28,717 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:29:28,724 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:29:28,728 - root - INFO - Database tables created 2025-12-12 09:29:28,729 - root - INFO - Database initialized 2025-12-12 09:29:54,224 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:54,225 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:54,226 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:54,226 - root - INFO - Clearing user context 2025-12-12 09:29:54,416 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:54,417 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:54,417 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:54,417 - root - INFO - Clearing user context 2025-12-12 09:29:57,771 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:57,773 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:57,773 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:57,773 - root - INFO - Clearing user context 2025-12-12 09:29:58,572 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:29:58,573 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,573 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:29:58,573 - root - INFO - Clearing user context 2025-12-12 09:29:58,606 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:29:58,607 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,607 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:29:58,608 - root - INFO - Clearing user context 2025-12-12 09:29:58,613 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:29:58,613 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,614 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:29:58,614 - root - INFO - Clearing user context 2025-12-12 09:29:58,618 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:58,619 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,620 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:58,620 - root - INFO - Clearing user context 2025-12-12 09:29:58,932 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 09:29:58,933 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,933 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 09:29:58,933 - root - INFO - Clearing user context 2025-12-12 09:29:58,939 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:58,943 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,944 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:58,944 - root - INFO - Clearing user context 2025-12-12 09:29:58,949 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 09:29:58,950 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:58,951 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 09:29:58,951 - root - INFO - Clearing user context 2025-12-12 09:29:59,262 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:59,262 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:59,262 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:59,263 - root - INFO - Clearing user context 2025-12-12 09:29:59,574 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:59,575 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:59,575 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:59,575 - root - INFO - Clearing user context 2025-12-12 09:29:59,837 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:59,838 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:59,838 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:59,838 - root - INFO - Clearing user context 2025-12-12 09:29:59,884 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:29:59,886 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:29:59,886 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:29:59,887 - root - INFO - Clearing user context 2025-12-12 09:30:00,146 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:30:00,147 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:30:00,147 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:30:00,148 - root - INFO - Clearing user context 2025-12-12 09:30:25,022 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:30:25,023 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:30:25,023 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:30:25,024 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:30:25,032 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:43:53,238 - root - INFO - Logging configured successfully 2025-12-12 09:43:53,424 - root - INFO - Logging configured successfully 2025-12-12 09:43:53,659 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:43:53,671 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:43:53,675 - root - INFO - Database tables created 2025-12-12 09:43:53,675 - root - INFO - Database initialized 2025-12-12 09:43:53,678 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:48:02,802 - root - INFO - Logging configured successfully 2025-12-12 09:48:02,905 - root - INFO - Logging configured successfully 2025-12-12 09:48:03,066 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:48:03,077 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:48:03,081 - root - INFO - Database tables created 2025-12-12 09:48:03,081 - root - INFO - Database initialized 2025-12-12 09:48:10,094 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:48:10,095 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:48:10,096 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:48:10,096 - root - INFO - Clearing user context 2025-12-12 09:48:10,096 - root - INFO - User context cleared before authentication 2025-12-12 09:48:10,097 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY3EiLCJleHAiOjE3NjU1MjAyMjJ9.G0HxiFxzlg5dAUGoofkmdVVcsdgRsT1qFujtFgkSQL4 2025-12-12 09:48:10,098 - root - ERROR - Token verification failed: Signature verification failed 2025-12-12 09:48:10,098 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:48:10,098 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-12 09:48:10,099 - root - ERROR - Algorithm: HS256 2025-12-12 09:48:49,208 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:48:49,209 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:48:49,209 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:48:49,210 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:48:49,265 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:49:14,911 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:49:26,634 - root - INFO - Logging configured successfully 2025-12-12 09:49:26,733 - root - INFO - Logging configured successfully 2025-12-12 09:49:26,884 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:49:26,891 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:49:26,895 - root - INFO - Database tables created 2025-12-12 09:49:26,896 - root - INFO - Database initialized 2025-12-12 09:51:53,099 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:52:04,300 - root - INFO - Logging configured successfully 2025-12-12 09:52:04,394 - root - INFO - Logging configured successfully 2025-12-12 09:52:04,529 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:52:04,537 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:52:04,541 - root - INFO - Database tables created 2025-12-12 09:52:04,541 - root - INFO - Database initialized 2025-12-12 09:52:29,981 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 09:52:29,982 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:52:29,982 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 09:52:29,983 - root - INFO - Clearing user context 2025-12-12 09:52:29,983 - root - INFO - User context cleared before authentication 2025-12-12 09:52:29,983 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY3EiLCJleHAiOjE3NjU1MjAyMjJ9.G0HxiFxzlg5dAUGoofkmdVVcsdgRsT1qFujtFgkSQL4 2025-12-12 09:52:29,984 - root - ERROR - Token verification failed: Signature verification failed 2025-12-12 09:52:29,984 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJqY... 2025-12-12 09:52:29,984 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-12 09:52:29,985 - root - ERROR - Algorithm: HS256 2025-12-12 09:53:27,751 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 09:53:27,751 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 09:53:27,752 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 09:53:27,752 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 09:53:27,801 - root - ERROR - Database session error: 401: Incorrect email or password 2025-12-12 09:53:47,637 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 09:55:35,342 - root - INFO - Logging configured successfully 2025-12-12 09:56:19,789 - root - INFO - Logging configured successfully 2025-12-12 09:56:19,888 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:56:19,889 - th_agenter.__main__ - INFO - Starting system data initialization... 2025-12-12 09:56:19,909 - th_agenter.__main__ - INFO - Roles initialization completed 2025-12-12 09:56:19,909 - th_agenter.__main__ - INFO - Starting admin user initialization... 2025-12-12 09:56:19,910 - th_agenter.__main__ - INFO - Admin user already exists 2025-12-12 09:56:19,911 - th_agenter.__main__ - INFO - System data initialization completed successfully 2025-12-12 09:57:49,369 - root - INFO - Logging configured successfully 2025-12-12 09:57:49,475 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:59:29,384 - root - INFO - Logging configured successfully 2025-12-12 09:59:29,514 - root - INFO - Logging configured successfully 2025-12-12 09:59:29,616 - root - INFO - Starting up TH-Agenter application... 2025-12-12 09:59:29,625 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 09:59:29,629 - root - INFO - Database tables created 2025-12-12 09:59:29,629 - root - INFO - Database initialized 2025-12-12 10:00:07,194 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-12 10:00:07,195 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:07,196 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-12 10:00:07,196 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-12 10:00:07,519 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:00:07,519 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:07,519 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:00:07,520 - root - INFO - Clearing user context 2025-12-12 10:00:07,520 - root - INFO - User context cleared before authentication 2025-12-12 10:00:07,520 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:07,522 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:07,522 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:07,522 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:07,522 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:07,523 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:07,523 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:07,523 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:07,524 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:07,524 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:07,525 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:07,529 - root - INFO - Clearing user context 2025-12-12 10:00:07,846 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:00:07,847 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:07,847 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:00:07,847 - root - INFO - Clearing user context 2025-12-12 10:00:07,847 - root - INFO - User context cleared before authentication 2025-12-12 10:00:07,847 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:07,848 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:07,848 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:07,849 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:07,849 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:07,850 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:07,850 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:07,850 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:07,851 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:07,851 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:07,851 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:07,855 - root - INFO - Clearing user context 2025-12-12 10:00:08,328 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:00:08,329 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,329 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:00:08,330 - root - INFO - Clearing user context 2025-12-12 10:00:08,330 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,330 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,332 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,332 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,333 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,333 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,351 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:00:08,353 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,354 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:00:08,354 - root - INFO - Clearing user context 2025-12-12 10:00:08,355 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,356 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,360 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,361 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,361 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,362 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,365 - root - INFO - Clearing user context 2025-12-12 10:00:08,367 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:08,368 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:08,369 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:08,371 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:00:08,371 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:08,372 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,372 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,373 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:00:08,373 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:08,374 - root - INFO - Clearing user context 2025-12-12 10:00:08,374 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,375 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,377 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,377 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,377 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,378 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,415 - root - INFO - Clearing user context 2025-12-12 10:00:08,418 - root - INFO - Clearing user context 2025-12-12 10:00:08,429 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:00:08,430 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,430 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:00:08,430 - root - INFO - Clearing user context 2025-12-12 10:00:08,431 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,431 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,433 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,434 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,434 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,435 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,436 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:00:08,436 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,437 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:00:08,437 - root - INFO - Clearing user context 2025-12-12 10:00:08,438 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,438 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,439 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,440 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,440 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,440 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,443 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:00:08,444 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,445 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:00:08,445 - root - INFO - Clearing user context 2025-12-12 10:00:08,445 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,446 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,449 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,450 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,450 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,450 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,461 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:08,462 - root - INFO - Clearing user context 2025-12-12 10:00:08,463 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:08,464 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:08,465 - root - INFO - Clearing user context 2025-12-12 10:00:08,468 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:08,468 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,470 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:08,486 - root - INFO - Clearing user context 2025-12-12 10:00:08,711 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:00:08,712 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,712 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:00:08,712 - root - INFO - Clearing user context 2025-12-12 10:00:08,712 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,713 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,714 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,714 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,714 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,714 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,716 - root - INFO - Clearing user context 2025-12-12 10:00:08,727 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:00:08,728 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:08,728 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:00:08,728 - root - INFO - Clearing user context 2025-12-12 10:00:08,728 - root - INFO - User context cleared before authentication 2025-12-12 10:00:08,729 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:08,730 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:08,730 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:08,730 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:08,730 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:08,734 - root - INFO - Clearing user context 2025-12-12 10:00:14,193 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/61 2025-12-12 10:00:14,193 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/61 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:14,193 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/61 2025-12-12 10:00:14,193 - root - INFO - Clearing user context 2025-12-12 10:00:14,194 - root - INFO - User context cleared before authentication 2025-12-12 10:00:14,194 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:14,196 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:14,196 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:14,196 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:14,196 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:14,200 - root - INFO - Clearing user context 2025-12-12 10:00:14,208 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/61/messages 2025-12-12 10:00:14,208 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/61/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:14,209 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/61/messages 2025-12-12 10:00:14,209 - root - INFO - Clearing user context 2025-12-12 10:00:14,209 - root - INFO - User context cleared before authentication 2025-12-12 10:00:14,209 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:14,211 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:14,211 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:14,212 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:14,212 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:14,227 - root - INFO - Clearing user context 2025-12-12 10:00:17,215 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:00:17,218 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:17,219 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:00:17,219 - root - INFO - Clearing user context 2025-12-12 10:00:17,219 - root - INFO - User context cleared before authentication 2025-12-12 10:00:17,220 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:17,227 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:17,228 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:17,229 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:17,229 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:17,231 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:17,233 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:17,234 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:17,236 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:17,236 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:17,237 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:17,250 - root - INFO - Clearing user context 2025-12-12 10:00:34,107 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/ 2025-12-12 10:00:34,109 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:34,109 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:00:34,109 - root - INFO - Clearing user context 2025-12-12 10:00:34,109 - root - INFO - User context cleared before authentication 2025-12-12 10:00:34,110 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:34,111 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:34,112 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:34,112 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:34,112 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:34,115 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:34,116 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:34,116 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:34,117 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:34,117 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:34,118 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:34,146 - th_agenter.services.knowledge_base - INFO - Created knowledge base: jcqtest (ID: 6) 2025-12-12 10:00:34,147 - root - INFO - Clearing user context 2025-12-12 10:00:42,101 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-12 10:00:42,102 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:42,103 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-12 10:00:42,103 - root - INFO - Clearing user context 2025-12-12 10:00:42,104 - root - INFO - User context cleared before authentication 2025-12-12 10:00:42,104 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:42,106 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:42,107 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,108 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:42,109 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:42,113 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:42,114 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:42,115 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:42,118 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:42,119 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,120 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:42,132 - root - INFO - Clearing user context 2025-12-12 10:00:42,500 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:00:42,501 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:42,502 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:00:42,502 - root - INFO - Clearing user context 2025-12-12 10:00:42,502 - root - INFO - User context cleared before authentication 2025-12-12 10:00:42,503 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:42,505 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:42,506 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,506 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:42,507 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:42,512 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:42,512 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:42,512 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:42,514 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:42,515 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,515 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:42,518 - root - INFO - Clearing user context 2025-12-12 10:00:42,525 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:00:42,526 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:42,527 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:00:42,528 - root - INFO - Clearing user context 2025-12-12 10:00:42,529 - root - INFO - User context cleared before authentication 2025-12-12 10:00:42,529 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:42,531 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:42,531 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,532 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:42,532 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:42,536 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:42,536 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:42,537 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:42,538 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:42,538 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,542 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:42,550 - root - INFO - Clearing user context 2025-12-12 10:00:42,947 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-12 10:00:42,947 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:42,948 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-12 10:00:42,948 - root - INFO - Clearing user context 2025-12-12 10:00:42,949 - root - INFO - User context cleared before authentication 2025-12-12 10:00:42,949 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:42,951 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:42,951 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,952 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:42,957 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:42,960 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:00:42,960 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:42,961 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:00:42,961 - root - INFO - Clearing user context 2025-12-12 10:00:42,961 - root - INFO - User context cleared before authentication 2025-12-12 10:00:42,962 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:42,968 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:42,973 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,981 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:42,982 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:42,986 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:00:42,991 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:00:42,992 - root - INFO - Looking for user with username: admin 2025-12-12 10:00:42,992 - root - INFO - Clearing user context 2025-12-12 10:00:42,993 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:00:42,997 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:42,997 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:00:43,005 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:00:43,008 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:00:43,009 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:00:43,009 - root - INFO - Clearing user context 2025-12-12 10:00:43,009 - root - INFO - User context cleared before authentication 2025-12-12 10:00:43,010 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:00:43,012 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:00:43,015 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:00:43,016 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:00:43,017 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:00:43,032 - root - INFO - Clearing user context 2025-12-12 10:00:43,042 - root - INFO - Clearing user context 2025-12-12 10:01:06,465 - root - INFO - [MIDDLEWARE] Processing request: POST /api/admin/llm-configs/5/test 2025-12-12 10:01:06,466 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/5/test against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:06,467 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/5/test 2025-12-12 10:01:06,467 - root - INFO - Clearing user context 2025-12-12 10:01:06,467 - root - INFO - User context cleared before authentication 2025-12-12 10:01:06,468 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:06,470 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:06,470 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:06,471 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:06,471 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:06,474 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:06,475 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:06,475 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:06,477 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:06,478 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:06,478 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:06,483 - th_agenter.th_agenter.api.endpoints.llm_configs - INFO - LLM config test: embedding-3 by user admin 2025-12-12 10:01:06,485 - root - INFO - Clearing user context 2025-12-12 10:01:09,166 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/admin/llm-configs/5 2025-12-12 10:01:09,167 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:09,168 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/5 2025-12-12 10:01:09,168 - root - INFO - Clearing user context 2025-12-12 10:01:09,169 - root - INFO - User context cleared before authentication 2025-12-12 10:01:09,169 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:09,170 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:09,171 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:09,171 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:09,173 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:09,192 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:09,193 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:09,193 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:09,195 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:09,195 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:09,195 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:09,225 - th_agenter.th_agenter.api.endpoints.llm_configs - INFO - LLM config updated: embedding-3 by user admin 2025-12-12 10:01:09,228 - root - INFO - Clearing user context 2025-12-12 10:01:09,434 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-12 10:01:09,436 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:09,436 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-12 10:01:09,437 - root - INFO - Clearing user context 2025-12-12 10:01:09,437 - root - INFO - User context cleared before authentication 2025-12-12 10:01:09,437 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:09,441 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:09,447 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:09,449 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:09,450 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:09,460 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:09,465 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:09,465 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:09,466 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:09,467 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:09,468 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:09,496 - root - INFO - Clearing user context 2025-12-12 10:01:37,727 - root - INFO - [MIDDLEWARE] Processing request: PUT /api/admin/llm-configs/5 2025-12-12 10:01:37,728 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:37,728 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/5 2025-12-12 10:01:37,729 - root - INFO - Clearing user context 2025-12-12 10:01:37,729 - root - INFO - User context cleared before authentication 2025-12-12 10:01:37,730 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:37,731 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:37,732 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:37,732 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:37,733 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:37,736 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:37,736 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:37,737 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:37,739 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:37,739 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:37,740 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:37,745 - th_agenter.th_agenter.api.endpoints.llm_configs - INFO - LLM config updated: embedding-3 by user admin 2025-12-12 10:01:37,747 - root - INFO - Clearing user context 2025-12-12 10:01:38,096 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-12 10:01:38,098 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:38,098 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-12 10:01:38,099 - root - INFO - Clearing user context 2025-12-12 10:01:38,099 - root - INFO - User context cleared before authentication 2025-12-12 10:01:38,099 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:38,102 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:38,111 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:38,111 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:38,112 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:38,116 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:38,117 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:38,117 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:38,135 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:38,141 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:38,142 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:38,147 - root - INFO - Clearing user context 2025-12-12 10:01:40,785 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:01:40,788 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:40,789 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:01:40,789 - root - INFO - Clearing user context 2025-12-12 10:01:40,790 - root - INFO - User context cleared before authentication 2025-12-12 10:01:40,791 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:40,794 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:40,796 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:40,797 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:40,800 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:40,802 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:40,803 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:40,803 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:40,805 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:40,806 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:40,806 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:40,824 - root - INFO - Clearing user context 2025-12-12 10:01:42,339 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:01:42,339 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:42,339 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:01:42,340 - root - INFO - Clearing user context 2025-12-12 10:01:42,340 - root - INFO - User context cleared before authentication 2025-12-12 10:01:42,340 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:42,342 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:42,342 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:42,343 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:42,343 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:42,345 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:42,345 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:42,346 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:42,347 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:42,348 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:42,348 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:42,357 - root - INFO - Clearing user context 2025-12-12 10:01:54,386 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 10:01:54,386 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:54,387 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:01:54,387 - root - INFO - Clearing user context 2025-12-12 10:01:54,388 - root - INFO - User context cleared before authentication 2025-12-12 10:01:54,388 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:54,391 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:54,392 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:54,392 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:54,393 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:54,398 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:54,398 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:54,399 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:54,401 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:54,401 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:54,402 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:54,600 - th_agenter.services.document - INFO - Uploaded document: 高速公路低空算法验证方案.docx to KB 6 (Doc ID: 3) 2025-12-12 10:01:54,607 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 10:01:54,719 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 10:01:54,728 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 10:01:54,732 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 3, 路径: E:\Work\HXF\backend\data\uploads\kb_6\0236c771-09f3-4202-b7b8-ee5242899648_高速公路低空算法验证方案.docx 2025-12-12 10:01:54,734 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF\backend\data\uploads\kb_6\0236c771-09f3-4202-b7b8-ee5242899648_高速公路低空算法验证方案.docx: No module named 'docx2txt' 2025-12-12 10:01:54,735 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 3: No module named 'docx2txt' 2025-12-12 10:01:54,745 - root - INFO - Clearing user context 2025-12-12 10:01:56,771 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:01:56,780 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:01:56,781 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:01:56,782 - root - INFO - Clearing user context 2025-12-12 10:01:56,782 - root - INFO - User context cleared before authentication 2025-12-12 10:01:56,782 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:01:56,784 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:01:56,796 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:56,797 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:01:56,797 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:01:56,804 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:01:56,806 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:01:56,806 - root - INFO - Looking for user with username: admin 2025-12-12 10:01:56,817 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:01:56,817 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:01:56,818 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:01:56,823 - root - INFO - Clearing user context 2025-12-12 10:02:13,687 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:02:13,687 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:02:13,688 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:02:13,688 - root - INFO - Clearing user context 2025-12-12 10:02:13,688 - root - INFO - User context cleared before authentication 2025-12-12 10:02:13,689 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:02:13,690 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:02:13,690 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:02:13,691 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:02:13,691 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:02:13,692 - root - INFO - Clearing user context 2025-12-12 10:04:16,496 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/6/documents/3 2025-12-12 10:04:16,497 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:16,497 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/3 2025-12-12 10:04:16,497 - root - INFO - Clearing user context 2025-12-12 10:04:16,497 - root - INFO - User context cleared before authentication 2025-12-12 10:04:16,497 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:16,498 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:16,498 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:16,498 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:16,498 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:16,499 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:04:16,500 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:04:16,500 - root - INFO - Looking for user with username: admin 2025-12-12 10:04:16,501 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:04:16,501 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:16,502 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:04:16,507 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF\backend\data\uploads\kb_6\0236c771-09f3-4202-b7b8-ee5242899648_高速公路低空算法验证方案.docx 2025-12-12 10:04:16,959 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=3 2025-12-12 10:04:16,959 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=3 2025-12-12 10:04:16,968 - th_agenter.services.document - INFO - Deleted document: 0236c771-09f3-4202-b7b8-ee5242899648_高速公路低空算法验证方案.docx (ID: 3) 2025-12-12 10:04:16,970 - root - INFO - Clearing user context 2025-12-12 10:04:16,984 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:04:16,986 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:16,986 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:04:16,986 - root - INFO - Clearing user context 2025-12-12 10:04:16,987 - root - INFO - User context cleared before authentication 2025-12-12 10:04:16,988 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:16,991 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:16,991 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:16,992 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:16,992 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:16,997 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:04:16,998 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:04:16,998 - root - INFO - Looking for user with username: admin 2025-12-12 10:04:17,000 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:04:17,000 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:17,001 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:04:17,006 - root - INFO - Clearing user context 2025-12-12 10:04:23,433 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 10:04:23,433 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:23,434 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:04:23,434 - root - INFO - Clearing user context 2025-12-12 10:04:23,434 - root - INFO - User context cleared before authentication 2025-12-12 10:04:23,434 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:23,435 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:23,435 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:23,435 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:23,436 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:23,437 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:04:23,438 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:04:23,438 - root - INFO - Looking for user with username: admin 2025-12-12 10:04:23,439 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:04:23,439 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:23,439 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:04:23,457 - th_agenter.services.document - INFO - Uploaded document: 抛洒物统计.txt to KB 6 (Doc ID: 3) 2025-12-12 10:04:23,465 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 3, 路径: E:\Work\HXF\backend\data\uploads\kb_6\bf5ab088-d02c-4d15-8247-12768899df05_抛洒物统计.txt 2025-12-12 10:04:23,466 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF\backend\data\uploads\kb_6\bf5ab088-d02c-4d15-8247-12768899df05_抛洒物统计.txt, 页数: 1 2025-12-12 10:04:23,477 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-12 10:04:23,478 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-12 10:04:23,479 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-12 10:04:23,549 - th_agenter.services.document_processor - WARNING - 连接现有向量存储失败,创建新的向量存储: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 10:04:23,642 - th_agenter.services.document_processor - ERROR - 创建向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 10:04:23,643 - th_agenter.services.document_processor - ERROR - 添加文档到向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 10:04:23,644 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 3: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 10:04:23,648 - root - INFO - Clearing user context 2025-12-12 10:04:25,663 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:04:25,664 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:25,664 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:04:25,664 - root - INFO - Clearing user context 2025-12-12 10:04:25,665 - root - INFO - User context cleared before authentication 2025-12-12 10:04:25,665 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:25,666 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:25,666 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:25,666 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:25,667 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:25,668 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:04:25,669 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:04:25,669 - root - INFO - Looking for user with username: admin 2025-12-12 10:04:25,670 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:04:25,670 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:25,670 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:04:25,672 - root - INFO - Clearing user context 2025-12-12 10:04:29,415 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:04:29,418 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:29,419 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:04:29,419 - root - INFO - Clearing user context 2025-12-12 10:04:29,419 - root - INFO - User context cleared before authentication 2025-12-12 10:04:29,420 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:29,426 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:29,426 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:29,427 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:29,427 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:29,429 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:04:29,430 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:04:29,430 - root - INFO - Looking for user with username: admin 2025-12-12 10:04:29,435 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:04:29,438 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:29,438 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:04:29,442 - root - INFO - Clearing user context 2025-12-12 10:04:37,685 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:04:37,686 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:04:37,686 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:04:37,686 - root - INFO - Clearing user context 2025-12-12 10:04:37,687 - root - INFO - User context cleared before authentication 2025-12-12 10:04:37,687 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:04:37,690 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:04:37,690 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:04:37,691 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:04:37,692 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:04:37,693 - root - INFO - Clearing user context 2025-12-12 10:06:31,514 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/6/documents/3 2025-12-12 10:06:31,514 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:06:31,515 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/3 2025-12-12 10:06:31,515 - root - INFO - Clearing user context 2025-12-12 10:06:31,515 - root - INFO - User context cleared before authentication 2025-12-12 10:06:31,515 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:06:31,516 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:06:31,516 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:06:31,516 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:06:31,516 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:06:31,517 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:06:31,518 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:06:31,519 - root - INFO - Looking for user with username: admin 2025-12-12 10:06:31,519 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:06:31,519 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:06:31,520 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:06:31,521 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF\backend\data\uploads\kb_6\bf5ab088-d02c-4d15-8247-12768899df05_抛洒物统计.txt 2025-12-12 10:06:31,572 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=3 2025-12-12 10:06:31,573 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=3 2025-12-12 10:06:31,584 - th_agenter.services.document - INFO - Deleted document: bf5ab088-d02c-4d15-8247-12768899df05_抛洒物统计.txt (ID: 3) 2025-12-12 10:06:31,586 - root - INFO - Clearing user context 2025-12-12 10:06:31,783 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:06:31,785 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:06:31,785 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:06:31,786 - root - INFO - Clearing user context 2025-12-12 10:06:31,786 - root - INFO - User context cleared before authentication 2025-12-12 10:06:31,786 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:06:31,788 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:06:31,789 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:06:31,789 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:06:31,790 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:06:31,793 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:06:31,793 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:06:31,793 - root - INFO - Looking for user with username: admin 2025-12-12 10:06:31,798 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:06:31,799 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:06:31,799 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:06:31,804 - root - INFO - Clearing user context 2025-12-12 10:07:29,749 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 10:07:29,752 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:07:29,752 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:07:29,753 - root - INFO - Clearing user context 2025-12-12 10:07:29,753 - root - INFO - User context cleared before authentication 2025-12-12 10:07:29,753 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:07:29,757 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:07:29,759 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:07:29,760 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:07:29,760 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:07:29,765 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:07:29,765 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:07:29,766 - root - INFO - Looking for user with username: admin 2025-12-12 10:07:29,767 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:07:29,768 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:07:29,768 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:07:29,784 - th_agenter.services.document - INFO - Uploaded document: 周报.txt to KB 6 (Doc ID: 3) 2025-12-12 10:07:29,789 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 3, 路径: E:\Work\HXF\backend\data\uploads\kb_6\65483448-1076-499a-915e-4ded81664153_周报.txt 2025-12-12 10:07:29,790 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF\backend\data\uploads\kb_6\65483448-1076-499a-915e-4ded81664153_周报.txt, 页数: 1 2025-12-12 10:07:29,791 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-12 10:07:29,792 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-12 10:07:29,794 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 7 个文档块 2025-12-12 10:07:30,954 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,198 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,343 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,489 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,610 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,836 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:31,981 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:07:32,056 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_6 2025-12-12 10:07:32,063 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 3, 'status': 'success', 'chunks_count': 7, 'message': '文档处理完成'} 2025-12-12 10:07:32,069 - th_agenter.services.document - INFO - Processed document: 65483448-1076-499a-915e-4ded81664153_周报.txt (ID: 3) 2025-12-12 10:07:32,071 - root - INFO - Clearing user context 2025-12-12 10:07:34,391 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:07:34,392 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:07:34,392 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:07:34,392 - root - INFO - Clearing user context 2025-12-12 10:07:34,393 - root - INFO - User context cleared before authentication 2025-12-12 10:07:34,394 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:07:34,395 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:07:34,395 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:07:34,395 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:07:34,395 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:07:34,397 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:07:34,397 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:07:34,397 - root - INFO - Looking for user with username: admin 2025-12-12 10:07:34,398 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:07:34,398 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:07:34,398 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:07:34,402 - root - INFO - Clearing user context 2025-12-12 10:07:39,606 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:07:39,607 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:07:39,607 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:07:39,607 - root - INFO - Clearing user context 2025-12-12 10:07:39,608 - root - INFO - User context cleared before authentication 2025-12-12 10:07:39,608 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:07:39,609 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:07:39,610 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:07:39,610 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:07:39,610 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:07:39,612 - root - INFO - Clearing user context 2025-12-12 10:11:26,603 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:11:26,604 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:11:26,604 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:11:26,604 - root - INFO - Clearing user context 2025-12-12 10:11:26,604 - root - INFO - User context cleared before authentication 2025-12-12 10:11:26,604 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:11:26,605 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:11:26,606 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:11:26,606 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:11:26,606 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:11:26,606 - root - INFO - Clearing user context 2025-12-12 10:11:36,101 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:11:36,102 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:11:36,102 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:11:36,103 - root - INFO - Clearing user context 2025-12-12 10:11:36,103 - root - INFO - User context cleared before authentication 2025-12-12 10:11:36,104 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:11:36,105 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:11:36,106 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:11:36,107 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:11:36,107 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:11:36,109 - root - INFO - Clearing user context 2025-12-12 10:12:14,764 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:12:14,765 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:12:14,765 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:12:14,765 - root - INFO - Clearing user context 2025-12-12 10:12:14,765 - root - INFO - User context cleared before authentication 2025-12-12 10:12:14,765 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:12:14,766 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:12:14,767 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:12:14,767 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:12:14,768 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:12:14,768 - root - INFO - Clearing user context 2025-12-12 10:13:05,855 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:13:05,856 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:13:05,856 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:13:05,857 - root - INFO - Clearing user context 2025-12-12 10:13:05,857 - root - INFO - User context cleared before authentication 2025-12-12 10:13:05,857 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:13:05,860 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:13:05,860 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:13:05,861 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:13:05,861 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:13:05,863 - root - INFO - Clearing user context 2025-12-12 10:15:53,467 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:16:01,961 - root - INFO - Logging configured successfully 2025-12-12 10:16:02,066 - root - INFO - Logging configured successfully 2025-12-12 10:16:02,156 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:16:02,163 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:16:02,166 - root - INFO - Database tables created 2025-12-12 10:16:02,167 - root - INFO - Database initialized 2025-12-12 10:16:10,180 - root - INFO - Logging configured successfully 2025-12-12 10:16:10,283 - root - INFO - Logging configured successfully 2025-12-12 10:16:10,379 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:16:10,386 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:16:10,390 - root - INFO - Database tables created 2025-12-12 10:16:10,390 - root - INFO - Database initialized 2025-12-12 10:16:18,332 - root - INFO - Logging configured successfully 2025-12-12 10:16:18,473 - root - INFO - Logging configured successfully 2025-12-12 10:16:18,577 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:16:18,585 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:16:18,590 - root - INFO - Database tables created 2025-12-12 10:16:18,590 - root - INFO - Database initialized 2025-12-12 10:16:26,993 - root - INFO - Logging configured successfully 2025-12-12 10:16:27,102 - root - INFO - Logging configured successfully 2025-12-12 10:16:27,190 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:16:27,199 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:16:27,201 - root - INFO - Database tables created 2025-12-12 10:16:27,202 - root - INFO - Database initialized 2025-12-12 10:17:45,664 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:17:55,333 - root - INFO - Logging configured successfully 2025-12-12 10:17:55,453 - root - INFO - Logging configured successfully 2025-12-12 10:17:55,558 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:17:55,567 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:17:55,570 - root - INFO - Database tables created 2025-12-12 10:17:55,570 - root - INFO - Database initialized 2025-12-12 10:18:12,467 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:18:12,468 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:12,469 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:18:12,469 - root - INFO - Clearing user context 2025-12-12 10:18:12,470 - root - INFO - User context cleared before authentication 2025-12-12 10:18:12,470 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:12,523 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:12,524 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,524 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:12,524 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:12,532 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:12,533 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:12,534 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:12,536 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:12,537 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,538 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:12,545 - root - INFO - Clearing user context 2025-12-12 10:18:12,554 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:18:12,555 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:12,555 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:18:12,555 - root - INFO - Clearing user context 2025-12-12 10:18:12,556 - root - INFO - User context cleared before authentication 2025-12-12 10:18:12,556 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:12,558 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:12,559 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,559 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:12,559 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:12,561 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:12,561 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:12,561 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:12,562 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:12,562 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,563 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:12,574 - root - INFO - Clearing user context 2025-12-12 10:18:12,718 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:18:12,719 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:12,720 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:18:12,723 - root - INFO - Clearing user context 2025-12-12 10:18:12,723 - root - INFO - User context cleared before authentication 2025-12-12 10:18:12,724 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:12,730 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:12,730 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,731 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:12,731 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:12,735 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:18:12,741 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:12,741 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:18:12,741 - root - INFO - Clearing user context 2025-12-12 10:18:12,742 - root - INFO - User context cleared before authentication 2025-12-12 10:18:12,742 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:12,744 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:12,748 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,749 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:12,749 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:12,752 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:12,757 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:12,758 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:12,767 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:12,774 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,777 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:12,777 - root - INFO - Clearing user context 2025-12-12 10:18:12,819 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:18:12,820 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:12,820 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:18:12,821 - root - INFO - Clearing user context 2025-12-12 10:18:12,821 - root - INFO - User context cleared before authentication 2025-12-12 10:18:12,822 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:12,829 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:12,831 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:12,832 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:12,832 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:12,832 - root - INFO - Clearing user context 2025-12-12 10:18:12,841 - root - INFO - Clearing user context 2025-12-12 10:18:14,309 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:18:14,309 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:14,310 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:18:14,310 - root - INFO - Clearing user context 2025-12-12 10:18:14,311 - root - INFO - User context cleared before authentication 2025-12-12 10:18:14,311 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:14,316 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:14,317 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:14,318 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:14,318 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:14,322 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:14,323 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:14,325 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:14,328 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:14,329 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:14,329 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:14,349 - root - INFO - Clearing user context 2025-12-12 10:18:22,341 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:18:22,342 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:22,342 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:18:22,342 - root - INFO - Clearing user context 2025-12-12 10:18:22,342 - root - INFO - User context cleared before authentication 2025-12-12 10:18:22,343 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:22,345 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:22,345 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:22,346 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:22,346 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:22,349 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:22,350 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:22,350 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:22,352 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:22,352 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:22,353 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:22,361 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 10:18:22,429 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 10:18:22,436 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 10:18:23,224 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:18:23,281 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:18:23,282 - root - INFO - Clearing user context 2025-12-12 10:18:31,012 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:18:31,013 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:18:31,014 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:18:31,014 - root - INFO - Clearing user context 2025-12-12 10:18:31,014 - root - INFO - User context cleared before authentication 2025-12-12 10:18:31,015 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:18:31,016 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:18:31,017 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:31,017 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:18:31,017 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:18:31,019 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:18:31,020 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:18:31,020 - root - INFO - Looking for user with username: admin 2025-12-12 10:18:31,022 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:18:31,022 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:18:31,022 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:18:31,216 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:18:31,273 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:18:31,274 - root - INFO - Clearing user context 2025-12-12 10:18:58,273 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:19:05,909 - root - INFO - Logging configured successfully 2025-12-12 10:19:06,008 - root - INFO - Logging configured successfully 2025-12-12 10:19:06,095 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:19:06,102 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:19:06,105 - root - INFO - Database tables created 2025-12-12 10:19:06,105 - root - INFO - Database initialized 2025-12-12 10:19:40,829 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:19:40,829 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:19:40,830 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:19:40,830 - root - INFO - Clearing user context 2025-12-12 10:19:40,831 - root - INFO - User context cleared before authentication 2025-12-12 10:19:40,831 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:19:40,853 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:19:40,853 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:19:40,853 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:19:40,854 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:19:40,855 - root - INFO - Clearing user context 2025-12-12 10:19:50,174 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:19:50,175 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:19:50,175 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:19:50,175 - root - INFO - Clearing user context 2025-12-12 10:19:50,175 - root - INFO - User context cleared before authentication 2025-12-12 10:19:50,176 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:19:50,178 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:19:50,178 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:19:50,178 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:19:50,179 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:19:50,179 - root - INFO - Clearing user context 2025-12-12 10:19:53,281 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:19:53,281 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:19:53,282 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:19:53,282 - root - INFO - Clearing user context 2025-12-12 10:19:53,282 - root - INFO - User context cleared before authentication 2025-12-12 10:19:53,282 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:19:53,284 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:19:53,284 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:19:53,284 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:19:53,284 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:19:53,285 - root - INFO - Clearing user context 2025-12-12 10:20:06,603 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:20:06,603 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:06,603 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:20:06,604 - root - INFO - Clearing user context 2025-12-12 10:20:06,604 - root - INFO - User context cleared before authentication 2025-12-12 10:20:06,604 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:06,605 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:06,605 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,606 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:06,606 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:06,609 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:06,610 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:06,610 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:06,611 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:06,611 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,611 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:06,616 - root - INFO - Clearing user context 2025-12-12 10:20:06,819 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:20:06,820 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:06,820 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:20:06,820 - root - INFO - Clearing user context 2025-12-12 10:20:06,820 - root - INFO - User context cleared before authentication 2025-12-12 10:20:06,820 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:06,821 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:06,822 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,822 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:06,822 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:06,823 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:06,824 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:06,824 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:06,824 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:06,824 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,825 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:06,829 - root - INFO - Clearing user context 2025-12-12 10:20:06,933 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:20:06,933 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:06,933 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:20:06,933 - root - INFO - Clearing user context 2025-12-12 10:20:06,934 - root - INFO - User context cleared before authentication 2025-12-12 10:20:06,934 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:06,935 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:06,936 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,936 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:06,936 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:06,937 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:20:06,937 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:06,937 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:20:06,938 - root - INFO - Clearing user context 2025-12-12 10:20:06,938 - root - INFO - User context cleared before authentication 2025-12-12 10:20:06,938 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:06,939 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:06,940 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,940 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:06,940 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:06,946 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:06,947 - root - INFO - Clearing user context 2025-12-12 10:20:06,947 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:06,948 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:06,950 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:06,950 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,950 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:06,969 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:20:06,969 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:06,970 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:20:06,970 - root - INFO - Clearing user context 2025-12-12 10:20:06,970 - root - INFO - User context cleared before authentication 2025-12-12 10:20:06,970 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:06,971 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:06,972 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:06,972 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:06,973 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:06,973 - root - INFO - Clearing user context 2025-12-12 10:20:06,977 - root - INFO - Clearing user context 2025-12-12 10:20:09,265 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:20:09,266 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:09,267 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:20:09,267 - root - INFO - Clearing user context 2025-12-12 10:20:09,267 - root - INFO - User context cleared before authentication 2025-12-12 10:20:09,267 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:09,269 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:09,269 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:09,270 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:09,270 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:09,272 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:09,273 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:09,274 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:09,275 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:09,275 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:09,276 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:09,281 - root - INFO - Clearing user context 2025-12-12 10:20:23,528 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/llm-configs/ 2025-12-12 10:20:23,529 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:23,529 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/ 2025-12-12 10:20:23,530 - root - INFO - Clearing user context 2025-12-12 10:20:23,530 - root - INFO - User context cleared before authentication 2025-12-12 10:20:23,530 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:23,532 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:23,532 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:23,532 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:23,532 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:23,534 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:23,535 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:23,535 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:23,536 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:23,536 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:23,537 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:23,541 - root - INFO - Clearing user context 2025-12-12 10:20:45,195 - root - INFO - [MIDDLEWARE] Processing request: POST /api/admin/llm-configs/5/test 2025-12-12 10:20:45,195 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/llm-configs/5/test against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:45,196 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/llm-configs/5/test 2025-12-12 10:20:45,196 - root - INFO - Clearing user context 2025-12-12 10:20:45,196 - root - INFO - User context cleared before authentication 2025-12-12 10:20:45,196 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:45,198 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:45,198 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:45,198 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:45,198 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:45,200 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:45,200 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:45,201 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:45,202 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:45,202 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:45,202 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:45,206 - th_agenter.th_agenter.api.endpoints.llm_configs - INFO - LLM config test: embedding-3 by user admin 2025-12-12 10:20:45,208 - root - INFO - Clearing user context 2025-12-12 10:20:54,253 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:20:54,254 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:54,254 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:20:54,255 - root - INFO - Clearing user context 2025-12-12 10:20:54,256 - root - INFO - User context cleared before authentication 2025-12-12 10:20:54,256 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:54,258 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:54,259 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:54,259 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:54,260 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:54,263 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:54,264 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:54,264 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:54,265 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:54,266 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:54,266 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:54,276 - root - INFO - Clearing user context 2025-12-12 10:20:58,211 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:20:58,211 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:20:58,211 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:20:58,212 - root - INFO - Clearing user context 2025-12-12 10:20:58,212 - root - INFO - User context cleared before authentication 2025-12-12 10:20:58,213 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:20:58,215 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:20:58,215 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:58,216 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:20:58,216 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:20:58,218 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:20:58,219 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:20:58,219 - root - INFO - Looking for user with username: admin 2025-12-12 10:20:58,221 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:20:58,221 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:20:58,221 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:20:58,226 - root - INFO - Clearing user context 2025-12-12 10:21:02,566 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:21:02,566 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:21:02,567 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:21:02,567 - root - INFO - Clearing user context 2025-12-12 10:21:02,568 - root - INFO - User context cleared before authentication 2025-12-12 10:21:02,568 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:21:02,569 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:21:02,569 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:02,570 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:21:02,570 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:21:02,572 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:21:02,572 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:21:02,572 - root - INFO - Looking for user with username: admin 2025-12-12 10:21:02,574 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:21:02,574 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:02,574 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:21:02,577 - root - INFO - Clearing user context 2025-12-12 10:21:04,027 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:21:04,027 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:21:04,027 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:21:04,027 - root - INFO - Clearing user context 2025-12-12 10:21:04,028 - root - INFO - User context cleared before authentication 2025-12-12 10:21:04,028 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:21:04,030 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:21:04,030 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:04,031 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:21:04,031 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:21:04,033 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:21:04,033 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:21:04,033 - root - INFO - Looking for user with username: admin 2025-12-12 10:21:04,034 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:21:04,034 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:04,035 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:21:04,039 - root - INFO - Clearing user context 2025-12-12 10:21:05,430 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:21:05,430 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:21:05,431 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:21:05,431 - root - INFO - Clearing user context 2025-12-12 10:21:05,432 - root - INFO - User context cleared before authentication 2025-12-12 10:21:05,432 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:21:05,434 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:21:05,434 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:05,434 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:21:05,435 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:21:05,435 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:21:05,436 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:21:05,436 - root - INFO - Looking for user with username: admin 2025-12-12 10:21:05,437 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:21:05,437 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:05,438 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:21:05,442 - root - INFO - Clearing user context 2025-12-12 10:21:16,323 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:21:16,324 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:21:16,324 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:21:16,324 - root - INFO - Clearing user context 2025-12-12 10:21:16,324 - root - INFO - User context cleared before authentication 2025-12-12 10:21:16,324 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:21:16,325 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:21:16,325 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:16,325 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:21:16,325 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:21:16,326 - root - INFO - Clearing user context 2025-12-12 10:21:47,333 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:21:47,334 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:21:47,334 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:21:47,334 - root - INFO - Clearing user context 2025-12-12 10:21:47,334 - root - INFO - User context cleared before authentication 2025-12-12 10:21:47,334 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:21:47,335 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:21:47,336 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:21:47,336 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:21:47,336 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:21:47,336 - root - INFO - Clearing user context 2025-12-12 10:22:47,419 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:22:55,845 - root - INFO - Logging configured successfully 2025-12-12 10:22:55,970 - root - INFO - Logging configured successfully 2025-12-12 10:22:56,066 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:22:56,074 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:22:56,078 - root - INFO - Database tables created 2025-12-12 10:22:56,078 - root - INFO - Database initialized 2025-12-12 10:23:04,309 - root - INFO - Logging configured successfully 2025-12-12 10:23:04,424 - root - INFO - Logging configured successfully 2025-12-12 10:23:04,519 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:23:04,525 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:23:04,530 - root - INFO - Database tables created 2025-12-12 10:23:04,530 - root - INFO - Database initialized 2025-12-12 10:23:13,461 - root - INFO - Logging configured successfully 2025-12-12 10:23:13,575 - root - INFO - Logging configured successfully 2025-12-12 10:23:13,682 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:23:13,692 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:23:13,695 - root - INFO - Database tables created 2025-12-12 10:23:13,696 - root - INFO - Database initialized 2025-12-12 10:23:21,620 - root - INFO - Logging configured successfully 2025-12-12 10:23:21,730 - root - INFO - Logging configured successfully 2025-12-12 10:23:21,821 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:23:21,829 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:23:21,833 - root - INFO - Database tables created 2025-12-12 10:23:21,833 - root - INFO - Database initialized 2025-12-12 10:24:29,670 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:24:37,813 - root - INFO - Logging configured successfully 2025-12-12 10:24:37,961 - root - INFO - Logging configured successfully 2025-12-12 10:24:38,071 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:24:38,080 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:24:38,083 - root - INFO - Database tables created 2025-12-12 10:24:38,084 - root - INFO - Database initialized 2025-12-12 10:24:45,994 - root - INFO - Logging configured successfully 2025-12-12 10:24:46,095 - root - INFO - Logging configured successfully 2025-12-12 10:24:46,187 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:24:46,196 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:24:46,199 - root - INFO - Database tables created 2025-12-12 10:24:46,199 - root - INFO - Database initialized 2025-12-12 10:25:05,202 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:38:18,185 - root - INFO - Logging configured successfully 2025-12-12 10:38:18,329 - root - INFO - Logging configured successfully 2025-12-12 10:38:18,448 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:38:18,455 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:38:18,459 - root - INFO - Database tables created 2025-12-12 10:38:18,460 - root - INFO - Database initialized 2025-12-12 10:43:30,007 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 10:43:43,199 - root - INFO - Logging configured successfully 2025-12-12 10:43:43,327 - root - INFO - Logging configured successfully 2025-12-12 10:43:43,454 - root - INFO - Starting up TH-Agenter application... 2025-12-12 10:43:43,470 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 10:43:43,475 - root - INFO - Database tables created 2025-12-12 10:43:43,475 - root - INFO - Database initialized 2025-12-12 10:44:11,558 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:44:11,558 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:11,559 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:44:11,559 - root - INFO - Clearing user context 2025-12-12 10:44:11,559 - root - INFO - User context cleared before authentication 2025-12-12 10:44:11,559 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:11,591 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:11,591 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,591 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:11,592 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:11,595 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:11,595 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:11,596 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:11,597 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:11,597 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,597 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:11,607 - root - INFO - Clearing user context 2025-12-12 10:44:11,614 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:44:11,614 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:11,616 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:44:11,616 - root - INFO - Clearing user context 2025-12-12 10:44:11,616 - root - INFO - User context cleared before authentication 2025-12-12 10:44:11,616 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:11,617 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:11,617 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,617 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:11,617 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:11,619 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:11,619 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:11,619 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:11,620 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:11,621 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,621 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:11,626 - root - INFO - Clearing user context 2025-12-12 10:44:11,830 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:44:11,831 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:11,831 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:44:11,831 - root - INFO - Clearing user context 2025-12-12 10:44:11,831 - root - INFO - User context cleared before authentication 2025-12-12 10:44:11,831 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:11,832 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:11,832 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,833 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:11,833 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:11,833 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:44:11,834 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:11,834 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:44:11,834 - root - INFO - Clearing user context 2025-12-12 10:44:11,834 - root - INFO - User context cleared before authentication 2025-12-12 10:44:11,835 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:11,836 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:11,836 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,836 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:11,836 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:11,846 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:11,847 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:11,847 - root - INFO - Clearing user context 2025-12-12 10:44:11,847 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:11,849 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:11,850 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,850 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:11,871 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:44:11,872 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:11,872 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:44:11,873 - root - INFO - Clearing user context 2025-12-12 10:44:11,873 - root - INFO - User context cleared before authentication 2025-12-12 10:44:11,873 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:11,874 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:11,874 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:11,875 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:11,875 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:11,875 - root - INFO - Clearing user context 2025-12-12 10:44:11,878 - root - INFO - Clearing user context 2025-12-12 10:44:14,007 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:44:14,007 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:14,008 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:44:14,008 - root - INFO - Clearing user context 2025-12-12 10:44:14,009 - root - INFO - User context cleared before authentication 2025-12-12 10:44:14,009 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:14,011 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:14,011 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:14,011 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:14,012 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:14,014 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:14,015 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:14,015 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:14,017 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:14,017 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:14,017 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:14,025 - root - INFO - Clearing user context 2025-12-12 10:44:17,622 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:44:17,623 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:17,623 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:44:17,624 - root - INFO - Clearing user context 2025-12-12 10:44:17,625 - root - INFO - User context cleared before authentication 2025-12-12 10:44:17,625 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:17,626 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:17,626 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:17,627 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:17,627 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:17,629 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:17,629 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:17,630 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:17,631 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:17,631 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:17,631 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:17,635 - root - INFO - Clearing user context 2025-12-12 10:44:39,154 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:44:39,154 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:39,155 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:44:39,155 - root - INFO - Clearing user context 2025-12-12 10:44:39,155 - root - INFO - User context cleared before authentication 2025-12-12 10:44:39,155 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:39,156 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:39,157 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:39,157 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:39,157 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:39,159 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:39,159 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:39,159 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:39,160 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:39,160 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:39,160 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:39,166 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 10:44:39,222 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 10:44:39,227 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 10:44:39,960 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:44:40,022 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:44:40,023 - root - INFO - Clearing user context 2025-12-12 10:44:45,549 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:44:45,549 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:44:45,550 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:44:45,550 - root - INFO - Clearing user context 2025-12-12 10:44:45,551 - root - INFO - User context cleared before authentication 2025-12-12 10:44:45,551 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:44:45,553 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:44:45,553 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:45,553 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:44:45,554 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:44:45,555 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:44:45,556 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:44:45,556 - root - INFO - Looking for user with username: admin 2025-12-12 10:44:45,558 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:44:45,559 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:44:45,559 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:44:45,859 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:44:45,914 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:44:45,915 - root - INFO - Clearing user context 2025-12-12 10:45:05,590 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:45:05,591 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:45:05,591 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:45:05,591 - root - INFO - Clearing user context 2025-12-12 10:45:05,592 - root - INFO - User context cleared before authentication 2025-12-12 10:45:05,592 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:45:05,593 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:45:05,593 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:05,594 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:45:05,594 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:45:05,595 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:45:05,596 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:45:05,596 - root - INFO - Looking for user with username: admin 2025-12-12 10:45:05,597 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:45:05,597 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:05,597 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:45:05,905 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:45:05,963 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:45:05,964 - root - INFO - Clearing user context 2025-12-12 10:45:17,366 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:45:17,366 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:45:17,367 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:45:17,367 - root - INFO - Clearing user context 2025-12-12 10:45:17,368 - root - INFO - User context cleared before authentication 2025-12-12 10:45:17,368 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:45:17,369 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:45:17,370 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:17,370 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:45:17,371 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:45:17,372 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:45:17,373 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:45:17,373 - root - INFO - Looking for user with username: admin 2025-12-12 10:45:17,374 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:45:17,375 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:17,375 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:45:17,663 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:45:17,716 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:45:17,718 - root - INFO - Clearing user context 2025-12-12 10:45:56,434 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:45:56,434 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:45:56,434 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:45:56,434 - root - INFO - Clearing user context 2025-12-12 10:45:56,435 - root - INFO - User context cleared before authentication 2025-12-12 10:45:56,435 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:45:56,435 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:45:56,436 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:56,436 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:45:56,436 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:45:56,437 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:45:56,438 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:45:56,438 - root - INFO - Looking for user with username: admin 2025-12-12 10:45:56,439 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:45:56,439 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:45:56,439 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:45:56,707 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:45:56,766 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:45:56,768 - root - INFO - Clearing user context 2025-12-12 10:49:11,361 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:49:11,361 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:49:11,361 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:49:11,361 - root - INFO - Clearing user context 2025-12-12 10:49:11,361 - root - INFO - User context cleared before authentication 2025-12-12 10:49:11,361 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:49:11,362 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:49:11,363 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:11,364 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:49:11,364 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:49:11,365 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:49:11,365 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:49:11,366 - root - INFO - Looking for user with username: admin 2025-12-12 10:49:11,367 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:49:11,367 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:11,367 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:49:11,596 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:49:11,650 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:49:11,652 - root - INFO - Clearing user context 2025-12-12 10:49:17,885 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:49:17,885 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:49:17,886 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:49:17,886 - root - INFO - Clearing user context 2025-12-12 10:49:17,886 - root - INFO - User context cleared before authentication 2025-12-12 10:49:17,887 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:49:17,888 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:49:17,888 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:17,889 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:49:17,889 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:49:17,892 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:49:17,892 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:49:17,892 - root - INFO - Looking for user with username: admin 2025-12-12 10:49:17,894 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:49:17,894 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:17,894 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:49:18,194 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:49:18,260 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:49:18,261 - root - INFO - Clearing user context 2025-12-12 10:49:19,806 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/search 2025-12-12 10:49:19,806 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:49:19,806 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:49:19,806 - root - INFO - Clearing user context 2025-12-12 10:49:19,806 - root - INFO - User context cleared before authentication 2025-12-12 10:49:19,807 - root - INFO - Authorization header received: None 2025-12-12 10:49:19,807 - root - INFO - Authorization header is missing 2025-12-12 10:49:52,578 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:49:52,579 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:49:52,579 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:49:52,579 - root - INFO - Clearing user context 2025-12-12 10:49:52,579 - root - INFO - User context cleared before authentication 2025-12-12 10:49:52,579 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:49:52,581 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:49:52,581 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:52,581 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:49:52,581 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:49:52,582 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:49:52,583 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:49:52,583 - root - INFO - Looking for user with username: admin 2025-12-12 10:49:52,584 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:49:52,584 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:49:52,585 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:49:52,796 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:49:52,853 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:49:52,855 - root - INFO - Clearing user context 2025-12-12 10:52:47,798 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:52:47,798 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:52:47,798 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:52:47,799 - root - INFO - Clearing user context 2025-12-12 10:52:47,799 - root - INFO - User context cleared before authentication 2025-12-12 10:52:47,799 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:52:47,800 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:52:47,800 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:47,800 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:52:47,800 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:52:47,801 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:52:47,801 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:52:47,801 - root - INFO - Looking for user with username: admin 2025-12-12 10:52:47,802 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:52:47,802 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:47,802 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:52:47,804 - root - INFO - Clearing user context 2025-12-12 10:52:49,933 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:52:49,934 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:52:49,934 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:52:49,934 - root - INFO - Clearing user context 2025-12-12 10:52:49,935 - root - INFO - User context cleared before authentication 2025-12-12 10:52:49,935 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:52:49,937 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:52:49,938 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:49,938 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:52:49,939 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:52:49,941 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:52:49,942 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:52:49,942 - root - INFO - Looking for user with username: admin 2025-12-12 10:52:49,944 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:52:49,944 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:49,944 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:52:49,950 - root - INFO - Clearing user context 2025-12-12 10:52:53,918 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:52:53,919 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:52:53,919 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:52:53,919 - root - INFO - Clearing user context 2025-12-12 10:52:53,919 - root - INFO - User context cleared before authentication 2025-12-12 10:52:53,919 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:52:53,920 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:52:53,920 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:53,921 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:52:53,921 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:52:53,922 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:52:53,922 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:52:53,922 - root - INFO - Looking for user with username: admin 2025-12-12 10:52:53,923 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:52:53,923 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:53,923 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:52:53,925 - root - INFO - Clearing user context 2025-12-12 10:52:54,169 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:52:54,170 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:52:54,170 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:52:54,170 - root - INFO - Clearing user context 2025-12-12 10:52:54,170 - root - INFO - User context cleared before authentication 2025-12-12 10:52:54,170 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:52:54,171 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:52:54,171 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:54,172 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:52:54,172 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:52:54,172 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:52:54,173 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:52:54,173 - root - INFO - Looking for user with username: admin 2025-12-12 10:52:54,173 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:52:54,174 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:52:54,174 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:52:54,176 - root - INFO - Clearing user context 2025-12-12 10:55:23,207 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:55:23,207 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:23,207 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:55:23,207 - root - INFO - Clearing user context 2025-12-12 10:55:23,207 - root - INFO - User context cleared before authentication 2025-12-12 10:55:23,208 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:23,208 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:23,209 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:23,209 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:23,209 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:23,210 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:23,210 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:23,210 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:23,211 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:23,211 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:23,211 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:23,511 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:55:23,569 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:55:23,571 - root - INFO - Clearing user context 2025-12-12 10:55:37,645 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 10:55:37,645 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:37,645 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 10:55:37,646 - root - INFO - Clearing user context 2025-12-12 10:55:37,647 - root - INFO - User context cleared before authentication 2025-12-12 10:55:37,647 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:37,649 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:37,649 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,650 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:37,650 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:37,654 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:37,655 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:37,656 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:37,658 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:37,660 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,660 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:37,665 - root - INFO - Clearing user context 2025-12-12 10:55:37,673 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 10:55:37,673 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:37,674 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 10:55:37,674 - root - INFO - Clearing user context 2025-12-12 10:55:37,674 - root - INFO - User context cleared before authentication 2025-12-12 10:55:37,675 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:37,678 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:37,678 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,679 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:37,680 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:37,682 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:37,683 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:37,684 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:37,686 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:37,687 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,688 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:37,692 - root - INFO - Clearing user context 2025-12-12 10:55:37,854 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 10:55:37,855 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:37,855 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 10:55:37,855 - root - INFO - Clearing user context 2025-12-12 10:55:37,856 - root - INFO - User context cleared before authentication 2025-12-12 10:55:37,856 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:37,857 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:37,858 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,859 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:37,859 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:37,860 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 10:55:37,861 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:37,861 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 10:55:37,862 - root - INFO - Clearing user context 2025-12-12 10:55:37,863 - root - INFO - User context cleared before authentication 2025-12-12 10:55:37,863 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:37,866 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:37,867 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,867 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:37,868 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:37,879 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:37,880 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:37,880 - root - INFO - Clearing user context 2025-12-12 10:55:37,881 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:37,884 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:37,884 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,885 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:37,900 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 10:55:37,901 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:37,902 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 10:55:37,903 - root - INFO - Clearing user context 2025-12-12 10:55:37,903 - root - INFO - User context cleared before authentication 2025-12-12 10:55:37,904 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:37,906 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:37,907 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:37,907 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:37,908 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:37,910 - root - INFO - Clearing user context 2025-12-12 10:55:37,914 - root - INFO - Clearing user context 2025-12-12 10:55:40,942 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:55:40,943 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:40,943 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:55:40,943 - root - INFO - Clearing user context 2025-12-12 10:55:40,944 - root - INFO - User context cleared before authentication 2025-12-12 10:55:40,944 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:40,946 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:40,946 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:40,946 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:40,947 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:40,948 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:40,949 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:40,949 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:40,951 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:40,952 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:40,952 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:40,958 - root - INFO - Clearing user context 2025-12-12 10:55:45,926 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 10:55:45,926 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:55:45,927 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 10:55:45,927 - root - INFO - Clearing user context 2025-12-12 10:55:45,927 - root - INFO - User context cleared before authentication 2025-12-12 10:55:45,928 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:55:45,929 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:55:45,930 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:45,930 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:55:45,931 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:55:45,933 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:55:45,933 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:55:45,934 - root - INFO - Looking for user with username: admin 2025-12-12 10:55:45,935 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:55:45,936 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:55:45,936 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:55:45,940 - root - INFO - Clearing user context 2025-12-12 10:56:04,144 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:56:04,146 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:56:04,146 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:56:04,146 - root - INFO - Clearing user context 2025-12-12 10:56:04,147 - root - INFO - User context cleared before authentication 2025-12-12 10:56:04,147 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:56:04,148 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:56:04,149 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:56:04,149 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:56:04,149 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:56:04,154 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:56:04,155 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:56:04,155 - root - INFO - Looking for user with username: admin 2025-12-12 10:56:04,156 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:56:04,156 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:56:04,157 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:56:04,323 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:56:04,392 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:56:04,402 - root - INFO - Clearing user context 2025-12-12 10:56:20,214 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:56:20,215 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:56:20,216 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:56:20,217 - root - INFO - Clearing user context 2025-12-12 10:56:20,217 - root - INFO - User context cleared before authentication 2025-12-12 10:56:20,217 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:56:20,219 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:56:20,220 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:56:20,220 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:56:20,220 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:56:20,223 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:56:20,224 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:56:20,224 - root - INFO - Looking for user with username: admin 2025-12-12 10:56:20,226 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:56:20,226 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:56:20,226 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:56:20,405 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:56:20,458 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:56:20,460 - root - INFO - Clearing user context 2025-12-12 10:58:26,949 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 10:58:26,951 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 10:58:26,951 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 10:58:26,951 - root - INFO - Clearing user context 2025-12-12 10:58:26,951 - root - INFO - User context cleared before authentication 2025-12-12 10:58:26,951 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 10:58:26,952 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 10:58:26,953 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:58:26,954 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 10:58:26,954 - root - INFO - Verified current user ID in context: 2 2025-12-12 10:58:26,956 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 10:58:26,956 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 10:58:26,956 - root - INFO - Looking for user with username: admin 2025-12-12 10:58:26,957 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 10:58:26,957 - root - INFO - Verification - ContextVar user: admin 2025-12-12 10:58:26,958 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 10:58:27,273 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 10:58:27,331 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 10:58:27,332 - root - INFO - Clearing user context 2025-12-12 11:00:23,502 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:00:23,503 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:00:23,503 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:00:23,503 - root - INFO - Clearing user context 2025-12-12 11:00:23,504 - root - INFO - User context cleared before authentication 2025-12-12 11:00:23,504 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:00:23,506 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:00:23,506 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:00:23,507 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:00:23,507 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:00:23,509 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:00:23,510 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:00:23,510 - root - INFO - Looking for user with username: admin 2025-12-12 11:00:23,513 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:00:23,513 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:00:23,514 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:00:23,526 - root - INFO - Clearing user context 2025-12-12 11:00:23,554 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:00:23,555 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:00:23,555 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:00:23,556 - root - INFO - Clearing user context 2025-12-12 11:00:23,556 - root - INFO - User context cleared before authentication 2025-12-12 11:00:23,556 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:00:23,558 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:00:23,559 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:00:23,559 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:00:23,560 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:00:23,563 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:00:23,563 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:00:23,564 - root - INFO - Looking for user with username: admin 2025-12-12 11:00:23,565 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:00:23,565 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:00:23,565 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:00:23,577 - root - INFO - Clearing user context 2025-12-12 11:01:39,466 - root - INFO - Logging configured successfully 2025-12-12 11:01:39,573 - root - INFO - Logging configured successfully 2025-12-12 11:01:39,663 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:01:39,673 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:01:39,677 - root - INFO - Database tables created 2025-12-12 11:01:39,678 - root - INFO - Database initialized 2025-12-12 11:01:47,364 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 11:01:47,365 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:47,365 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 11:01:47,366 - root - INFO - Clearing user context 2025-12-12 11:01:47,366 - root - INFO - User context cleared before authentication 2025-12-12 11:01:47,366 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:47,406 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:47,407 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,407 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:47,408 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:47,413 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:01:47,413 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:01:47,414 - root - INFO - Looking for user with username: admin 2025-12-12 11:01:47,415 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:01:47,415 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,416 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:01:47,422 - root - INFO - Clearing user context 2025-12-12 11:01:47,434 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 11:01:47,435 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:47,435 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 11:01:47,435 - root - INFO - Clearing user context 2025-12-12 11:01:47,435 - root - INFO - User context cleared before authentication 2025-12-12 11:01:47,436 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:47,437 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:47,438 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,438 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:47,438 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:47,439 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:01:47,440 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:01:47,440 - root - INFO - Looking for user with username: admin 2025-12-12 11:01:47,441 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:01:47,441 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,442 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:01:47,449 - root - INFO - Clearing user context 2025-12-12 11:01:47,714 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:01:47,714 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:47,715 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:01:47,715 - root - INFO - Clearing user context 2025-12-12 11:01:47,715 - root - INFO - User context cleared before authentication 2025-12-12 11:01:47,715 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:47,716 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:47,717 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,717 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:47,717 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:47,719 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 11:01:47,719 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:47,719 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 11:01:47,720 - root - INFO - Clearing user context 2025-12-12 11:01:47,720 - root - INFO - User context cleared before authentication 2025-12-12 11:01:47,720 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:47,721 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:47,722 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,722 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:47,722 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:47,725 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:01:47,730 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:01:47,730 - root - INFO - Looking for user with username: admin 2025-12-12 11:01:47,735 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:01:47,735 - root - INFO - Clearing user context 2025-12-12 11:01:47,736 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,737 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:01:47,768 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 11:01:47,769 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:47,769 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 11:01:47,769 - root - INFO - Clearing user context 2025-12-12 11:01:47,770 - root - INFO - User context cleared before authentication 2025-12-12 11:01:47,771 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:47,773 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:47,774 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:47,774 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:47,775 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:47,775 - root - INFO - Clearing user context 2025-12-12 11:01:47,781 - root - INFO - Clearing user context 2025-12-12 11:01:51,167 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:01:51,169 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:01:51,169 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:01:51,169 - root - INFO - Clearing user context 2025-12-12 11:01:51,169 - root - INFO - User context cleared before authentication 2025-12-12 11:01:51,171 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:01:51,172 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:01:51,173 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:51,174 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:01:51,174 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:01:51,176 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:01:51,177 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:01:51,177 - root - INFO - Looking for user with username: admin 2025-12-12 11:01:51,179 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:01:51,180 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:01:51,180 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:01:51,188 - root - INFO - Clearing user context 2025-12-12 11:02:12,306 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 11:02:12,306 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:12,307 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 11:02:12,307 - root - INFO - Clearing user context 2025-12-12 11:02:12,307 - root - INFO - User context cleared before authentication 2025-12-12 11:02:12,307 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:12,308 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:12,308 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,309 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:12,309 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:12,310 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:02:12,311 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:02:12,311 - root - INFO - Looking for user with username: admin 2025-12-12 11:02:12,312 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:02:12,312 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,312 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:02:12,314 - root - INFO - Clearing user context 2025-12-12 11:02:12,415 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 11:02:12,415 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:12,416 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 11:02:12,416 - root - INFO - Clearing user context 2025-12-12 11:02:12,416 - root - INFO - User context cleared before authentication 2025-12-12 11:02:12,416 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:12,417 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:12,417 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,418 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:12,418 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:12,419 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:02:12,420 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:02:12,420 - root - INFO - Looking for user with username: admin 2025-12-12 11:02:12,420 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:02:12,421 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,421 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:02:12,423 - root - INFO - Clearing user context 2025-12-12 11:02:12,579 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:02:12,579 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:12,579 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:02:12,580 - root - INFO - Clearing user context 2025-12-12 11:02:12,580 - root - INFO - User context cleared before authentication 2025-12-12 11:02:12,580 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:12,581 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:12,582 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,582 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:12,582 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:12,584 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 11:02:12,584 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:12,584 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 11:02:12,584 - root - INFO - Clearing user context 2025-12-12 11:02:12,585 - root - INFO - User context cleared before authentication 2025-12-12 11:02:12,585 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:12,587 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:12,587 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,588 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:12,588 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:12,596 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:02:12,597 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:02:12,597 - root - INFO - Clearing user context 2025-12-12 11:02:12,597 - root - INFO - Looking for user with username: admin 2025-12-12 11:02:12,601 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:02:12,601 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,602 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:02:12,613 - root - INFO - Clearing user context 2025-12-12 11:02:12,641 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 11:02:12,642 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:12,642 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 11:02:12,643 - root - INFO - Clearing user context 2025-12-12 11:02:12,643 - root - INFO - User context cleared before authentication 2025-12-12 11:02:12,644 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:12,646 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:12,646 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:12,646 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:12,647 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:12,651 - root - INFO - Clearing user context 2025-12-12 11:02:17,253 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:02:17,253 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:17,254 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:02:17,254 - root - INFO - Clearing user context 2025-12-12 11:02:17,254 - root - INFO - User context cleared before authentication 2025-12-12 11:02:17,254 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:17,256 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:17,257 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:17,257 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:17,257 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:17,260 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:02:17,260 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:02:17,260 - root - INFO - Looking for user with username: admin 2025-12-12 11:02:17,262 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:02:17,262 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:17,262 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:02:17,267 - root - INFO - Clearing user context 2025-12-12 11:02:41,279 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:02:41,279 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:02:41,280 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:02:41,280 - root - INFO - Clearing user context 2025-12-12 11:02:41,281 - root - INFO - User context cleared before authentication 2025-12-12 11:02:41,281 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:02:41,283 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:02:41,283 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:41,283 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:02:41,284 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:02:41,287 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:02:41,287 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:02:41,288 - root - INFO - Looking for user with username: admin 2025-12-12 11:02:41,289 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:02:41,290 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:02:41,290 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:02:41,301 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 11:02:41,384 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 11:02:41,388 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 11:02:42,061 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:02:42,122 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 11:02:42,123 - root - INFO - Clearing user context 2025-12-12 11:18:32,004 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 11:18:43,322 - root - INFO - Logging configured successfully 2025-12-12 11:18:43,448 - root - INFO - Logging configured successfully 2025-12-12 11:18:43,543 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:18:43,554 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:18:43,558 - root - INFO - Database tables created 2025-12-12 11:18:43,559 - root - INFO - Database initialized 2025-12-12 11:18:52,468 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:18:52,468 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:18:52,468 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:18:52,468 - root - INFO - Clearing user context 2025-12-12 11:18:52,469 - root - INFO - User context cleared before authentication 2025-12-12 11:18:52,469 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:18:52,495 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:18:52,496 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:18:52,496 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:18:52,496 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:18:52,501 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:18:52,502 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:18:52,502 - root - INFO - Looking for user with username: admin 2025-12-12 11:18:52,504 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:18:52,505 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:18:52,505 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:18:52,510 - th_agenter.services.document - ERROR - Failed to upload document: File type .doc not allowed 2025-12-12 11:18:52,511 - root - ERROR - Database session error: 500: Failed to upload document: File type .doc not allowed 2025-12-12 11:18:52,511 - root - INFO - Clearing user context 2025-12-12 11:19:12,728 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:19:12,729 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:19:12,729 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:19:12,729 - root - INFO - Clearing user context 2025-12-12 11:19:12,729 - root - INFO - User context cleared before authentication 2025-12-12 11:19:12,730 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:19:12,731 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:19:12,731 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:19:12,732 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:19:12,732 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:19:12,734 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:19:12,735 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:19:12,735 - root - INFO - Looking for user with username: admin 2025-12-12 11:19:12,737 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:19:12,737 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:19:12,738 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:19:12,739 - th_agenter.services.document - ERROR - Failed to upload document: File type .doc not allowed 2025-12-12 11:19:12,740 - root - ERROR - Database session error: 500: Failed to upload document: File type .doc not allowed 2025-12-12 11:19:12,741 - root - INFO - Clearing user context 2025-12-12 11:20:15,839 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 11:20:24,885 - root - INFO - Logging configured successfully 2025-12-12 11:20:24,999 - root - INFO - Logging configured successfully 2025-12-12 11:20:25,096 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:20:25,106 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:20:25,110 - root - INFO - Database tables created 2025-12-12 11:20:25,110 - root - INFO - Database initialized 2025-12-12 11:20:34,053 - root - INFO - Logging configured successfully 2025-12-12 11:20:34,157 - root - INFO - Logging configured successfully 2025-12-12 11:20:34,246 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:20:34,254 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:20:34,258 - root - INFO - Database tables created 2025-12-12 11:20:34,259 - root - INFO - Database initialized 2025-12-12 11:20:42,738 - root - INFO - Logging configured successfully 2025-12-12 11:20:42,843 - root - INFO - Logging configured successfully 2025-12-12 11:20:42,932 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:20:42,939 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:20:42,943 - root - INFO - Database tables created 2025-12-12 11:20:42,943 - root - INFO - Database initialized 2025-12-12 11:20:51,417 - root - INFO - Logging configured successfully 2025-12-12 11:20:51,516 - root - INFO - Logging configured successfully 2025-12-12 11:20:51,609 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:20:51,616 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:20:51,621 - root - INFO - Database tables created 2025-12-12 11:20:51,622 - root - INFO - Database initialized 2025-12-12 11:20:59,369 - root - INFO - Logging configured successfully 2025-12-12 11:20:59,475 - root - INFO - Logging configured successfully 2025-12-12 11:20:59,568 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:20:59,577 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:20:59,580 - root - INFO - Database tables created 2025-12-12 11:20:59,581 - root - INFO - Database initialized 2025-12-12 11:23:11,179 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 11:23:22,620 - root - INFO - Logging configured successfully 2025-12-12 11:23:22,724 - root - INFO - Logging configured successfully 2025-12-12 11:23:22,813 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:23:22,819 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:23:22,823 - root - INFO - Database tables created 2025-12-12 11:23:22,823 - root - INFO - Database initialized 2025-12-12 11:23:32,756 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 11:23:32,757 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:32,757 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 11:23:32,757 - root - INFO - Clearing user context 2025-12-12 11:23:32,758 - root - INFO - User context cleared before authentication 2025-12-12 11:23:32,758 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:32,783 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:32,784 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,784 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:32,784 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:32,787 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:23:32,788 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:23:32,789 - root - INFO - Looking for user with username: admin 2025-12-12 11:23:32,790 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:23:32,790 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,790 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:23:32,798 - root - INFO - Clearing user context 2025-12-12 11:23:32,804 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 11:23:32,804 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:32,805 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 11:23:32,805 - root - INFO - Clearing user context 2025-12-12 11:23:32,805 - root - INFO - User context cleared before authentication 2025-12-12 11:23:32,806 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:32,808 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:32,808 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,808 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:32,809 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:32,810 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:23:32,810 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:23:32,810 - root - INFO - Looking for user with username: admin 2025-12-12 11:23:32,812 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:23:32,812 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,812 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:23:32,818 - root - INFO - Clearing user context 2025-12-12 11:23:32,986 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:23:32,986 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:32,987 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:23:32,987 - root - INFO - Clearing user context 2025-12-12 11:23:32,987 - root - INFO - User context cleared before authentication 2025-12-12 11:23:32,987 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:32,989 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:32,989 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,989 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:32,989 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:32,990 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 11:23:32,990 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:32,990 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 11:23:32,990 - root - INFO - Clearing user context 2025-12-12 11:23:32,990 - root - INFO - User context cleared before authentication 2025-12-12 11:23:32,991 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:32,992 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:32,992 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:32,992 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:32,992 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:32,996 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:23:32,997 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:23:32,998 - root - INFO - Looking for user with username: admin 2025-12-12 11:23:33,003 - root - INFO - Clearing user context 2025-12-12 11:23:33,004 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:23:33,004 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:33,005 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:23:33,027 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 11:23:33,027 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:33,027 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 11:23:33,027 - root - INFO - Clearing user context 2025-12-12 11:23:33,028 - root - INFO - User context cleared before authentication 2025-12-12 11:23:33,028 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:33,030 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:33,030 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:33,031 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:33,031 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:33,033 - root - INFO - Clearing user context 2025-12-12 11:23:33,037 - root - INFO - Clearing user context 2025-12-12 11:23:34,734 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:23:34,735 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:34,735 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:23:34,735 - root - INFO - Clearing user context 2025-12-12 11:23:34,736 - root - INFO - User context cleared before authentication 2025-12-12 11:23:34,736 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:34,737 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:34,737 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:34,738 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:34,738 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:34,740 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:23:34,740 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:23:34,740 - root - INFO - Looking for user with username: admin 2025-12-12 11:23:34,742 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:23:34,742 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:34,742 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:23:34,749 - root - INFO - Clearing user context 2025-12-12 11:23:39,139 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:23:39,140 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:23:39,140 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:23:39,141 - root - INFO - Clearing user context 2025-12-12 11:23:39,141 - root - INFO - User context cleared before authentication 2025-12-12 11:23:39,141 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:23:39,142 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:23:39,143 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:39,143 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:23:39,143 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:23:39,146 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:23:39,147 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:23:39,147 - root - INFO - Looking for user with username: admin 2025-12-12 11:23:39,148 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:23:39,148 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:23:39,149 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:23:39,151 - th_agenter.services.document - ERROR - Failed to upload document: File type .doc not allowed 2025-12-12 11:23:39,152 - root - ERROR - Database session error: 500: Failed to upload document: File type .doc not allowed 2025-12-12 11:23:39,153 - root - INFO - Clearing user context 2025-12-12 11:26:19,068 - root - INFO - Shutting down TH-Agenter application... 2025-12-12 11:26:28,095 - root - INFO - Logging configured successfully 2025-12-12 11:26:28,221 - root - INFO - Logging configured successfully 2025-12-12 11:26:28,332 - root - INFO - Starting up TH-Agenter application... 2025-12-12 11:26:28,341 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-12 11:26:28,344 - root - INFO - Database tables created 2025-12-12 11:26:28,345 - root - INFO - Database initialized 2025-12-12 11:26:34,726 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-12 11:26:34,727 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:34,727 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-12 11:26:34,727 - root - INFO - Clearing user context 2025-12-12 11:26:34,727 - root - INFO - User context cleared before authentication 2025-12-12 11:26:34,728 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:34,750 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:34,750 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,751 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:34,751 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:34,753 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:34,755 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:34,755 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:34,756 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:34,756 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,756 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:34,761 - root - INFO - Clearing user context 2025-12-12 11:26:34,769 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-12 11:26:34,769 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:34,769 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-12 11:26:34,770 - root - INFO - Clearing user context 2025-12-12 11:26:34,770 - root - INFO - User context cleared before authentication 2025-12-12 11:26:34,770 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:34,771 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:34,772 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,772 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:34,772 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:34,774 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:34,774 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:34,774 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:34,776 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:34,776 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,776 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:34,782 - root - INFO - Clearing user context 2025-12-12 11:26:34,990 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-12 11:26:34,990 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:34,990 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-12 11:26:34,991 - root - INFO - Clearing user context 2025-12-12 11:26:34,991 - root - INFO - User context cleared before authentication 2025-12-12 11:26:34,991 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:34,993 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:34,993 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,994 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:34,994 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:34,995 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-12 11:26:34,995 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:34,995 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-12 11:26:34,995 - root - INFO - Clearing user context 2025-12-12 11:26:34,995 - root - INFO - User context cleared before authentication 2025-12-12 11:26:34,995 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:34,997 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:34,997 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:34,997 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:34,997 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:35,005 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:35,007 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:35,007 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:35,008 - root - INFO - Clearing user context 2025-12-12 11:26:35,009 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:35,009 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:35,010 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:35,029 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-12 11:26:35,029 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:35,030 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-12 11:26:35,030 - root - INFO - Clearing user context 2025-12-12 11:26:35,031 - root - INFO - User context cleared before authentication 2025-12-12 11:26:35,031 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:35,032 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:35,032 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:35,033 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:35,033 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:35,034 - root - INFO - Clearing user context 2025-12-12 11:26:35,038 - root - INFO - Clearing user context 2025-12-12 11:26:37,533 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:26:37,534 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:37,534 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:26:37,535 - root - INFO - Clearing user context 2025-12-12 11:26:37,535 - root - INFO - User context cleared before authentication 2025-12-12 11:26:37,535 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:37,537 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:37,537 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:37,538 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:37,538 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:37,540 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:37,540 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:37,541 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:37,542 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:37,543 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:37,543 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:37,550 - root - INFO - Clearing user context 2025-12-12 11:26:42,236 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:26:42,237 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:42,237 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:26:42,237 - root - INFO - Clearing user context 2025-12-12 11:26:42,238 - root - INFO - User context cleared before authentication 2025-12-12 11:26:42,238 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:42,239 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:42,239 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:42,239 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:42,239 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:42,242 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:42,243 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:42,243 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:42,244 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:42,245 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:42,245 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:42,355 - th_agenter.services.document - INFO - Uploaded document: 链家租房合同.doc to KB 6 (Doc ID: 4) 2025-12-12 11:26:42,361 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-12 11:26:42,429 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-12 11:26:42,434 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-12 11:26:42,436 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 4, 路径: E:\Work\HXF\backend\data\uploads\kb_6\8421beca-842b-4475-af39-3369acd081bc_链家租房合同.doc 2025-12-12 11:26:42,437 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF\backend\data\uploads\kb_6\8421beca-842b-4475-af39-3369acd081bc_链家租房合同.doc: No module named 'docx2txt' 2025-12-12 11:26:42,438 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 4: No module named 'docx2txt' 2025-12-12 11:26:42,443 - root - INFO - Clearing user context 2025-12-12 11:26:44,467 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:26:44,467 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:26:44,467 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:26:44,467 - root - INFO - Clearing user context 2025-12-12 11:26:44,467 - root - INFO - User context cleared before authentication 2025-12-12 11:26:44,467 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:26:44,469 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:26:44,469 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:44,469 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:26:44,469 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:26:44,470 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:26:44,471 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:26:44,471 - root - INFO - Looking for user with username: admin 2025-12-12 11:26:44,472 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:26:44,472 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:26:44,472 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:26:44,475 - root - INFO - Clearing user context 2025-12-12 11:27:10,974 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:27:10,975 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:10,975 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:27:10,975 - root - INFO - Clearing user context 2025-12-12 11:27:10,976 - root - INFO - User context cleared before authentication 2025-12-12 11:27:10,977 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:10,978 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:10,979 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:10,980 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:10,980 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:10,982 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:10,983 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:10,983 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:10,984 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:10,985 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:10,985 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:11,711 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:27:11,775 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 11:27:11,778 - root - INFO - Clearing user context 2025-12-12 11:27:35,765 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents/3/chunks 2025-12-12 11:27:35,766 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/3/chunks against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:35,766 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/3/chunks 2025-12-12 11:27:35,766 - root - INFO - Clearing user context 2025-12-12 11:27:35,766 - root - INFO - User context cleared before authentication 2025-12-12 11:27:35,767 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:35,768 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:35,768 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:35,769 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:35,769 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:35,770 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:35,771 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:35,771 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:35,773 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:35,774 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:35,774 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:35,848 - th_agenter.services.document_processor - INFO - 通过SQLAlchemy连接池查询获取到文档 3 的 7 个分段 2025-12-12 11:27:35,849 - th_agenter.services.document - INFO - Retrieved 7 chunks for document 3 2025-12-12 11:27:35,850 - root - INFO - Clearing user context 2025-12-12 11:27:41,071 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/6/documents/3 2025-12-12 11:27:41,072 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:41,073 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/3 2025-12-12 11:27:41,073 - root - INFO - Clearing user context 2025-12-12 11:27:41,073 - root - INFO - User context cleared before authentication 2025-12-12 11:27:41,073 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:41,074 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:41,075 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:41,075 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:41,075 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:41,077 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:41,077 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:41,078 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:41,080 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:41,080 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:41,080 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:41,088 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF\backend\data\uploads\kb_6\65483448-1076-499a-915e-4ded81664153_周报.txt 2025-12-12 11:27:41,171 - th_agenter.services.document_processor - INFO - 成功删除 7 个文档块: document_id=3 2025-12-12 11:27:41,172 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=3 2025-12-12 11:27:41,183 - th_agenter.services.document - INFO - Deleted document: 65483448-1076-499a-915e-4ded81664153_周报.txt (ID: 3) 2025-12-12 11:27:41,185 - root - INFO - Clearing user context 2025-12-12 11:27:41,499 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:27:41,499 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:41,500 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:27:41,500 - root - INFO - Clearing user context 2025-12-12 11:27:41,500 - root - INFO - User context cleared before authentication 2025-12-12 11:27:41,500 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:41,502 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:41,504 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:41,505 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:41,505 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:41,507 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:41,508 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:41,508 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:41,510 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:41,510 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:41,510 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:41,515 - root - INFO - Clearing user context 2025-12-12 11:27:44,981 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:27:44,981 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:44,982 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:27:44,982 - root - INFO - Clearing user context 2025-12-12 11:27:44,983 - root - INFO - User context cleared before authentication 2025-12-12 11:27:44,983 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:44,985 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:44,985 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:44,985 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:44,986 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:44,987 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:44,987 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:44,988 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:44,989 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:44,989 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:44,989 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:44,993 - root - INFO - Clearing user context 2025-12-12 11:27:52,810 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:27:52,810 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:27:52,810 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:27:52,810 - root - INFO - Clearing user context 2025-12-12 11:27:52,811 - root - INFO - User context cleared before authentication 2025-12-12 11:27:52,811 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:27:52,812 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:27:52,812 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:52,812 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:27:52,812 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:27:52,814 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:27:52,814 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:27:52,814 - root - INFO - Looking for user with username: admin 2025-12-12 11:27:52,815 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:27:52,815 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:27:52,815 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:27:53,100 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:27:53,151 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:27:53,153 - root - INFO - Clearing user context 2025-12-12 11:28:04,934 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:28:04,934 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:28:04,934 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:28:04,934 - root - INFO - Clearing user context 2025-12-12 11:28:04,935 - root - INFO - User context cleared before authentication 2025-12-12 11:28:04,935 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:28:04,936 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:28:04,936 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:28:04,937 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:28:04,937 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:28:04,940 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:28:04,941 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:28:04,941 - root - INFO - Looking for user with username: admin 2025-12-12 11:28:04,942 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:28:04,943 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:28:04,943 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:28:05,247 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:28:05,298 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:28:05,299 - root - INFO - Clearing user context 2025-12-12 11:28:14,259 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:28:14,259 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:28:14,259 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:28:14,260 - root - INFO - Clearing user context 2025-12-12 11:28:14,260 - root - INFO - User context cleared before authentication 2025-12-12 11:28:14,260 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:28:14,261 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:28:14,261 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:28:14,262 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:28:14,262 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:28:14,263 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:28:14,263 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:28:14,263 - root - INFO - Looking for user with username: admin 2025-12-12 11:28:14,264 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:28:14,264 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:28:14,264 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:28:14,472 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:28:14,523 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:28:14,525 - root - INFO - Clearing user context 2025-12-12 11:29:03,181 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:29:03,181 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:29:03,182 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:29:03,182 - root - INFO - Clearing user context 2025-12-12 11:29:03,182 - root - INFO - User context cleared before authentication 2025-12-12 11:29:03,182 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:29:03,184 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:29:03,184 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:29:03,184 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:29:03,185 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:29:03,187 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:29:03,187 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:29:03,187 - root - INFO - Looking for user with username: admin 2025-12-12 11:29:03,188 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:29:03,188 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:29:03,189 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:29:03,474 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:29:03,525 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:29:03,526 - root - INFO - Clearing user context 2025-12-12 11:30:32,003 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/6/documents/4 2025-12-12 11:30:32,004 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:32,004 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/4 2025-12-12 11:30:32,004 - root - INFO - Clearing user context 2025-12-12 11:30:32,004 - root - INFO - User context cleared before authentication 2025-12-12 11:30:32,005 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:32,006 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:32,006 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:32,006 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:32,006 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:32,007 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:32,007 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:32,007 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:32,008 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:32,008 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:32,008 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:32,010 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF\backend\data\uploads\kb_6\8421beca-842b-4475-af39-3369acd081bc_链家租房合同.doc 2025-12-12 11:30:32,060 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=4 2025-12-12 11:30:32,061 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=4 2025-12-12 11:30:32,067 - th_agenter.services.document - INFO - Deleted document: 8421beca-842b-4475-af39-3369acd081bc_链家租房合同.doc (ID: 4) 2025-12-12 11:30:32,068 - root - INFO - Clearing user context 2025-12-12 11:30:32,268 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:30:32,268 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:32,268 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:32,268 - root - INFO - Clearing user context 2025-12-12 11:30:32,269 - root - INFO - User context cleared before authentication 2025-12-12 11:30:32,269 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:32,270 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:32,270 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:32,270 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:32,271 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:32,272 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:32,272 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:32,272 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:32,273 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:32,273 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:32,274 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:32,277 - root - INFO - Clearing user context 2025-12-12 11:30:35,426 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:30:35,427 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:35,427 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:35,427 - root - INFO - Clearing user context 2025-12-12 11:30:35,427 - root - INFO - User context cleared before authentication 2025-12-12 11:30:35,428 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:35,429 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:35,430 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:35,430 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:35,430 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:35,450 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:35,450 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:35,451 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:35,452 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:35,452 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:35,453 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:35,471 - th_agenter.services.document - INFO - Uploaded document: 发明专利申请说明书CN202411808464.5.pdf to KB 6 (Doc ID: 3) 2025-12-12 11:30:35,474 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 3, 路径: E:\Work\HXF\backend\data\uploads\kb_6\3b7f98d3-ba4c-49e2-a410-690ef42ec2e6_发明专利申请说明书CN202411808464.5.pdf 2025-12-12 11:30:35,497 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF\backend\data\uploads\kb_6\3b7f98d3-ba4c-49e2-a410-690ef42ec2e6_发明专利申请说明书CN202411808464.5.pdf, 页数: 0 2025-12-12 11:30:35,497 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-12 11:30:35,555 - th_agenter.services.document_processor - WARNING - 连接现有向量存储失败,创建新的向量存储: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 11:30:35,606 - th_agenter.services.document_processor - ERROR - 创建向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 11:30:35,607 - th_agenter.services.document_processor - ERROR - 添加文档到向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 11:30:35,607 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 3: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-12 11:30:35,609 - root - INFO - Clearing user context 2025-12-12 11:30:37,933 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:30:37,934 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:37,934 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:37,934 - root - INFO - Clearing user context 2025-12-12 11:30:37,934 - root - INFO - User context cleared before authentication 2025-12-12 11:30:37,934 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:37,935 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:37,936 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:37,936 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:37,936 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:37,937 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:37,938 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:37,938 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:37,939 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:37,939 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:37,940 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:37,943 - root - INFO - Clearing user context 2025-12-12 11:30:38,652 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:30:38,653 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:38,653 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:38,654 - root - INFO - Clearing user context 2025-12-12 11:30:38,655 - root - INFO - User context cleared before authentication 2025-12-12 11:30:38,655 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:38,657 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:38,657 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:38,658 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:38,658 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:38,661 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:38,662 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:38,662 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:38,664 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:38,665 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:38,665 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:38,671 - root - INFO - Clearing user context 2025-12-12 11:30:44,406 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:30:44,406 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:44,406 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:30:44,406 - root - INFO - Clearing user context 2025-12-12 11:30:44,407 - root - INFO - User context cleared before authentication 2025-12-12 11:30:44,407 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:44,408 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:44,408 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:44,408 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:44,409 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:44,410 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:44,410 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:44,410 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:44,411 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:44,411 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:44,411 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:44,710 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:44,763 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:30:44,764 - root - INFO - Clearing user context 2025-12-12 11:30:53,186 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-12 11:30:53,186 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:53,186 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:53,186 - root - INFO - Clearing user context 2025-12-12 11:30:53,186 - root - INFO - User context cleared before authentication 2025-12-12 11:30:53,187 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:53,187 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:53,188 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:53,188 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:53,188 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:53,190 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:53,190 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:53,190 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:53,191 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:53,191 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:53,191 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:53,205 - th_agenter.services.document - INFO - Uploaded document: 周报.txt to KB 6 (Doc ID: 4) 2025-12-12 11:30:53,208 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 4, 路径: E:\Work\HXF\backend\data\uploads\kb_6\7d5d2079-231b-44c3-abbe-87d40d1c0e9f_周报.txt 2025-12-12 11:30:53,209 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF\backend\data\uploads\kb_6\7d5d2079-231b-44c3-abbe-87d40d1c0e9f_周报.txt, 页数: 1 2025-12-12 11:30:53,213 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-12 11:30:53,214 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-12 11:30:53,215 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 7 个文档块 2025-12-12 11:30:53,499 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:53,636 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:53,777 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:53,910 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:54,027 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:54,137 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:54,243 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:30:54,310 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_6 2025-12-12 11:30:54,321 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 4, 'status': 'success', 'chunks_count': 7, 'message': '文档处理完成'} 2025-12-12 11:30:54,330 - th_agenter.services.document - INFO - Processed document: 7d5d2079-231b-44c3-abbe-87d40d1c0e9f_周报.txt (ID: 4) 2025-12-12 11:30:54,331 - root - INFO - Clearing user context 2025-12-12 11:30:56,338 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:30:56,338 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:30:56,338 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:30:56,339 - root - INFO - Clearing user context 2025-12-12 11:30:56,339 - root - INFO - User context cleared before authentication 2025-12-12 11:30:56,339 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:30:56,340 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:30:56,340 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:56,340 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:30:56,340 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:30:56,341 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:30:56,341 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:30:56,341 - root - INFO - Looking for user with username: admin 2025-12-12 11:30:56,343 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:30:56,343 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:30:56,343 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:30:56,347 - root - INFO - Clearing user context 2025-12-12 11:31:00,568 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:31:00,568 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:31:00,568 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:31:00,569 - root - INFO - Clearing user context 2025-12-12 11:31:00,569 - root - INFO - User context cleared before authentication 2025-12-12 11:31:00,569 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:31:00,570 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:31:00,570 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:31:00,570 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:31:00,570 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:31:00,572 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:31:00,572 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:31:00,572 - root - INFO - Looking for user with username: admin 2025-12-12 11:31:00,573 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:31:00,573 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:31:00,573 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:31:00,919 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:31:00,966 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-12 11:31:00,968 - root - INFO - Clearing user context 2025-12-12 11:33:14,112 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/6/documents/4 2025-12-12 11:33:14,112 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:33:14,112 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents/4 2025-12-12 11:33:14,112 - root - INFO - Clearing user context 2025-12-12 11:33:14,112 - root - INFO - User context cleared before authentication 2025-12-12 11:33:14,112 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:33:14,113 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:33:14,113 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:14,113 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:33:14,113 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:33:14,114 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:33:14,114 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:33:14,114 - root - INFO - Looking for user with username: admin 2025-12-12 11:33:14,116 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:33:14,116 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:14,116 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:33:14,117 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF\backend\data\uploads\kb_6\7d5d2079-231b-44c3-abbe-87d40d1c0e9f_周报.txt 2025-12-12 11:33:14,169 - th_agenter.services.document_processor - INFO - 成功删除 7 个文档块: document_id=4 2025-12-12 11:33:14,170 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=4 2025-12-12 11:33:14,180 - th_agenter.services.document - INFO - Deleted document: 7d5d2079-231b-44c3-abbe-87d40d1c0e9f_周报.txt (ID: 4) 2025-12-12 11:33:14,180 - root - INFO - Clearing user context 2025-12-12 11:33:14,379 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-12 11:33:14,379 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:33:14,380 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-12 11:33:14,380 - root - INFO - Clearing user context 2025-12-12 11:33:14,380 - root - INFO - User context cleared before authentication 2025-12-12 11:33:14,381 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:33:14,382 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:33:14,382 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:14,383 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:33:14,383 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:33:14,385 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:33:14,385 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:33:14,385 - root - INFO - Looking for user with username: admin 2025-12-12 11:33:14,387 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:33:14,387 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:14,387 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:33:14,391 - root - INFO - Clearing user context 2025-12-12 11:33:31,137 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:33:31,137 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:33:31,137 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:33:31,137 - root - INFO - Clearing user context 2025-12-12 11:33:31,138 - root - INFO - User context cleared before authentication 2025-12-12 11:33:31,138 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:33:31,139 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:33:31,139 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:31,139 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:33:31,139 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:33:31,141 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:33:31,141 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:33:31,141 - root - INFO - Looking for user with username: admin 2025-12-12 11:33:31,142 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:33:31,142 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:33:31,142 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:33:31,395 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:33:31,446 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:33:31,447 - root - INFO - Clearing user context 2025-12-12 11:34:18,141 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-12 11:34:18,142 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-12 11:34:18,142 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-12 11:34:18,143 - root - INFO - Clearing user context 2025-12-12 11:34:18,143 - root - INFO - User context cleared before authentication 2025-12-12 11:34:18,143 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-12 11:34:18,145 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-12 11:34:18,146 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:34:18,146 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-12 11:34:18,147 - root - INFO - Verified current user ID in context: 2 2025-12-12 11:34:18,149 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-12 11:34:18,150 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765522807} 2025-12-12 11:34:18,150 - root - INFO - Looking for user with username: admin 2025-12-12 11:34:18,152 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-12 11:34:18,153 - root - INFO - Verification - ContextVar user: admin 2025-12-12 11:34:18,153 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-12 11:34:18,438 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-12 11:34:18,487 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-12 11:34:18,488 - root - INFO - Clearing user context 2025-12-13 09:11:40,748 - root - INFO - Logging configured successfully 2025-12-13 09:11:40,848 - root - INFO - Logging configured successfully 2025-12-13 09:11:40,945 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:11:40,959 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:11:40,975 - root - INFO - Database tables created 2025-12-13 09:11:40,975 - root - INFO - Database initialized 2025-12-13 09:12:49,119 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 09:12:49,119 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:49,119 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 09:12:49,119 - root - INFO - Clearing user context 2025-12-13 09:12:49,119 - root - INFO - User context cleared before authentication 2025-12-13 09:12:49,119 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-13 09:12:49,119 - root - ERROR - Token verification failed: Signature has expired 2025-12-13 09:12:49,119 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:49,119 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-13 09:12:49,119 - root - ERROR - Algorithm: HS256 2025-12-13 09:12:49,281 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 09:12:49,282 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:49,283 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 09:12:49,283 - root - INFO - Clearing user context 2025-12-13 09:12:49,284 - root - INFO - User context cleared before authentication 2025-12-13 09:12:49,284 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-13 09:12:49,284 - root - ERROR - Token verification failed: Signature has expired 2025-12-13 09:12:49,284 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:49,285 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-13 09:12:49,285 - root - ERROR - Algorithm: HS256 2025-12-13 09:12:49,756 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 09:12:49,756 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:49,756 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 09:12:49,756 - root - INFO - Clearing user context 2025-12-13 09:12:49,756 - root - INFO - User context cleared before authentication 2025-12-13 09:12:49,756 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTUyMjgwN30.n5-OFuwNd0KoAllZQljLOTuBRYPary0TBuwRBJulfTQ 2025-12-13 09:12:49,756 - root - ERROR - Token verification failed: Signature has expired 2025-12-13 09:12:49,756 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:49,756 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-13 09:12:49,756 - root - ERROR - Algorithm: HS256 2025-12-13 09:12:53,813 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-13 09:12:53,813 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:53,814 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-13 09:12:53,814 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-13 09:12:54,157 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 09:12:54,157 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,157 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 09:12:54,157 - root - INFO - Clearing user context 2025-12-13 09:12:54,157 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,157 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,163 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,170 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,170 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,170 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,174 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:54,176 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:12:54,181 - root - INFO - Looking for user with username: admin 2025-12-13 09:12:54,183 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:12:54,184 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,186 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:12:54,196 - root - INFO - Clearing user context 2025-12-13 09:12:54,202 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-13 09:12:54,202 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,202 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-13 09:12:54,202 - root - INFO - Clearing user context 2025-12-13 09:12:54,202 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,202 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,206 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,207 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,207 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,207 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,209 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:54,210 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:12:54,210 - root - INFO - Looking for user with username: admin 2025-12-13 09:12:54,211 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:12:54,212 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,212 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:12:54,220 - root - INFO - Clearing user context 2025-12-13 09:12:54,309 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 09:12:54,310 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,311 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 09:12:54,311 - root - INFO - Clearing user context 2025-12-13 09:12:54,311 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,312 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,312 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,312 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,322 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,323 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,324 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 09:12:54,325 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,325 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 09:12:54,326 - root - INFO - Clearing user context 2025-12-13 09:12:54,326 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,326 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,332 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,333 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,335 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,335 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,360 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:54,360 - root - INFO - Clearing user context 2025-12-13 09:12:54,361 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:12:54,363 - root - INFO - Looking for user with username: admin 2025-12-13 09:12:54,363 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:12:54,363 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 09:12:54,378 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,377 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,379 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 09:12:54,379 - root - INFO - Clearing user context 2025-12-13 09:12:54,379 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:12:54,388 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,389 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,392 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,393 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,393 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,397 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,436 - root - INFO - Clearing user context 2025-12-13 09:12:54,439 - root - INFO - Clearing user context 2025-12-13 09:12:54,702 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 09:12:54,702 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,702 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 09:12:54,702 - root - INFO - Clearing user context 2025-12-13 09:12:54,702 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,702 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,702 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,702 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,702 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,702 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,709 - root - INFO - Clearing user context 2025-12-13 09:12:54,747 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 09:12:54,747 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,747 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 09:12:54,747 - root - INFO - Clearing user context 2025-12-13 09:12:54,747 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,747 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,748 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,749 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,749 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,749 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,749 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 09:12:54,750 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:54,750 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 09:12:54,750 - root - INFO - Clearing user context 2025-12-13 09:12:54,750 - root - INFO - User context cleared before authentication 2025-12-13 09:12:54,750 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:54,751 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:54,751 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,751 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:54,751 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:54,752 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:12:54,753 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:12:54,753 - root - INFO - Looking for user with username: admin 2025-12-13 09:12:54,757 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:12:54,757 - root - INFO - Clearing user context 2025-12-13 09:12:54,765 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:54,765 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:12:54,778 - root - INFO - Clearing user context 2025-12-13 09:12:55,015 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 09:12:55,015 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:55,015 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 09:12:55,015 - root - INFO - Clearing user context 2025-12-13 09:12:55,015 - root - INFO - User context cleared before authentication 2025-12-13 09:12:55,015 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:55,015 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:55,015 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:55,015 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:55,015 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:55,032 - root - INFO - Clearing user context 2025-12-13 09:12:55,335 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 09:12:55,351 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:12:55,351 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 09:12:55,351 - root - INFO - Clearing user context 2025-12-13 09:12:55,351 - root - INFO - User context cleared before authentication 2025-12-13 09:12:55,351 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:12:55,351 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:12:55,351 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:12:55,351 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:12:55,351 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:12:55,361 - root - INFO - Clearing user context 2025-12-13 09:13:17,237 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 09:13:17,237 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:13:17,239 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 09:13:17,239 - root - INFO - Clearing user context 2025-12-13 09:13:17,239 - root - INFO - User context cleared before authentication 2025-12-13 09:13:17,240 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:13:17,242 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:13:17,242 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:17,242 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:13:17,244 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:13:17,247 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:13:17,248 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:13:17,248 - root - INFO - Looking for user with username: admin 2025-12-13 09:13:17,249 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:13:17,252 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:17,252 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:13:17,259 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 09:13:17,292 - th_agenter.conversation_service - INFO - Successfully created conversation 62 for user 2 2025-12-13 09:13:17,292 - root - INFO - Clearing user context 2025-12-13 09:13:17,607 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/62/chat/stream 2025-12-13 09:13:17,607 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/62/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:13:17,607 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/62/chat/stream 2025-12-13 09:13:17,607 - root - INFO - Clearing user context 2025-12-13 09:13:17,607 - root - INFO - User context cleared before authentication 2025-12-13 09:13:17,607 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:13:17,613 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:13:17,619 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:17,624 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:13:17,626 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:13:17,659 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 09:13:18,360 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:13:18,367 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 09:13:18,383 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 09:13:18,383 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:13:18,383 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 09:13:18,383 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 09:13:18,383 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 09:13:18,383 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 09:13:18,400 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 09:13:18,400 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 09:13:18,400 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 09:13:18,400 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 09:13:18,400 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 09:13:18,400 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 09:13:18,400 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 09:13:18,407 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 09:13:18,411 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 09:13:18,411 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 09:13:18,415 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 09:13:18,419 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 09:13:18,420 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend and Agent support 2025-12-13 09:13:18,421 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 62 via LangChain 2025-12-13 09:13:18,421 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 62 2025-12-13 09:13:18,468 - root - INFO - Clearing user context 2025-12-13 09:13:19,462 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 09:13:20,250 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 62 2025-12-13 09:13:37,761 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 09:13:37,762 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:13:37,762 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 09:13:37,763 - root - INFO - Clearing user context 2025-12-13 09:13:37,763 - root - INFO - User context cleared before authentication 2025-12-13 09:13:37,763 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:13:37,765 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:13:37,765 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:37,766 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:13:37,766 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:13:37,768 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 09:13:37,769 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 09:13:37,770 - root - INFO - Looking for user with username: admin 2025-12-13 09:13:37,773 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 09:13:37,773 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:37,773 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 09:13:37,774 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 09:13:37,787 - th_agenter.conversation_service - INFO - Successfully created conversation 63 for user 2 2025-12-13 09:13:37,790 - root - INFO - Clearing user context 2025-12-13 09:13:52,860 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/63/chat/stream 2025-12-13 09:13:52,860 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/63/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:13:52,860 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/63/chat/stream 2025-12-13 09:13:52,860 - root - INFO - Clearing user context 2025-12-13 09:13:52,860 - root - INFO - User context cleared before authentication 2025-12-13 09:13:52,860 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:13:52,864 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:13:52,864 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:13:52,864 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:13:52,864 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:13:52,865 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 09:13:52,866 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:13:52,866 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 09:13:52,904 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 09:13:52,904 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:13:52,904 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 09:13:52,915 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 09:13:52,915 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 09:13:52,915 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend and Agent support 2025-12-13 09:13:52,947 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 63 via LangChain 2025-12-13 09:13:52,947 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 63 2025-12-13 09:13:52,976 - root - INFO - Clearing user context 2025-12-13 09:13:53,939 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 09:13:55,242 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 63 2025-12-13 09:14:14,935 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/63/chat/stream 2025-12-13 09:14:14,936 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/63/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 09:14:14,936 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/63/chat/stream 2025-12-13 09:14:14,937 - root - INFO - Clearing user context 2025-12-13 09:14:14,937 - root - INFO - User context cleared before authentication 2025-12-13 09:14:14,937 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 09:14:14,937 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 09:14:14,937 - root - INFO - Verification - ContextVar user: admin 2025-12-13 09:14:14,937 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 09:14:14,937 - root - INFO - Verified current user ID in context: 2 2025-12-13 09:14:14,943 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 09:14:14,949 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:14:14,961 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 09:14:14,980 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 09:14:14,980 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 2025-12-13 09:14:14,980 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 09:14:14,991 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 09:14:14,991 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 09:14:14,991 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend and Agent support 2025-12-13 09:14:15,010 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 63 via LangChain 2025-12-13 09:14:15,010 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 63 2025-12-13 09:14:15,057 - root - INFO - Clearing user context 2025-12-13 09:14:16,578 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 09:14:18,026 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 63 2025-12-13 09:41:23,179 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 09:41:51,102 - root - INFO - Logging configured successfully 2025-12-13 09:41:51,396 - root - INFO - Logging configured successfully 2025-12-13 09:41:51,625 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:41:51,655 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:41:51,664 - root - INFO - Database tables created 2025-12-13 09:41:51,666 - root - INFO - Database initialized 2025-12-13 09:42:12,727 - root - INFO - Logging configured successfully 2025-12-13 09:42:13,011 - root - INFO - Logging configured successfully 2025-12-13 09:42:13,283 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:42:13,301 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:42:13,321 - root - INFO - Database tables created 2025-12-13 09:42:13,322 - root - INFO - Database initialized 2025-12-13 09:42:31,675 - root - INFO - Logging configured successfully 2025-12-13 09:42:31,905 - root - INFO - Logging configured successfully 2025-12-13 09:42:32,081 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:42:32,094 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:42:32,101 - root - INFO - Database tables created 2025-12-13 09:42:32,105 - root - INFO - Database initialized 2025-12-13 09:42:35,398 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 09:42:57,828 - root - INFO - Logging configured successfully 2025-12-13 09:42:58,099 - root - INFO - Logging configured successfully 2025-12-13 09:42:58,336 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:42:58,356 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:42:58,364 - root - INFO - Database tables created 2025-12-13 09:42:58,365 - root - INFO - Database initialized 2025-12-13 09:43:19,234 - root - INFO - Logging configured successfully 2025-12-13 09:43:19,441 - root - INFO - Logging configured successfully 2025-12-13 09:43:19,624 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:43:19,640 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:43:19,645 - root - INFO - Database tables created 2025-12-13 09:43:19,646 - root - INFO - Database initialized 2025-12-13 09:43:44,506 - root - INFO - Logging configured successfully 2025-12-13 09:43:44,721 - root - INFO - Logging configured successfully 2025-12-13 09:43:44,901 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:43:44,918 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:43:44,939 - root - INFO - Database tables created 2025-12-13 09:43:44,939 - root - INFO - Database initialized 2025-12-13 09:44:04,951 - root - INFO - Logging configured successfully 2025-12-13 09:44:05,198 - root - INFO - Logging configured successfully 2025-12-13 09:44:05,369 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:44:05,381 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:44:05,388 - root - INFO - Database tables created 2025-12-13 09:44:05,389 - root - INFO - Database initialized 2025-12-13 09:44:38,925 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 09:44:59,750 - root - INFO - Logging configured successfully 2025-12-13 09:44:59,967 - root - INFO - Logging configured successfully 2025-12-13 09:45:00,135 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:45:00,147 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:45:00,157 - root - INFO - Database tables created 2025-12-13 09:45:00,159 - root - INFO - Database initialized 2025-12-13 09:46:52,054 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 09:47:12,448 - root - INFO - Logging configured successfully 2025-12-13 09:47:12,667 - root - INFO - Logging configured successfully 2025-12-13 09:47:12,830 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:47:12,843 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:47:12,852 - root - INFO - Database tables created 2025-12-13 09:47:12,852 - root - INFO - Database initialized 2025-12-13 09:47:19,449 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 09:47:39,405 - root - INFO - Logging configured successfully 2025-12-13 09:47:39,622 - root - INFO - Logging configured successfully 2025-12-13 09:47:39,802 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:47:39,817 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:47:39,824 - root - INFO - Database tables created 2025-12-13 09:47:39,826 - root - INFO - Database initialized 2025-12-13 09:48:00,266 - root - INFO - Logging configured successfully 2025-12-13 09:48:00,497 - root - INFO - Logging configured successfully 2025-12-13 09:48:00,679 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:48:00,692 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:48:00,699 - root - INFO - Database tables created 2025-12-13 09:48:00,699 - root - INFO - Database initialized 2025-12-13 09:48:20,583 - root - INFO - Logging configured successfully 2025-12-13 09:48:20,816 - root - INFO - Logging configured successfully 2025-12-13 09:48:21,042 - root - INFO - Starting up TH-Agenter application... 2025-12-13 09:48:21,057 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 09:48:21,065 - root - INFO - Database tables created 2025-12-13 09:48:21,066 - root - INFO - Database initialized 2025-12-13 09:49:54,187 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 10:45:28,501 - root - INFO - Logging configured successfully 2025-12-13 10:45:28,623 - root - INFO - Logging configured successfully 2025-12-13 10:45:28,723 - root - INFO - Starting up TH-Agenter application... 2025-12-13 10:45:28,733 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 10:45:28,745 - root - INFO - Database tables created 2025-12-13 10:45:28,746 - root - INFO - Database initialized 2025-12-13 10:46:42,208 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 10:54:14,405 - root - INFO - Logging configured successfully 2025-12-13 10:54:14,536 - root - INFO - Logging configured successfully 2025-12-13 10:54:14,631 - root - INFO - Starting up TH-Agenter application... 2025-12-13 10:54:14,638 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 10:54:14,642 - root - INFO - Database tables created 2025-12-13 10:54:14,642 - root - INFO - Database initialized 2025-12-13 10:56:09,883 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 10:56:22,780 - root - INFO - Logging configured successfully 2025-12-13 10:56:22,883 - root - INFO - Logging configured successfully 2025-12-13 10:56:22,971 - root - INFO - Starting up TH-Agenter application... 2025-12-13 10:56:22,978 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 10:56:22,983 - root - INFO - Database tables created 2025-12-13 10:56:22,983 - root - INFO - Database initialized 2025-12-13 11:49:32,952 - root - INFO - Logging configured successfully 2025-12-13 11:49:33,065 - root - INFO - Logging configured successfully 2025-12-13 11:49:33,153 - root - INFO - Starting up TH-Agenter application... 2025-12-13 11:49:33,166 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 11:49:33,185 - root - INFO - Database tables created 2025-12-13 11:49:33,185 - root - INFO - Database initialized 2025-12-13 11:49:57,900 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 11:49:57,901 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:49:57,902 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 11:49:57,903 - root - INFO - Clearing user context 2025-12-13 11:49:57,903 - root - INFO - User context cleared before authentication 2025-12-13 11:49:57,903 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:49:57,958 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:49:57,959 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:57,960 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:49:57,960 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:49:57,970 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:49:57,971 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:49:57,971 - root - INFO - Looking for user with username: admin 2025-12-13 11:49:57,974 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:49:57,974 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:57,975 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:49:57,989 - root - INFO - Clearing user context 2025-12-13 11:49:57,999 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-13 11:49:58,000 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:49:58,000 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-13 11:49:58,001 - root - INFO - Clearing user context 2025-12-13 11:49:58,001 - root - INFO - User context cleared before authentication 2025-12-13 11:49:58,001 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:49:58,006 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:49:58,008 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,009 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:49:58,009 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:49:58,013 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:49:58,014 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:49:58,015 - root - INFO - Looking for user with username: admin 2025-12-13 11:49:58,017 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:49:58,017 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,018 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:49:58,026 - root - INFO - Clearing user context 2025-12-13 11:49:58,794 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 11:49:58,795 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:49:58,795 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 11:49:58,795 - root - INFO - Clearing user context 2025-12-13 11:49:58,795 - root - INFO - User context cleared before authentication 2025-12-13 11:49:58,796 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:49:58,797 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:49:58,797 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,807 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:49:58,808 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:49:58,809 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 11:49:58,816 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:49:58,817 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 11:49:58,818 - root - INFO - Clearing user context 2025-12-13 11:49:58,818 - root - INFO - User context cleared before authentication 2025-12-13 11:49:58,819 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:49:58,824 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:49:58,824 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,825 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:49:58,825 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:49:58,829 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:49:58,834 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:49:58,835 - root - INFO - Looking for user with username: admin 2025-12-13 11:49:58,845 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:49:58,846 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,848 - root - INFO - Clearing user context 2025-12-13 11:49:58,848 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:49:58,882 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 11:49:58,883 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:49:58,883 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 11:49:58,883 - root - INFO - Clearing user context 2025-12-13 11:49:58,884 - root - INFO - User context cleared before authentication 2025-12-13 11:49:58,885 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:49:58,887 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:49:58,892 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:49:58,896 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:49:58,900 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:49:58,903 - root - INFO - Clearing user context 2025-12-13 11:49:58,909 - root - INFO - Clearing user context 2025-12-13 11:50:02,001 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 11:50:02,001 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,002 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 11:50:02,002 - root - INFO - Clearing user context 2025-12-13 11:50:02,002 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,003 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,006 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,008 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,009 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,010 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,012 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 11:50:02,016 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,016 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 11:50:02,016 - root - INFO - Clearing user context 2025-12-13 11:50:02,017 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,017 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,019 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,020 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,022 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,022 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,031 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:50:02,032 - root - INFO - Clearing user context 2025-12-13 11:50:02,032 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:50:02,033 - root - INFO - Looking for user with username: admin 2025-12-13 11:50:02,035 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:50:02,035 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,037 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 11:50:02,038 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:50:02,038 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,038 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 11:50:02,039 - root - INFO - Clearing user context 2025-12-13 11:50:02,040 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,040 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,042 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,042 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,043 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,044 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,072 - root - INFO - Clearing user context 2025-12-13 11:50:02,074 - root - INFO - Clearing user context 2025-12-13 11:50:02,159 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 11:50:02,159 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,159 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 11:50:02,160 - root - INFO - Clearing user context 2025-12-13 11:50:02,160 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,161 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,163 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,163 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,164 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,164 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,168 - root - INFO - Clearing user context 2025-12-13 11:50:02,350 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 11:50:02,351 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,353 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 11:50:02,353 - root - INFO - Clearing user context 2025-12-13 11:50:02,353 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,353 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,356 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,356 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,358 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,362 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,366 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:50:02,367 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:50:02,368 - root - INFO - Looking for user with username: admin 2025-12-13 11:50:02,372 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:50:02,374 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,376 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:50:02,396 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 11:50:02,397 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:02,398 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 11:50:02,398 - root - INFO - Clearing user context 2025-12-13 11:50:02,398 - root - INFO - User context cleared before authentication 2025-12-13 11:50:02,399 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:02,400 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:02,401 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:02,401 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:02,401 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:02,404 - root - INFO - Clearing user context 2025-12-13 11:50:02,409 - root - INFO - Clearing user context 2025-12-13 11:50:15,520 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 11:50:15,523 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:15,523 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 11:50:15,524 - root - INFO - Clearing user context 2025-12-13 11:50:15,525 - root - INFO - User context cleared before authentication 2025-12-13 11:50:15,525 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:15,526 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:15,526 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:15,527 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:15,527 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:15,533 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 11:50:15,534 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 11:50:15,535 - root - INFO - Looking for user with username: admin 2025-12-13 11:50:15,536 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 11:50:15,537 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:15,537 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 11:50:15,543 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 11:50:15,568 - th_agenter.conversation_service - INFO - Successfully created conversation 64 for user 2 2025-12-13 11:50:15,569 - root - INFO - Clearing user context 2025-12-13 11:50:15,784 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 11:50:15,785 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 11:50:15,786 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 11:50:15,786 - root - INFO - Clearing user context 2025-12-13 11:50:15,787 - root - INFO - User context cleared before authentication 2025-12-13 11:50:15,787 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 11:50:15,789 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 11:50:15,798 - root - INFO - Verification - ContextVar user: admin 2025-12-13 11:50:15,798 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 11:50:15,798 - root - INFO - Verified current user ID in context: 2 2025-12-13 11:50:15,809 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 11:50:17,035 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 11:50:17,036 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 11:50:17,046 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 11:50:17,066 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 11:50:17,072 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 11:50:17,073 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 11:50:17,077 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 11:50:17,077 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 11:50:17,078 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 11:50:17,078 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 11:50:17,079 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 11:50:17,080 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 11:50:17,082 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 11:50:17,083 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 11:50:17,084 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 11:50:17,086 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 11:50:17,087 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 11:50:17,087 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 11:50:17,094 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 11:50:17,096 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 11:50:17,102 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 11:50:17,104 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 11:50:17,111 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 11:50:17,112 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 11:50:17,115 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 11:50:17,116 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 11:50:17,170 - root - INFO - Clearing user context 2025-12-13 11:50:18,430 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 11:50:19,532 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:10:20,746 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:10:20,748 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:10:20,748 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:10:20,748 - root - INFO - Clearing user context 2025-12-13 13:10:20,749 - root - INFO - User context cleared before authentication 2025-12-13 13:10:20,749 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:10:20,750 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:10:20,751 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:10:20,752 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:10:20,752 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:10:20,756 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:10:20,780 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:20,784 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:10:20,792 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:10:20,819 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:10:20,830 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:20,834 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:10:20,838 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:10:20,839 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:10:20,839 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:10:20,846 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:20,847 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:10:20,849 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:10:20,849 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:10:20,894 - root - INFO - Clearing user context 2025-12-13 13:10:21,729 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:10:22,825 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:10:35,722 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:10:35,723 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:10:35,723 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:10:35,724 - root - INFO - Clearing user context 2025-12-13 13:10:35,724 - root - INFO - User context cleared before authentication 2025-12-13 13:10:35,724 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:10:35,726 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:10:35,727 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:10:35,727 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:10:35,728 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:10:35,730 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:10:35,747 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:35,747 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:10:35,754 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:10:35,775 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:10:35,783 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:35,784 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:10:35,784 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:10:35,786 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:10:35,787 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:10:35,793 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:10:35,794 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:10:35,796 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:10:35,797 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:10:35,824 - root - INFO - Clearing user context 2025-12-13 13:10:36,492 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:10:37,278 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:11:02,879 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:11:02,881 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:11:02,881 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:11:02,883 - root - INFO - Clearing user context 2025-12-13 13:11:02,884 - root - INFO - User context cleared before authentication 2025-12-13 13:11:02,884 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:11:02,886 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:11:02,887 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:11:02,894 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:11:02,895 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:11:02,898 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:11:02,910 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:11:02,910 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:11:02,917 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:11:02,932 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:11:02,939 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:11:02,944 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:11:02,945 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:11:02,950 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:11:02,950 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:11:02,963 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:11:02,967 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:11:02,968 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:11:02,969 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:11:02,997 - root - INFO - Clearing user context 2025-12-13 13:11:03,724 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:11:04,815 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:11:54,070 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:12:56,676 - root - INFO - Logging configured successfully 2025-12-13 13:12:56,775 - root - INFO - Logging configured successfully 2025-12-13 13:12:56,861 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:12:56,870 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:12:56,875 - root - INFO - Database tables created 2025-12-13 13:12:56,876 - root - INFO - Database initialized 2025-12-13 13:13:32,305 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:13:32,306 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:13:32,306 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:13:32,306 - root - INFO - Clearing user context 2025-12-13 13:13:32,307 - root - INFO - User context cleared before authentication 2025-12-13 13:13:32,307 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:13:32,352 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:13:32,353 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:13:32,353 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:13:32,354 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:13:32,379 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:13:33,215 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:33,216 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:13:33,232 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:13:33,259 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:13:33,266 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:33,271 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:13:33,274 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 13:13:33,274 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 13:13:33,275 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 13:13:33,276 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 13:13:33,276 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 13:13:33,280 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 13:13:33,282 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 13:13:33,283 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 13:13:33,287 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 13:13:33,288 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 13:13:33,289 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 13:13:33,291 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 13:13:33,299 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 13:13:33,301 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:13:33,305 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:13:33,306 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:13:33,316 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:33,319 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:13:33,321 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:13:33,327 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:13:33,386 - root - INFO - Clearing user context 2025-12-13 13:13:34,357 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:13:35,997 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:13:47,532 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:13:47,532 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:13:47,532 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:13:47,533 - root - INFO - Clearing user context 2025-12-13 13:13:47,533 - root - INFO - User context cleared before authentication 2025-12-13 13:13:47,533 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:13:47,535 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:13:47,537 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:13:47,537 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:13:47,538 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:13:47,541 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:13:47,553 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:47,554 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:13:47,559 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:13:47,577 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:13:47,583 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:47,584 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:13:47,585 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:13:47,587 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:13:47,588 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:13:47,594 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:13:47,595 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:13:47,597 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:13:47,598 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:13:47,630 - root - INFO - Clearing user context 2025-12-13 13:13:48,262 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:13:50,729 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:17:08,223 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:17:08,223 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:17:08,224 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:17:08,224 - root - INFO - Clearing user context 2025-12-13 13:17:08,224 - root - INFO - User context cleared before authentication 2025-12-13 13:17:08,224 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:17:08,226 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:17:08,228 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:08,229 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:17:08,229 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:17:08,232 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:17:08,233 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:17:08,234 - root - INFO - Looking for user with username: admin 2025-12-13 13:17:08,235 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:17:08,236 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:08,236 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:17:08,273 - root - INFO - Clearing user context 2025-12-13 13:17:09,500 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-13 13:17:09,500 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:17:09,500 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-13 13:17:09,501 - root - INFO - Clearing user context 2025-12-13 13:17:09,501 - root - INFO - User context cleared before authentication 2025-12-13 13:17:09,501 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:17:09,503 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:17:09,503 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:09,504 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:17:09,504 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:17:09,506 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:17:09,506 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:17:09,507 - root - INFO - Looking for user with username: admin 2025-12-13 13:17:09,508 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:17:09,508 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:09,510 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:17:09,523 - root - INFO - Clearing user context 2025-12-13 13:17:19,493 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:17:35,803 - root - INFO - Logging configured successfully 2025-12-13 13:17:36,046 - root - INFO - Logging configured successfully 2025-12-13 13:17:36,226 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:17:36,243 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:17:36,262 - root - INFO - Database tables created 2025-12-13 13:17:36,265 - root - INFO - Database initialized 2025-12-13 13:17:36,282 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/documents 2025-12-13 13:17:36,283 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:17:36,285 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-13 13:17:36,287 - root - INFO - Clearing user context 2025-12-13 13:17:36,290 - root - INFO - User context cleared before authentication 2025-12-13 13:17:36,293 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:17:36,344 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:17:36,346 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:36,346 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:17:36,346 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:17:36,354 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:17:36,356 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:17:36,356 - root - INFO - Looking for user with username: admin 2025-12-13 13:17:36,358 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:17:36,359 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:36,359 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:17:36,571 - th_agenter.services.document - INFO - Uploaded document: 周报.txt to KB 6 (Doc ID: 4) 2025-12-13 13:17:36,581 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:17:36,682 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:17:36,695 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-13 13:17:36,696 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 4, 路径: E:\Work\HXF\backend\data\uploads\kb_6\47a6f3b3-f860-4b12-8472-5374918aedb9_周报.txt 2025-12-13 13:17:36,701 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF\backend\data\uploads\kb_6\47a6f3b3-f860-4b12-8472-5374918aedb9_周报.txt, 页数: 1 2025-12-13 13:17:36,728 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-13 13:17:36,729 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-13 13:17:36,731 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 7 个文档块 2025-12-13 13:17:37,810 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:37,963 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,116 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,256 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,393 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,512 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,641 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:17:38,722 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_6 2025-12-13 13:17:38,737 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 4, 'status': 'success', 'chunks_count': 7, 'message': '文档处理完成'} 2025-12-13 13:17:38,750 - th_agenter.services.document - INFO - Processed document: 47a6f3b3-f860-4b12-8472-5374918aedb9_周报.txt (ID: 4) 2025-12-13 13:17:38,753 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-13 13:17:38,753 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:17:38,753 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-13 13:17:38,753 - root - INFO - Clearing user context 2025-12-13 13:17:38,754 - root - INFO - User context cleared before authentication 2025-12-13 13:17:38,754 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:17:38,757 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:17:38,757 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:38,757 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:17:38,758 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:17:38,759 - root - INFO - Clearing user context 2025-12-13 13:17:38,763 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:17:38,764 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:17:38,764 - root - INFO - Looking for user with username: admin 2025-12-13 13:17:38,768 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:17:38,768 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:38,769 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:17:39,068 - root - INFO - Clearing user context 2025-12-13 13:17:41,084 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-13 13:17:41,086 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:17:41,087 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-13 13:17:41,087 - root - INFO - Clearing user context 2025-12-13 13:17:41,088 - root - INFO - User context cleared before authentication 2025-12-13 13:17:41,088 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:17:41,091 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:17:41,091 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:41,091 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:17:41,095 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:17:41,100 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:17:41,101 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:17:41,102 - root - INFO - Looking for user with username: admin 2025-12-13 13:17:41,108 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:17:41,115 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:17:41,115 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:17:41,120 - root - INFO - Clearing user context 2025-12-13 13:17:51,715 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:18:08,946 - root - INFO - Logging configured successfully 2025-12-13 13:18:09,149 - root - INFO - Logging configured successfully 2025-12-13 13:18:09,323 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:18:09,348 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:18:09,363 - root - INFO - Database tables created 2025-12-13 13:18:09,366 - root - INFO - Database initialized 2025-12-13 13:18:09,382 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-13 13:18:09,386 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:18:09,388 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-13 13:18:09,390 - root - INFO - Clearing user context 2025-12-13 13:18:09,392 - root - INFO - User context cleared before authentication 2025-12-13 13:18:09,394 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:18:09,452 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:18:09,454 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:09,454 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:18:09,455 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:18:09,459 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:18:09,460 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:18:09,460 - root - INFO - Looking for user with username: admin 2025-12-13 13:18:09,462 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:18:09,462 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:09,462 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:18:09,473 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:18:09,563 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:18:09,568 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-13 13:18:10,274 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:18:10,346 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-13 13:18:10,348 - root - INFO - Clearing user context 2025-12-13 13:18:20,290 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-13 13:18:20,290 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:18:20,290 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-13 13:18:20,291 - root - INFO - Clearing user context 2025-12-13 13:18:20,291 - root - INFO - User context cleared before authentication 2025-12-13 13:18:20,291 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:18:20,293 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:18:20,293 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:20,293 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:18:20,294 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:18:20,296 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:18:20,296 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:18:20,297 - root - INFO - Looking for user with username: admin 2025-12-13 13:18:20,299 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:18:20,299 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:20,300 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:18:20,581 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:18:20,649 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-13 13:18:20,653 - root - INFO - Clearing user context 2025-12-13 13:18:54,295 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/6/search 2025-12-13 13:18:54,299 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:18:54,300 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/search 2025-12-13 13:18:54,304 - root - INFO - Clearing user context 2025-12-13 13:18:54,305 - root - INFO - User context cleared before authentication 2025-12-13 13:18:54,305 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:18:54,311 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:18:54,314 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:54,314 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:18:54,315 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:18:54,317 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:18:54,318 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:18:54,318 - root - INFO - Looking for user with username: admin 2025-12-13 13:18:54,319 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:18:54,322 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:18:54,324 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:18:54,646 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-13 13:18:54,722 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-13 13:18:54,726 - root - INFO - Clearing user context 2025-12-13 13:20:03,400 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:20:12,554 - root - INFO - Logging configured successfully 2025-12-13 13:20:12,663 - root - INFO - Logging configured successfully 2025-12-13 13:20:12,758 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:20:12,765 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:20:12,768 - root - INFO - Database tables created 2025-12-13 13:20:12,768 - root - INFO - Database initialized 2025-12-13 13:20:45,064 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 13:20:45,065 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:45,065 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 13:20:45,065 - root - INFO - Clearing user context 2025-12-13 13:20:45,067 - root - INFO - User context cleared before authentication 2025-12-13 13:20:45,068 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:45,125 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:45,125 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,125 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:45,125 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:45,131 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:45,134 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:45,140 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:45,143 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:45,144 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,145 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:45,168 - root - INFO - Clearing user context 2025-12-13 13:20:45,178 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-13 13:20:45,179 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:45,180 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-13 13:20:45,180 - root - INFO - Clearing user context 2025-12-13 13:20:45,180 - root - INFO - User context cleared before authentication 2025-12-13 13:20:45,181 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:45,183 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:45,187 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,187 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:45,188 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:45,189 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:45,193 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:45,196 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:45,198 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:45,199 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,200 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:45,209 - root - INFO - Clearing user context 2025-12-13 13:20:45,828 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:20:45,829 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:45,829 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:20:45,831 - root - INFO - Clearing user context 2025-12-13 13:20:45,832 - root - INFO - User context cleared before authentication 2025-12-13 13:20:45,832 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:45,835 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:45,836 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,837 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:45,837 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:45,840 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:20:45,840 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:45,841 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:20:45,841 - root - INFO - Clearing user context 2025-12-13 13:20:45,842 - root - INFO - User context cleared before authentication 2025-12-13 13:20:45,843 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:45,848 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:45,849 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,849 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:45,849 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:45,860 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:45,861 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:45,861 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:45,871 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:45,872 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,872 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:45,873 - root - INFO - Clearing user context 2025-12-13 13:20:45,911 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:20:45,912 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:45,912 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:20:45,912 - root - INFO - Clearing user context 2025-12-13 13:20:45,913 - root - INFO - User context cleared before authentication 2025-12-13 13:20:45,913 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:45,915 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:45,917 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:45,918 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:45,918 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:45,919 - root - INFO - Clearing user context 2025-12-13 13:20:45,927 - root - INFO - Clearing user context 2025-12-13 13:20:47,501 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 13:20:47,501 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:47,501 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 13:20:47,502 - root - INFO - Clearing user context 2025-12-13 13:20:47,502 - root - INFO - User context cleared before authentication 2025-12-13 13:20:47,502 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:47,504 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:47,504 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,505 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:47,505 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:47,507 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:47,507 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:47,508 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:47,510 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:47,510 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,511 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:47,513 - root - INFO - Clearing user context 2025-12-13 13:20:47,520 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-13 13:20:47,521 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:47,522 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-13 13:20:47,524 - root - INFO - Clearing user context 2025-12-13 13:20:47,524 - root - INFO - User context cleared before authentication 2025-12-13 13:20:47,525 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:47,529 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:47,531 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,531 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:47,531 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:47,534 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:47,535 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:47,537 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:47,537 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:47,538 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,538 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:47,545 - root - INFO - Clearing user context 2025-12-13 13:20:47,640 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:20:47,640 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:47,641 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:20:47,641 - root - INFO - Clearing user context 2025-12-13 13:20:47,641 - root - INFO - User context cleared before authentication 2025-12-13 13:20:47,642 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:47,643 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:47,644 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,644 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:47,645 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:47,647 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:47,647 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:47,647 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:47,649 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:47,649 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,650 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:47,667 - root - INFO - Clearing user context 2025-12-13 13:20:47,768 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:20:47,768 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:47,769 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:20:47,769 - root - INFO - Clearing user context 2025-12-13 13:20:47,769 - root - INFO - User context cleared before authentication 2025-12-13 13:20:47,771 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:47,773 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:47,774 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,774 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:47,775 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:47,783 - root - INFO - Clearing user context 2025-12-13 13:20:47,791 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:20:47,792 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:47,792 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:20:47,792 - root - INFO - Clearing user context 2025-12-13 13:20:47,793 - root - INFO - User context cleared before authentication 2025-12-13 13:20:47,793 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:47,796 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:47,796 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:47,797 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:47,797 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:47,801 - root - INFO - Clearing user context 2025-12-13 13:20:51,501 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:20:51,501 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,501 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:20:51,501 - root - INFO - Clearing user context 2025-12-13 13:20:51,502 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,502 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,504 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,504 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,504 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,505 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,506 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:20:51,508 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,509 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:20:51,510 - root - INFO - Clearing user context 2025-12-13 13:20:51,512 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,512 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,515 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,518 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,518 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,518 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,525 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:51,526 - root - INFO - Clearing user context 2025-12-13 13:20:51,527 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:51,529 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:51,531 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:51,531 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,532 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:51,548 - root - INFO - Clearing user context 2025-12-13 13:20:51,681 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:20:51,682 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,683 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:20:51,683 - root - INFO - Clearing user context 2025-12-13 13:20:51,684 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,684 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,687 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,687 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,692 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,692 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,696 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:20:51,697 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,697 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:20:51,698 - root - INFO - Clearing user context 2025-12-13 13:20:51,699 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,700 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,701 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,702 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,704 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,704 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,706 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:20:51,707 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,707 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:20:51,707 - root - INFO - Clearing user context 2025-12-13 13:20:51,708 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,708 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,712 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,713 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,714 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,714 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,725 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:20:51,725 - root - INFO - Clearing user context 2025-12-13 13:20:51,727 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:20:51,729 - root - INFO - Clearing user context 2025-12-13 13:20:51,730 - root - INFO - Looking for user with username: admin 2025-12-13 13:20:51,732 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:20:51,732 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,733 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:20:51,747 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:20:51,748 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:51,748 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:20:51,749 - root - INFO - Clearing user context 2025-12-13 13:20:51,749 - root - INFO - User context cleared before authentication 2025-12-13 13:20:51,749 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:51,751 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:51,751 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:51,752 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:51,752 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:51,753 - root - INFO - Clearing user context 2025-12-13 13:20:51,757 - root - INFO - Clearing user context 2025-12-13 13:20:53,160 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/64 2025-12-13 13:20:53,160 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:53,160 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64 2025-12-13 13:20:53,160 - root - INFO - Clearing user context 2025-12-13 13:20:53,160 - root - INFO - User context cleared before authentication 2025-12-13 13:20:53,162 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:53,163 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:53,163 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:53,164 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:53,164 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:53,168 - root - INFO - Clearing user context 2025-12-13 13:20:53,175 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/64/messages 2025-12-13 13:20:53,176 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:20:53,176 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/messages 2025-12-13 13:20:53,176 - root - INFO - Clearing user context 2025-12-13 13:20:53,176 - root - INFO - User context cleared before authentication 2025-12-13 13:20:53,177 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:20:53,181 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:20:53,182 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:20:53,183 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:20:53,184 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:20:53,205 - root - INFO - Clearing user context 2025-12-13 13:21:04,655 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/64/chat/stream 2025-12-13 13:21:04,656 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:21:04,656 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/chat/stream 2025-12-13 13:21:04,657 - root - INFO - Clearing user context 2025-12-13 13:21:04,657 - root - INFO - User context cleared before authentication 2025-12-13 13:21:04,657 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:21:04,658 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:21:04,659 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:21:04,659 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:21:04,659 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:21:04,671 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:21:05,237 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:21:05,239 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:21:05,239 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:21:05,249 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:21:05,270 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:21:05,275 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:21:05,276 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:21:05,277 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:21:05,279 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 13:21:05,280 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 13:21:05,280 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 13:21:05,282 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 13:21:05,283 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 13:21:05,284 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 13:21:05,285 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 13:21:05,286 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 13:21:05,287 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 13:21:05,290 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 13:21:05,291 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 13:21:05,292 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 13:21:05,298 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 13:21:05,299 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:21:05,305 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:21:05,305 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:21:05,312 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:21:05,314 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:21:05,316 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:21:05,317 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 64 via LangChain 2025-12-13 13:21:05,321 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 64 2025-12-13 13:21:05,663 - root - INFO - Clearing user context 2025-12-13 13:21:06,527 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:21:07,651 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 64 2025-12-13 13:21:23,473 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/64 2025-12-13 13:21:23,474 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:21:23,474 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64 2025-12-13 13:21:23,474 - root - INFO - Clearing user context 2025-12-13 13:21:23,474 - root - INFO - User context cleared before authentication 2025-12-13 13:21:23,474 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:21:23,476 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:21:23,476 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:21:23,476 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:21:23,477 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:21:23,479 - root - INFO - Clearing user context 2025-12-13 13:21:23,793 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/64/messages 2025-12-13 13:21:23,794 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/64/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:21:23,794 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/64/messages 2025-12-13 13:21:23,794 - root - INFO - Clearing user context 2025-12-13 13:21:23,794 - root - INFO - User context cleared before authentication 2025-12-13 13:21:23,794 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:21:23,795 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:21:23,797 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:21:23,797 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:21:23,797 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:21:23,801 - root - INFO - Clearing user context 2025-12-13 13:22:17,111 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 13:22:17,111 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:22:17,112 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:22:17,112 - root - INFO - Clearing user context 2025-12-13 13:22:17,112 - root - INFO - User context cleared before authentication 2025-12-13 13:22:17,113 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:22:17,116 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:22:17,116 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:22:17,117 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:22:17,118 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:22:17,120 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:22:17,121 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:22:17,121 - root - INFO - Looking for user with username: admin 2025-12-13 13:22:17,124 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:22:17,125 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:22:17,125 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:22:17,130 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 13:22:17,151 - th_agenter.conversation_service - INFO - Successfully created conversation 65 for user 2 2025-12-13 13:22:17,158 - root - INFO - Clearing user context 2025-12-13 13:22:18,824 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65 2025-12-13 13:22:18,826 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:22:18,826 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65 2025-12-13 13:22:18,826 - root - INFO - Clearing user context 2025-12-13 13:22:18,826 - root - INFO - User context cleared before authentication 2025-12-13 13:22:18,827 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:22:18,829 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:22:18,830 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:22:18,830 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:22:18,831 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:22:18,842 - root - INFO - Clearing user context 2025-12-13 13:22:19,086 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65/messages 2025-12-13 13:22:19,087 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:22:19,087 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/messages 2025-12-13 13:22:19,088 - root - INFO - Clearing user context 2025-12-13 13:22:19,088 - root - INFO - User context cleared before authentication 2025-12-13 13:22:19,089 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:22:19,091 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:22:19,094 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:22:19,094 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:22:19,095 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:22:19,101 - root - INFO - Clearing user context 2025-12-13 13:22:24,577 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/65/chat/stream 2025-12-13 13:22:24,577 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:22:24,578 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/chat/stream 2025-12-13 13:22:24,578 - root - INFO - Clearing user context 2025-12-13 13:22:24,578 - root - INFO - User context cleared before authentication 2025-12-13 13:22:24,579 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:22:24,581 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:22:24,582 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:22:24,582 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:22:24,583 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:22:24,586 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:22:24,599 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:22:24,602 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:22:24,602 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:22:24,609 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:22:24,626 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:22:24,633 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:22:24,634 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:22:24,635 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:22:24,636 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:22:24,638 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:22:24,639 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:22:24,646 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:22:24,650 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:22:24,651 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:22:24,653 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 65 via LangChain 2025-12-13 13:22:24,653 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 65 2025-12-13 13:22:24,689 - root - INFO - Clearing user context 2025-12-13 13:22:25,814 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:22:26,939 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 65 2025-12-13 13:25:14,776 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/65/chat/stream 2025-12-13 13:25:14,776 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:25:14,779 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/chat/stream 2025-12-13 13:25:14,779 - root - INFO - Clearing user context 2025-12-13 13:25:14,779 - root - INFO - User context cleared before authentication 2025-12-13 13:25:14,780 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:25:14,782 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:25:14,782 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:25:14,783 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:25:14,783 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:25:14,786 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:25:14,796 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:14,799 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:14,802 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:25:14,810 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:25:14,831 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:25:14,838 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:14,840 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:14,841 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:25:14,842 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:25:14,844 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:25:14,844 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:25:14,851 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:14,853 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:14,853 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:25:14,855 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 65 via LangChain 2025-12-13 13:25:14,855 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 65 2025-12-13 13:25:14,879 - root - INFO - Clearing user context 2025-12-13 13:25:15,713 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:25:16,358 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 65 2025-12-13 13:25:40,239 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/65/chat/stream 2025-12-13 13:25:40,240 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:25:40,240 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/chat/stream 2025-12-13 13:25:40,240 - root - INFO - Clearing user context 2025-12-13 13:25:40,241 - root - INFO - User context cleared before authentication 2025-12-13 13:25:40,241 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:25:40,243 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:25:40,243 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:25:40,243 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:25:40,244 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:25:40,248 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:25:40,259 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:40,261 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:40,262 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:25:40,269 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:25:40,288 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:25:40,294 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:40,295 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:40,295 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:25:40,297 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:25:40,299 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:25:40,300 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:25:40,309 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:25:40,310 - th_agenter.redis_memory_service - INFO - Conversation history directory: conversation_history 2025-12-13 13:25:40,311 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:25:40,312 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 65 via LangChain 2025-12-13 13:25:40,312 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 65 2025-12-13 13:25:40,338 - root - INFO - Clearing user context 2025-12-13 13:25:41,400 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:25:56,003 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 65 2025-12-13 13:27:38,743 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:27:48,392 - root - INFO - Logging configured successfully 2025-12-13 13:27:48,498 - root - INFO - Logging configured successfully 2025-12-13 13:27:48,588 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:27:48,598 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:27:48,603 - root - INFO - Database tables created 2025-12-13 13:27:48,603 - root - INFO - Database initialized 2025-12-13 13:27:56,841 - root - INFO - Logging configured successfully 2025-12-13 13:27:56,948 - root - INFO - Logging configured successfully 2025-12-13 13:27:57,048 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:27:57,057 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:27:57,061 - root - INFO - Database tables created 2025-12-13 13:27:57,061 - root - INFO - Database initialized 2025-12-13 13:28:00,657 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:28:09,382 - root - INFO - Logging configured successfully 2025-12-13 13:28:09,498 - root - INFO - Logging configured successfully 2025-12-13 13:28:09,601 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:28:09,609 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:28:09,613 - root - INFO - Database tables created 2025-12-13 13:28:09,613 - root - INFO - Database initialized 2025-12-13 13:28:18,136 - root - INFO - Logging configured successfully 2025-12-13 13:28:18,335 - root - INFO - Logging configured successfully 2025-12-13 13:28:18,494 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:28:18,508 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:28:18,513 - root - INFO - Database tables created 2025-12-13 13:28:18,514 - root - INFO - Database initialized 2025-12-13 13:28:26,107 - root - INFO - Logging configured successfully 2025-12-13 13:28:26,211 - root - INFO - Logging configured successfully 2025-12-13 13:28:26,302 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:28:26,311 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:28:26,314 - root - INFO - Database tables created 2025-12-13 13:28:26,315 - root - INFO - Database initialized 2025-12-13 13:28:34,416 - root - INFO - Logging configured successfully 2025-12-13 13:28:34,516 - root - INFO - Logging configured successfully 2025-12-13 13:28:34,611 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:28:34,619 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:28:34,624 - root - INFO - Database tables created 2025-12-13 13:28:34,625 - root - INFO - Database initialized 2025-12-13 13:29:29,698 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:29:48,291 - root - INFO - Logging configured successfully 2025-12-13 13:29:48,567 - root - INFO - Logging configured successfully 2025-12-13 13:29:48,800 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:29:48,823 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:29:48,832 - root - INFO - Database tables created 2025-12-13 13:29:48,832 - root - INFO - Database initialized 2025-12-13 13:30:24,910 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:30:42,512 - root - INFO - Logging configured successfully 2025-12-13 13:30:42,703 - root - INFO - Logging configured successfully 2025-12-13 13:30:42,882 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:30:42,899 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:30:42,908 - root - INFO - Database tables created 2025-12-13 13:30:42,908 - root - INFO - Database initialized 2025-12-13 13:31:24,465 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:31:43,949 - root - INFO - Logging configured successfully 2025-12-13 13:31:44,210 - root - INFO - Logging configured successfully 2025-12-13 13:31:44,399 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:31:44,409 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:31:44,418 - root - INFO - Database tables created 2025-12-13 13:31:44,423 - root - INFO - Database initialized 2025-12-13 13:32:40,351 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:32:58,269 - root - INFO - Logging configured successfully 2025-12-13 13:32:58,539 - root - INFO - Logging configured successfully 2025-12-13 13:32:58,770 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:32:58,788 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:32:58,796 - root - INFO - Database tables created 2025-12-13 13:32:58,798 - root - INFO - Database initialized 2025-12-13 13:33:09,154 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:33:24,431 - root - INFO - Logging configured successfully 2025-12-13 13:33:24,657 - root - INFO - Logging configured successfully 2025-12-13 13:33:24,852 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:33:24,867 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:33:24,875 - root - INFO - Database tables created 2025-12-13 13:33:24,875 - root - INFO - Database initialized 2025-12-13 13:33:39,375 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:33:55,039 - root - INFO - Logging configured successfully 2025-12-13 13:33:55,263 - root - INFO - Logging configured successfully 2025-12-13 13:33:55,451 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:33:55,464 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:33:55,470 - root - INFO - Database tables created 2025-12-13 13:33:55,471 - root - INFO - Database initialized 2025-12-13 13:34:13,085 - root - INFO - Logging configured successfully 2025-12-13 13:34:13,282 - root - INFO - Logging configured successfully 2025-12-13 13:34:13,461 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:34:13,477 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:34:13,486 - root - INFO - Database tables created 2025-12-13 13:34:13,487 - root - INFO - Database initialized 2025-12-13 13:34:14,249 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:34:25,648 - root - INFO - Logging configured successfully 2025-12-13 13:34:25,768 - root - INFO - Logging configured successfully 2025-12-13 13:34:25,867 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:34:25,875 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:34:25,878 - root - INFO - Database tables created 2025-12-13 13:34:25,878 - root - INFO - Database initialized 2025-12-13 13:35:16,692 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:35:25,187 - root - INFO - Logging configured successfully 2025-12-13 13:35:25,307 - root - INFO - Logging configured successfully 2025-12-13 13:35:25,404 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:35:25,411 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:35:25,415 - root - INFO - Database tables created 2025-12-13 13:35:25,415 - root - INFO - Database initialized 2025-12-13 13:35:33,628 - root - INFO - Logging configured successfully 2025-12-13 13:35:33,733 - root - INFO - Logging configured successfully 2025-12-13 13:35:33,825 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:35:33,831 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:35:33,836 - root - INFO - Database tables created 2025-12-13 13:35:33,836 - root - INFO - Database initialized 2025-12-13 13:35:46,135 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:35:54,273 - root - INFO - Logging configured successfully 2025-12-13 13:35:54,396 - root - INFO - Logging configured successfully 2025-12-13 13:35:54,498 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:35:54,506 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:35:54,511 - root - INFO - Database tables created 2025-12-13 13:35:54,511 - root - INFO - Database initialized 2025-12-13 13:36:02,683 - root - INFO - Logging configured successfully 2025-12-13 13:36:02,790 - root - INFO - Logging configured successfully 2025-12-13 13:36:02,891 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:36:02,900 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:36:02,904 - root - INFO - Database tables created 2025-12-13 13:36:02,904 - root - INFO - Database initialized 2025-12-13 13:37:53,892 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:38:19,167 - root - INFO - Logging configured successfully 2025-12-13 13:38:19,452 - root - INFO - Logging configured successfully 2025-12-13 13:38:19,700 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:38:19,727 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:38:19,757 - root - INFO - Database tables created 2025-12-13 13:38:19,758 - root - INFO - Database initialized 2025-12-13 13:38:38,150 - root - INFO - Logging configured successfully 2025-12-13 13:38:38,332 - root - INFO - Logging configured successfully 2025-12-13 13:38:38,448 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:38:38,457 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:38:38,461 - root - INFO - Database tables created 2025-12-13 13:38:38,462 - root - INFO - Database initialized 2025-12-13 13:42:39,337 - root - INFO - Logging configured successfully 2025-12-13 13:42:39,444 - root - INFO - Logging configured successfully 2025-12-13 13:42:39,537 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:42:39,547 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:42:39,573 - root - INFO - Database tables created 2025-12-13 13:42:39,574 - root - INFO - Database initialized 2025-12-13 13:42:58,278 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-13 13:42:58,278 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,280 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-13 13:42:58,280 - root - INFO - Clearing user context 2025-12-13 13:42:58,281 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,281 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,341 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,342 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,343 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,354 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,363 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:42:58,363 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:42:58,364 - root - INFO - Looking for user with username: admin 2025-12-13 13:42:58,366 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:42:58,366 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,367 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:42:58,386 - root - INFO - Clearing user context 2025-12-13 13:42:58,401 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-13 13:42:58,402 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,403 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-13 13:42:58,403 - root - INFO - Clearing user context 2025-12-13 13:42:58,403 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,403 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,409 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,410 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,410 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,411 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,414 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:42:58,415 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:42:58,416 - root - INFO - Looking for user with username: admin 2025-12-13 13:42:58,419 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:42:58,421 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,421 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:42:58,428 - root - INFO - Clearing user context 2025-12-13 13:42:58,657 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:42:58,657 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,657 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:42:58,657 - root - INFO - Clearing user context 2025-12-13 13:42:58,657 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,657 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,660 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,661 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,661 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,662 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,666 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:42:58,667 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,667 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:42:58,667 - root - INFO - Clearing user context 2025-12-13 13:42:58,668 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,669 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,672 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,672 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,673 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,673 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,694 - root - INFO - Clearing user context 2025-12-13 13:42:58,694 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:42:58,696 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:42:58,697 - root - INFO - Looking for user with username: admin 2025-12-13 13:42:58,698 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:42:58,701 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:42:58,702 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,703 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,704 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:42:58,704 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:42:58,705 - root - INFO - Clearing user context 2025-12-13 13:42:58,705 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,706 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,718 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,718 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,718 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,721 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,760 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:42:58,760 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,761 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:42:58,761 - root - INFO - Clearing user context 2025-12-13 13:42:58,762 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,762 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,765 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,765 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,766 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,767 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,774 - root - INFO - Clearing user context 2025-12-13 13:42:58,782 - root - INFO - Clearing user context 2025-12-13 13:42:58,786 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-13 13:42:58,786 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,787 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-13 13:42:58,787 - root - INFO - Clearing user context 2025-12-13 13:42:58,787 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,789 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,792 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,794 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,794 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,795 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,797 - root - INFO - Clearing user context 2025-12-13 13:42:58,800 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-13 13:42:58,800 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:58,801 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:42:58,801 - root - INFO - Clearing user context 2025-12-13 13:42:58,801 - root - INFO - User context cleared before authentication 2025-12-13 13:42:58,803 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:58,807 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:58,808 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,808 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:58,809 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:58,811 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:42:58,814 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:42:58,816 - root - INFO - Looking for user with username: admin 2025-12-13 13:42:58,817 - root - INFO - Clearing user context 2025-12-13 13:42:58,819 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:42:58,820 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:58,821 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:42:58,844 - root - INFO - Clearing user context 2025-12-13 13:42:59,117 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:42:59,121 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:59,122 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:42:59,122 - root - INFO - Clearing user context 2025-12-13 13:42:59,122 - root - INFO - User context cleared before authentication 2025-12-13 13:42:59,122 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:59,124 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:59,124 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:59,125 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:59,125 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:59,133 - root - INFO - Clearing user context 2025-12-13 13:42:59,445 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-13 13:42:59,447 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:42:59,447 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-13 13:42:59,447 - root - INFO - Clearing user context 2025-12-13 13:42:59,448 - root - INFO - User context cleared before authentication 2025-12-13 13:42:59,448 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:42:59,449 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:42:59,449 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:42:59,449 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:42:59,451 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:42:59,453 - root - INFO - Clearing user context 2025-12-13 13:43:02,034 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65 2025-12-13 13:43:02,035 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:02,035 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65 2025-12-13 13:43:02,036 - root - INFO - Clearing user context 2025-12-13 13:43:02,036 - root - INFO - User context cleared before authentication 2025-12-13 13:43:02,036 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:02,037 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:02,038 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:02,038 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:02,038 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:02,042 - root - INFO - Clearing user context 2025-12-13 13:43:02,358 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65/messages 2025-12-13 13:43:02,359 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:02,359 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/messages 2025-12-13 13:43:02,360 - root - INFO - Clearing user context 2025-12-13 13:43:02,360 - root - INFO - User context cleared before authentication 2025-12-13 13:43:02,360 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:02,362 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:02,362 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:02,362 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:02,363 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:02,378 - root - INFO - Clearing user context 2025-12-13 13:43:05,146 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65 2025-12-13 13:43:05,146 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:05,146 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65 2025-12-13 13:43:05,146 - root - INFO - Clearing user context 2025-12-13 13:43:05,146 - root - INFO - User context cleared before authentication 2025-12-13 13:43:05,146 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:05,148 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:05,148 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:05,148 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:05,148 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:05,151 - root - INFO - Clearing user context 2025-12-13 13:43:05,468 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/65/messages 2025-12-13 13:43:05,470 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/65/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:05,470 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/65/messages 2025-12-13 13:43:05,470 - root - INFO - Clearing user context 2025-12-13 13:43:05,471 - root - INFO - User context cleared before authentication 2025-12-13 13:43:05,471 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:05,472 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:05,472 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:05,472 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:05,473 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:05,475 - root - INFO - Clearing user context 2025-12-13 13:43:07,045 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/chat/conversations 2025-12-13 13:43:07,046 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:07,046 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:43:07,047 - root - INFO - Clearing user context 2025-12-13 13:43:07,047 - root - INFO - User context cleared before authentication 2025-12-13 13:43:07,047 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:07,050 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:07,054 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:07,054 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:07,054 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:07,057 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:43:07,057 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:43:07,057 - root - INFO - Looking for user with username: admin 2025-12-13 13:43:07,060 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:43:07,060 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:07,060 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:43:07,090 - th_agenter.conversation_service - INFO - Successfully deleted all conversations for user 2 2025-12-13 13:43:07,092 - root - INFO - Clearing user context 2025-12-13 13:43:09,195 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 13:43:09,196 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:09,196 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:43:09,197 - root - INFO - Clearing user context 2025-12-13 13:43:09,197 - root - INFO - User context cleared before authentication 2025-12-13 13:43:09,197 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:09,200 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:09,200 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:09,201 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:09,201 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:09,206 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:43:09,206 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:43:09,207 - root - INFO - Looking for user with username: admin 2025-12-13 13:43:09,208 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:43:09,208 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:09,209 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:43:09,216 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 13:43:09,236 - th_agenter.conversation_service - INFO - Successfully created conversation 2 for user 2 2025-12-13 13:43:09,238 - root - INFO - Clearing user context 2025-12-13 13:43:18,805 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/2/chat/stream 2025-12-13 13:43:18,806 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/2/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:18,806 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/2/chat/stream 2025-12-13 13:43:18,807 - root - INFO - Clearing user context 2025-12-13 13:43:18,807 - root - INFO - User context cleared before authentication 2025-12-13 13:43:18,807 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:18,811 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:18,811 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:18,812 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:18,812 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:18,825 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:43:20,010 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:20,013 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:20,014 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:20,015 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:43:20,023 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:43:20,077 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:43:20,083 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:20,085 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:20,085 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:20,086 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:43:20,101 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 13:43:20,102 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 13:43:20,103 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 13:43:20,104 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 13:43:20,106 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 13:43:20,107 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 13:43:20,108 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 13:43:20,108 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 13:43:20,110 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 13:43:20,110 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 13:43:20,110 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 13:43:20,112 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 13:43:20,120 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 13:43:20,121 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:43:20,123 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:43:20,125 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:43:20,131 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:20,134 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:20,134 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:20,135 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:43:20,136 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 2 via LangChain 2025-12-13 13:43:20,137 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 2 2025-12-13 13:43:20,532 - root - INFO - Clearing user context 2025-12-13 13:43:20,692 - openai._base_client - INFO - Retrying request to /chat/completions in 0.389504 seconds 2025-12-13 13:43:21,225 - openai._base_client - INFO - Retrying request to /chat/completions in 0.760109 seconds 2025-12-13 13:43:22,104 - th_agenter.langchain_chat_service - ERROR - Failed to process LangChain streaming chat request for conversation 2: Connection error. Traceback (most recent call last): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 101, in map_httpcore_exceptions yield File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 394, in handle_async_request resp = await self._pool.handle_async_request(req) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection_pool.py", line 256, in handle_async_request raise exc from None File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection_pool.py", line 236, in handle_async_request response = await connection.handle_async_request( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\http_proxy.py", line 288, in handle_async_request connect_response = await self._connection.handle_async_request( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 101, in handle_async_request raise exc File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 78, in handle_async_request stream = await self._connect(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 156, in _connect stream = await stream.start_tls(**kwargs) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_backends\anyio.py", line 67, in start_tls with map_exceptions(exc_map): File "D:\Users\jiang\anaconda3\envs\langchain\lib\contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ConnectError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1529, in request response = await self._client.send( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1629, in send response = await self._send_handling_auth( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1657, in _send_handling_auth response = await self._send_handling_redirects( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1694, in _send_handling_redirects response = await self._send_single_request(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1730, in _send_single_request response = await transport.handle_async_request(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 393, in handle_async_request with map_httpcore_exceptions(): File "D:\Users\jiang\anaconda3\envs\langchain\lib\contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 118, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "E:\Work\HXF\backend\th_agenter\services\langchain_chat.py", line 282, in chat_stream async for chunk in streaming_llm_to_use.astream(langchain_messages): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_core\language_models\chat_models.py", line 664, in astream async for chunk in self._astream( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_openai\chat_models\base.py", line 2997, in _astream async for chunk in super()._astream(*args, **kwargs): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_openai\chat_models\base.py", line 1514, in _astream response = await self.async_client.create(**payload) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\resources\chat\completions\completions.py", line 2672, in create return await self._post( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1794, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1561, in request raise APIConnectionError(request=request) from err openai.APIConnectionError: Connection error. 2025-12-13 13:43:26,682 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-13 13:43:26,683 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:26,683 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-13 13:43:26,683 - root - INFO - Clearing user context 2025-12-13 13:43:26,684 - root - INFO - User context cleared before authentication 2025-12-13 13:43:26,684 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:26,686 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:26,688 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:26,688 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:26,689 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:26,693 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-13 13:43:26,695 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765606374} 2025-12-13 13:43:26,696 - root - INFO - Looking for user with username: admin 2025-12-13 13:43:26,698 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-13 13:43:26,698 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:26,700 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-13 13:43:26,701 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-13 13:43:26,718 - th_agenter.conversation_service - INFO - Successfully created conversation 3 for user 2 2025-12-13 13:43:26,720 - root - INFO - Clearing user context 2025-12-13 13:43:28,473 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/3/chat/stream 2025-12-13 13:43:28,473 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:43:28,474 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/chat/stream 2025-12-13 13:43:28,474 - root - INFO - Clearing user context 2025-12-13 13:43:28,474 - root - INFO - User context cleared before authentication 2025-12-13 13:43:28,475 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:43:28,477 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:43:28,477 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:43:28,478 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:43:28,478 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:43:28,498 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:43:28,521 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:28,524 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:28,524 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:28,524 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:43:28,538 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:43:28,590 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:43:28,595 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:28,596 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:28,598 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:28,599 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:43:28,599 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:43:28,602 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:43:28,604 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:43:28,610 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:43:28,611 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:43:28,613 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:43:28,613 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:43:28,615 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 3 via LangChain 2025-12-13 13:43:28,616 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 3 2025-12-13 13:43:28,658 - root - INFO - Clearing user context 2025-12-13 13:43:28,759 - openai._base_client - INFO - Retrying request to /chat/completions in 0.463663 seconds 2025-12-13 13:43:29,386 - openai._base_client - INFO - Retrying request to /chat/completions in 0.868292 seconds 2025-12-13 13:43:30,351 - th_agenter.langchain_chat_service - ERROR - Failed to process LangChain streaming chat request for conversation 3: Connection error. Traceback (most recent call last): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 101, in map_httpcore_exceptions yield File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 394, in handle_async_request resp = await self._pool.handle_async_request(req) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection_pool.py", line 256, in handle_async_request raise exc from None File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection_pool.py", line 236, in handle_async_request response = await connection.handle_async_request( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\http_proxy.py", line 288, in handle_async_request connect_response = await self._connection.handle_async_request( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 101, in handle_async_request raise exc File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 78, in handle_async_request stream = await self._connect(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_async\connection.py", line 156, in _connect stream = await stream.start_tls(**kwargs) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_backends\anyio.py", line 67, in start_tls with map_exceptions(exc_map): File "D:\Users\jiang\anaconda3\envs\langchain\lib\contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ConnectError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1529, in request response = await self._client.send( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1629, in send response = await self._send_handling_auth( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1657, in _send_handling_auth response = await self._send_handling_redirects( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1694, in _send_handling_redirects response = await self._send_single_request(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_client.py", line 1730, in _send_single_request response = await transport.handle_async_request(request) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 393, in handle_async_request with map_httpcore_exceptions(): File "D:\Users\jiang\anaconda3\envs\langchain\lib\contextlib.py", line 153, in __exit__ self.gen.throw(typ, value, traceback) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\httpx\_transports\default.py", line 118, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "E:\Work\HXF\backend\th_agenter\services\langchain_chat.py", line 282, in chat_stream async for chunk in streaming_llm_to_use.astream(langchain_messages): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_core\language_models\chat_models.py", line 664, in astream async for chunk in self._astream( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_openai\chat_models\base.py", line 2997, in _astream async for chunk in super()._astream(*args, **kwargs): File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain_openai\chat_models\base.py", line 1514, in _astream response = await self.async_client.create(**payload) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\resources\chat\completions\completions.py", line 2672, in create return await self._post( File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1794, in post return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) File "D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\openai\_base_client.py", line 1561, in request raise APIConnectionError(request=request) from err openai.APIConnectionError: Connection error. 2025-12-13 13:45:16,677 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:45:27,380 - root - INFO - Logging configured successfully 2025-12-13 13:45:27,496 - root - INFO - Logging configured successfully 2025-12-13 13:45:27,599 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:45:27,609 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:45:27,614 - root - INFO - Database tables created 2025-12-13 13:45:27,614 - root - INFO - Database initialized 2025-12-13 13:46:04,229 - root - INFO - Shutting down TH-Agenter application... 2025-12-13 13:46:13,239 - root - INFO - Logging configured successfully 2025-12-13 13:46:13,343 - root - INFO - Logging configured successfully 2025-12-13 13:46:13,432 - root - INFO - Starting up TH-Agenter application... 2025-12-13 13:46:13,440 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-13 13:46:13,445 - root - INFO - Database tables created 2025-12-13 13:46:13,445 - root - INFO - Database initialized 2025-12-13 13:46:32,924 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/3/chat/stream 2025-12-13 13:46:32,927 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-13 13:46:32,928 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/chat/stream 2025-12-13 13:46:32,929 - root - INFO - Clearing user context 2025-12-13 13:46:32,929 - root - INFO - User context cleared before authentication 2025-12-13 13:46:32,929 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-13 13:46:32,978 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-13 13:46:32,979 - root - INFO - Verification - ContextVar user: admin 2025-12-13 13:46:32,980 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-13 13:46:32,980 - root - INFO - Verified current user ID in context: 2 2025-12-13 13:46:32,997 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-13 13:46:33,581 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:46:33,585 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:46:33,586 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:46:33,586 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:46:33,598 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-13 13:46:33,619 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-13 13:46:33,626 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:46:33,629 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:46:33,629 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:46:33,630 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-13 13:46:33,635 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-13 13:46:33,636 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-13 13:46:33,636 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-13 13:46:33,637 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-13 13:46:33,645 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-13 13:46:33,651 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-13 13:46:33,651 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-13 13:46:33,652 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-13 13:46:33,652 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-13 13:46:33,653 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-13 13:46:33,653 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-13 13:46:33,656 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-13 13:46:33,664 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-13 13:46:33,665 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-13 13:46:33,669 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-13 13:46:33,671 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-13 13:46:33,689 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-13 13:46:33,690 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-13 13:46:33,691 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF\backend 2025-12-13 13:46:33,692 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-13 13:46:33,693 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 3 via LangChain 2025-12-13 13:46:33,694 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 3 2025-12-13 13:46:33,744 - root - INFO - Clearing user context 2025-12-13 13:46:34,689 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-13 13:46:35,498 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 3 2025-12-15 09:44:10,489 - root - INFO - Logging configured successfully 2025-12-15 09:44:10,618 - root - INFO - Logging configured successfully 2025-12-15 09:44:10,731 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:44:10,744 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:44:10,760 - root - INFO - Database tables created 2025-12-15 09:44:10,761 - root - INFO - Database initialized 2025-12-15 09:44:14,152 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,154 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,155 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,155 - root - INFO - Clearing user context 2025-12-15 09:44:14,157 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,157 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,159 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,163 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,163 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,163 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,266 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:14,268 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,268 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:14,271 - root - INFO - Clearing user context 2025-12-15 09:44:14,275 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,275 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,276 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,277 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,278 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,278 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,334 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 09:44:14,334 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,334 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:44:14,335 - root - INFO - Clearing user context 2025-12-15 09:44:14,335 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,335 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,335 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,336 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,336 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,336 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,396 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,397 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,397 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,397 - root - INFO - Clearing user context 2025-12-15 09:44:14,397 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,398 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,398 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,398 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,399 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,399 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,400 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:14,400 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,401 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:14,407 - root - INFO - Clearing user context 2025-12-15 09:44:14,407 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,407 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,408 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,408 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,409 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,409 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,415 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 09:44:14,419 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,420 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:44:14,420 - root - INFO - Clearing user context 2025-12-15 09:44:14,420 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,421 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,421 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,421 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,421 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,422 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,474 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,475 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,475 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,475 - root - INFO - Clearing user context 2025-12-15 09:44:14,475 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,475 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,475 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,476 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,476 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,476 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,582 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:14,583 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,583 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:14,583 - root - INFO - Clearing user context 2025-12-15 09:44:14,583 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,583 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,584 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,584 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,585 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,585 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,646 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,647 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,647 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,647 - root - INFO - Clearing user context 2025-12-15 09:44:14,648 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,648 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,649 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,649 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,649 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,651 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,709 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,710 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,711 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,712 - root - INFO - Clearing user context 2025-12-15 09:44:14,712 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,713 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,713 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,714 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,716 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,716 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,721 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,721 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,722 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,722 - root - INFO - Clearing user context 2025-12-15 09:44:14,722 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,723 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,724 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,724 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,724 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,725 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:14,832 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:14,833 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:14,833 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:14,834 - root - INFO - Clearing user context 2025-12-15 09:44:14,835 - root - INFO - User context cleared before authentication 2025-12-15 09:44:14,836 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:14,837 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:14,837 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:14,837 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:14,837 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,037 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,038 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,038 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,038 - root - INFO - Clearing user context 2025-12-15 09:44:15,039 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,039 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,039 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,039 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,039 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,040 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,149 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,149 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,149 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,149 - root - INFO - Clearing user context 2025-12-15 09:44:15,150 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,150 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,150 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,150 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,151 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,151 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,295 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,296 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,297 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,297 - root - INFO - Clearing user context 2025-12-15 09:44:15,298 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,298 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,299 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,299 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,299 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,300 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,409 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,411 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,412 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,414 - root - INFO - Clearing user context 2025-12-15 09:44:15,416 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,416 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,417 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,417 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,419 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,421 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,530 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,530 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,531 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,531 - root - INFO - Clearing user context 2025-12-15 09:44:15,531 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,532 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,532 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,533 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,533 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,533 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:15,947 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:15,948 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:15,948 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:15,948 - root - INFO - Clearing user context 2025-12-15 09:44:15,949 - root - INFO - User context cleared before authentication 2025-12-15 09:44:15,949 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:15,950 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:15,950 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:15,950 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:15,950 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:16,424 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:16,425 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:16,426 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:16,426 - root - INFO - Clearing user context 2025-12-15 09:44:16,429 - root - INFO - User context cleared before authentication 2025-12-15 09:44:16,431 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTYwNjM3NH0.eOERo6DJN_rm74zNsrldygYg-nI_ACB4IAV8sgNcZvc 2025-12-15 09:44:16,433 - root - ERROR - Token verification failed: Signature has expired 2025-12-15 09:44:16,434 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:16,434 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-15 09:44:16,435 - root - ERROR - Algorithm: HS256 2025-12-15 09:44:18,906 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-15 09:44:18,906 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:18,907 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-15 09:44:18,907 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-15 09:44:19,254 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 09:44:19,255 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,256 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 09:44:19,256 - root - INFO - Clearing user context 2025-12-15 09:44:19,256 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,257 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,261 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,261 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,262 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,262 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,264 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:19,265 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:44:19,266 - root - INFO - Looking for user with username: admin 2025-12-15 09:44:19,268 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:44:19,268 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,269 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:44:19,278 - root - INFO - Clearing user context 2025-12-15 09:44:19,286 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 09:44:19,286 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,287 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 09:44:19,287 - root - INFO - Clearing user context 2025-12-15 09:44:19,287 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,288 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,291 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,291 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,292 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,292 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,294 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:19,297 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:44:19,297 - root - INFO - Looking for user with username: admin 2025-12-15 09:44:19,299 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:44:19,299 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,300 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:44:19,307 - root - INFO - Clearing user context 2025-12-15 09:44:19,747 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:19,748 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,748 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:19,749 - root - INFO - Clearing user context 2025-12-15 09:44:19,749 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,750 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,752 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,753 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,754 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,758 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,760 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 09:44:19,762 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,762 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:44:19,763 - root - INFO - Clearing user context 2025-12-15 09:44:19,764 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,764 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,766 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,768 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,769 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,775 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,794 - root - INFO - Clearing user context 2025-12-15 09:44:19,794 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:19,797 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:44:19,799 - root - INFO - Looking for user with username: admin 2025-12-15 09:44:19,802 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:19,803 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:44:19,804 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,806 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:19,807 - root - INFO - Clearing user context 2025-12-15 09:44:19,804 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,807 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,807 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:44:19,808 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,816 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,816 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,817 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,819 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,855 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 09:44:19,856 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,857 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 09:44:19,858 - root - INFO - Clearing user context 2025-12-15 09:44:19,858 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,860 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,862 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,867 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,868 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,869 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,873 - root - INFO - Clearing user context 2025-12-15 09:44:19,881 - root - INFO - Clearing user context 2025-12-15 09:44:19,885 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 09:44:19,891 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,891 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:44:19,892 - root - INFO - Clearing user context 2025-12-15 09:44:19,892 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,893 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,897 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,898 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,898 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,899 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,900 - root - INFO - Clearing user context 2025-12-15 09:44:19,902 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 09:44:19,903 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:19,903 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 09:44:19,903 - root - INFO - Clearing user context 2025-12-15 09:44:19,904 - root - INFO - User context cleared before authentication 2025-12-15 09:44:19,904 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:19,907 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:19,907 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,908 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:19,908 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:19,913 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:44:19,916 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:44:19,916 - root - INFO - Clearing user context 2025-12-15 09:44:19,917 - root - INFO - Looking for user with username: admin 2025-12-15 09:44:19,919 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:44:19,920 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:19,921 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:44:19,940 - root - INFO - Clearing user context 2025-12-15 09:44:20,211 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 09:44:20,211 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:20,212 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 09:44:20,212 - root - INFO - Clearing user context 2025-12-15 09:44:20,212 - root - INFO - User context cleared before authentication 2025-12-15 09:44:20,212 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:20,214 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:20,214 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:20,214 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:20,214 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:20,217 - root - INFO - Clearing user context 2025-12-15 09:44:20,527 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 09:44:20,527 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:20,528 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 09:44:20,528 - root - INFO - Clearing user context 2025-12-15 09:44:20,529 - root - INFO - User context cleared before authentication 2025-12-15 09:44:20,529 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:20,531 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:20,532 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:20,532 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:20,534 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:20,539 - root - INFO - Clearing user context 2025-12-15 09:44:21,143 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/3 2025-12-15 09:44:21,143 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:21,144 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3 2025-12-15 09:44:21,144 - root - INFO - Clearing user context 2025-12-15 09:44:21,144 - root - INFO - User context cleared before authentication 2025-12-15 09:44:21,145 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:21,146 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:21,147 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:21,147 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:21,147 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:21,152 - root - INFO - Clearing user context 2025-12-15 09:44:21,462 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/3/messages 2025-12-15 09:44:21,462 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:21,463 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/messages 2025-12-15 09:44:21,463 - root - INFO - Clearing user context 2025-12-15 09:44:21,463 - root - INFO - User context cleared before authentication 2025-12-15 09:44:21,463 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:21,464 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:21,464 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:21,464 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:21,465 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:21,471 - root - INFO - Clearing user context 2025-12-15 09:44:33,473 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/3/chat/stream 2025-12-15 09:44:33,473 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:44:33,474 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/chat/stream 2025-12-15 09:44:33,474 - root - INFO - Clearing user context 2025-12-15 09:44:33,475 - root - INFO - User context cleared before authentication 2025-12-15 09:44:33,475 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:44:33,477 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:44:33,477 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:44:33,478 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:44:33,478 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:44:33,489 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-15 09:44:34,244 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-15 09:44:34,246 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF_AI\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-15 09:44:34,246 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF_AI\HXF\backend 2025-12-15 09:44:34,246 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-15 09:44:34,255 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 09:44:34,270 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 09:44:34,277 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-15 09:44:34,278 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF_AI\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-15 09:44:34,281 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF_AI\HXF\backend 2025-12-15 09:44:34,282 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-15 09:44:34,285 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-15 09:44:34,286 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-15 09:44:34,287 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-15 09:44:34,287 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-15 09:44:34,288 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-15 09:44:34,288 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-15 09:44:34,288 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-15 09:44:34,289 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-15 09:44:34,289 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-15 09:44:34,289 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-15 09:44:34,289 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-15 09:44:34,289 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-15 09:44:34,292 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-15 09:44:34,296 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-15 09:44:34,298 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-15 09:44:34,299 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-15 09:44:34,305 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-15 09:44:34,306 - th_agenter.redis_memory_service - INFO - Conversation history directory: E:\Work\HXF_AI\HXF\backend\th_agenter\services\..\..\conversation_history (exists: True) 2025-12-15 09:44:34,306 - th_agenter.redis_memory_service - INFO - Current working directory: E:\Work\HXF_AI\HXF\backend 2025-12-15 09:44:34,307 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-15 09:44:34,308 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 3 via LangChain 2025-12-15 09:44:34,308 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 3 2025-12-15 09:44:34,647 - root - INFO - Clearing user context 2025-12-15 09:44:36,139 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-15 09:44:37,806 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 3 2025-12-15 09:45:12,619 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 09:45:12,619 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:12,619 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:45:12,620 - root - INFO - Clearing user context 2025-12-15 09:45:12,620 - root - INFO - User context cleared before authentication 2025-12-15 09:45:12,620 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:12,623 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:12,623 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:12,623 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:12,624 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:12,626 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:12,627 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:12,627 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:12,629 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:12,630 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:12,631 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:12,643 - root - INFO - Clearing user context 2025-12-15 09:45:13,863 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/6/documents 2025-12-15 09:45:13,863 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/6/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:13,863 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/6/documents 2025-12-15 09:45:13,864 - root - INFO - Clearing user context 2025-12-15 09:45:13,864 - root - INFO - User context cleared before authentication 2025-12-15 09:45:13,864 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:13,866 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:13,866 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:13,867 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:13,867 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:13,869 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:13,869 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:13,870 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:13,872 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:13,872 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:13,872 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:13,880 - root - INFO - Clearing user context 2025-12-15 09:45:28,814 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/ 2025-12-15 09:45:28,814 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:28,815 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 09:45:28,816 - root - INFO - Clearing user context 2025-12-15 09:45:28,816 - root - INFO - User context cleared before authentication 2025-12-15 09:45:28,817 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:28,818 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:28,819 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:28,819 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:28,819 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:28,822 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:28,822 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:28,822 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:28,823 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:28,824 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:28,824 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:28,843 - th_agenter.services.knowledge_base - INFO - Created knowledge base: jcq_test1 (ID: 7) 2025-12-15 09:45:28,844 - root - INFO - Clearing user context 2025-12-15 09:45:30,609 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:45:30,610 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:30,610 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:45:30,611 - root - INFO - Clearing user context 2025-12-15 09:45:30,611 - root - INFO - User context cleared before authentication 2025-12-15 09:45:30,612 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:30,613 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:30,614 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:30,614 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:30,615 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:30,617 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:30,618 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:30,619 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:30,622 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:30,623 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:30,623 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:30,629 - root - INFO - Clearing user context 2025-12-15 09:45:48,029 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 09:45:48,030 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:48,031 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:45:48,031 - root - INFO - Clearing user context 2025-12-15 09:45:48,032 - root - INFO - User context cleared before authentication 2025-12-15 09:45:48,032 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:48,034 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:48,035 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:48,040 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:48,041 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:48,056 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:48,057 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:48,057 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:48,060 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:48,061 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:48,061 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:48,198 - th_agenter.services.document - INFO - Uploaded document: 发明专利申请说明书CN202411808464.5.pdf to KB 7 (Doc ID: 5) 2025-12-15 09:45:48,204 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 09:45:48,217 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 09:45:48,224 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 09:45:48,226 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f86b8ae2-1f23-46c3-97df-e27c8475381d_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 09:45:48,249 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f86b8ae2-1f23-46c3-97df-e27c8475381d_发明专利申请说明书CN202411808464.5.pdf, 页数: 0 2025-12-15 09:45:48,253 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 09:45:48,369 - th_agenter.services.document_processor - WARNING - 连接现有向量存储失败,创建新的向量存储: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:45:48,424 - th_agenter.services.document_processor - ERROR - 创建向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:45:48,426 - th_agenter.services.document_processor - ERROR - 添加文档到向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:45:48,429 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:45:48,436 - root - INFO - Clearing user context 2025-12-15 09:45:50,447 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:45:50,448 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:50,448 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:45:50,448 - root - INFO - Clearing user context 2025-12-15 09:45:50,448 - root - INFO - User context cleared before authentication 2025-12-15 09:45:50,448 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:50,449 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:50,449 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:50,450 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:50,450 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:50,451 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:50,451 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:50,452 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:50,453 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:50,454 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:50,457 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:50,463 - root - INFO - Clearing user context 2025-12-15 09:45:57,507 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 09:45:57,508 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:45:57,508 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 09:45:57,508 - root - INFO - Clearing user context 2025-12-15 09:45:57,508 - root - INFO - User context cleared before authentication 2025-12-15 09:45:57,508 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:45:57,509 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:45:57,510 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:57,510 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:45:57,510 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:45:57,512 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:45:57,512 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:45:57,512 - root - INFO - Looking for user with username: admin 2025-12-15 09:45:57,513 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:45:57,514 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:45:57,514 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:45:57,854 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:45:57,904 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 09:45:57,905 - root - INFO - Clearing user context 2025-12-15 09:49:09,884 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 09:49:09,885 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:49:09,886 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 09:49:09,886 - root - INFO - Clearing user context 2025-12-15 09:49:09,886 - root - INFO - User context cleared before authentication 2025-12-15 09:49:09,887 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:49:09,888 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:49:09,889 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:09,889 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:49:09,890 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:49:09,893 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:49:09,894 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:49:09,894 - root - INFO - Looking for user with username: admin 2025-12-15 09:49:09,894 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:49:09,896 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:09,896 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:49:09,906 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f86b8ae2-1f23-46c3-97df-e27c8475381d_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 09:49:09,940 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 09:49:09,940 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 09:49:09,952 - th_agenter.services.document - INFO - Deleted document: f86b8ae2-1f23-46c3-97df-e27c8475381d_发明专利申请说明书CN202411808464.5.pdf (ID: 5) 2025-12-15 09:49:09,953 - root - INFO - Clearing user context 2025-12-15 09:49:10,133 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:49:10,133 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:49:10,134 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:49:10,134 - root - INFO - Clearing user context 2025-12-15 09:49:10,135 - root - INFO - User context cleared before authentication 2025-12-15 09:49:10,135 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:49:10,136 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:49:10,136 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:10,136 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:49:10,137 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:49:10,138 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:49:10,139 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:49:10,139 - root - INFO - Looking for user with username: admin 2025-12-15 09:49:10,140 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:49:10,141 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:10,141 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:49:10,144 - root - INFO - Clearing user context 2025-12-15 09:49:13,138 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 09:49:13,139 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:49:13,139 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:49:13,140 - root - INFO - Clearing user context 2025-12-15 09:49:13,142 - root - INFO - User context cleared before authentication 2025-12-15 09:49:13,143 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:49:13,146 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:49:13,148 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:13,149 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:49:13,149 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:49:13,152 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:49:13,154 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:49:13,154 - root - INFO - Looking for user with username: admin 2025-12-15 09:49:13,156 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:49:13,156 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:13,157 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:49:13,175 - th_agenter.services.document - INFO - Uploaded document: 周报.txt to KB 7 (Doc ID: 5) 2025-12-15 09:49:13,179 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d9857870-20aa-44c6-9022-43502b369956_周报.txt 2025-12-15 09:49:13,180 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d9857870-20aa-44c6-9022-43502b369956_周报.txt, 页数: 1 2025-12-15 09:49:13,191 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-15 09:49:13,192 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 09:49:13,194 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 7 个文档块 2025-12-15 09:49:13,508 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:13,640 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:13,805 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:13,936 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:14,053 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:14,172 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:14,297 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:14,369 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-15 09:49:14,379 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 5, 'status': 'success', 'chunks_count': 7, 'message': '文档处理完成'} 2025-12-15 09:49:14,386 - th_agenter.services.document - INFO - Processed document: d9857870-20aa-44c6-9022-43502b369956_周报.txt (ID: 5) 2025-12-15 09:49:14,387 - root - INFO - Clearing user context 2025-12-15 09:49:16,710 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:49:16,713 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:49:16,713 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:49:16,714 - root - INFO - Clearing user context 2025-12-15 09:49:16,714 - root - INFO - User context cleared before authentication 2025-12-15 09:49:16,715 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:49:16,716 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:49:16,717 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:16,717 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:49:16,718 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:49:16,719 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:49:16,720 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:49:16,720 - root - INFO - Looking for user with username: admin 2025-12-15 09:49:16,722 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:49:16,722 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:16,723 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:49:16,727 - root - INFO - Clearing user context 2025-12-15 09:49:21,402 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 09:49:21,403 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:49:21,403 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 09:49:21,404 - root - INFO - Clearing user context 2025-12-15 09:49:21,404 - root - INFO - User context cleared before authentication 2025-12-15 09:49:21,404 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:49:21,406 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:49:21,406 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:21,406 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:49:21,407 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:49:21,409 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:49:21,410 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:49:21,410 - root - INFO - Looking for user with username: admin 2025-12-15 09:49:21,412 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:49:21,412 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:49:21,413 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:49:21,711 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:49:21,767 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-15 09:49:21,769 - root - INFO - Clearing user context 2025-12-15 09:53:04,488 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 09:53:04,488 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:04,488 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 09:53:04,489 - root - INFO - Clearing user context 2025-12-15 09:53:04,489 - root - INFO - User context cleared before authentication 2025-12-15 09:53:04,490 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:04,491 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:04,492 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:04,492 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:04,492 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:04,494 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:04,495 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:04,496 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:04,498 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:04,498 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:04,498 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:04,500 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d9857870-20aa-44c6-9022-43502b369956_周报.txt 2025-12-15 09:53:04,571 - th_agenter.services.document_processor - INFO - 成功删除 7 个文档块: document_id=5 2025-12-15 09:53:04,571 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 09:53:04,577 - th_agenter.services.document - INFO - Deleted document: d9857870-20aa-44c6-9022-43502b369956_周报.txt (ID: 5) 2025-12-15 09:53:04,579 - root - INFO - Clearing user context 2025-12-15 09:53:04,757 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:53:04,758 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:04,758 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:53:04,759 - root - INFO - Clearing user context 2025-12-15 09:53:04,759 - root - INFO - User context cleared before authentication 2025-12-15 09:53:04,759 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:04,761 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:04,762 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:04,762 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:04,763 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:04,765 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:04,765 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:04,766 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:04,767 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:04,767 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:04,768 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:04,774 - root - INFO - Clearing user context 2025-12-15 09:53:08,777 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 09:53:08,777 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:08,778 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:53:08,778 - root - INFO - Clearing user context 2025-12-15 09:53:08,778 - root - INFO - User context cleared before authentication 2025-12-15 09:53:08,779 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:08,781 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:08,782 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:08,782 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:08,783 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:08,795 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:08,796 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:08,797 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:08,798 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:08,799 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:08,800 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:08,819 - th_agenter.services.document - INFO - Uploaded document: 发明专利申请说明书CN202411808464.5.pdf to KB 7 (Doc ID: 5) 2025-12-15 09:53:08,822 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\20b12291-406f-4028-9e12-a1e809873e3a_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 09:53:08,855 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\20b12291-406f-4028-9e12-a1e809873e3a_发明专利申请说明书CN202411808464.5.pdf, 页数: 0 2025-12-15 09:53:08,856 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 09:53:08,923 - th_agenter.services.document_processor - WARNING - 连接现有向量存储失败,创建新的向量存储: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:53:08,984 - th_agenter.services.document_processor - ERROR - 创建向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:53:08,985 - th_agenter.services.document_processor - ERROR - 添加文档到向量存储失败: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:53:08,986 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: (psycopg.errors.NotNullViolation) null value in column "id" of relation "langchain_pg_embedding" violates not-null constraint DETAIL: Failing row contains (null, null, null, null, null). [SQL: INSERT INTO langchain_pg_embedding DEFAULT VALUES ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata] (Background on this error at: https://sqlalche.me/e/20/gkpj) 2025-12-15 09:53:08,996 - root - INFO - Clearing user context 2025-12-15 09:53:11,324 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:53:11,324 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:11,324 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:53:11,324 - root - INFO - Clearing user context 2025-12-15 09:53:11,324 - root - INFO - User context cleared before authentication 2025-12-15 09:53:11,325 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:11,326 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:11,327 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:11,327 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:11,327 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:11,329 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:11,329 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:11,329 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:11,330 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:11,334 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:11,334 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:11,352 - root - INFO - Clearing user context 2025-12-15 09:53:12,048 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 09:53:12,049 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:12,049 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 09:53:12,050 - root - INFO - Clearing user context 2025-12-15 09:53:12,050 - root - INFO - User context cleared before authentication 2025-12-15 09:53:12,050 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:12,052 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:12,052 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:12,053 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:12,053 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:12,055 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:12,056 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:12,056 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:12,058 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:12,058 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:12,059 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:12,064 - root - INFO - Clearing user context 2025-12-15 09:53:20,636 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 09:53:20,640 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:20,640 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 09:53:20,641 - root - INFO - Clearing user context 2025-12-15 09:53:20,641 - root - INFO - User context cleared before authentication 2025-12-15 09:53:20,641 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:20,643 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:20,643 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:20,643 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:20,643 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:20,646 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:20,647 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:20,647 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:20,649 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:20,649 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:20,650 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:20,986 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:53:21,046 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 09:53:21,048 - root - INFO - Clearing user context 2025-12-15 09:53:25,632 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 09:53:25,633 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:25,633 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 09:53:25,633 - root - INFO - Clearing user context 2025-12-15 09:53:25,633 - root - INFO - User context cleared before authentication 2025-12-15 09:53:25,634 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:25,635 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:25,636 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:25,636 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:25,636 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:25,639 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:25,640 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:25,641 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:25,642 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:25,643 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:25,644 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:25,873 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:53:25,926 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 09:53:25,927 - root - INFO - Clearing user context 2025-12-15 09:53:30,096 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 09:53:30,097 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 09:53:30,097 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 09:53:30,097 - root - INFO - Clearing user context 2025-12-15 09:53:30,097 - root - INFO - User context cleared before authentication 2025-12-15 09:53:30,098 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 09:53:30,099 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 09:53:30,099 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:30,099 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 09:53:30,100 - root - INFO - Verified current user ID in context: 2 2025-12-15 09:53:30,101 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 09:53:30,101 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 09:53:30,101 - root - INFO - Looking for user with username: admin 2025-12-15 09:53:30,102 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 09:53:30,102 - root - INFO - Verification - ContextVar user: admin 2025-12-15 09:53:30,102 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 09:53:30,328 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 09:53:30,384 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 09:53:30,386 - root - INFO - Clearing user context 2025-12-15 09:56:40,189 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 09:56:52,498 - root - INFO - Logging configured successfully 2025-12-15 09:56:52,638 - root - INFO - Logging configured successfully 2025-12-15 09:56:52,759 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:56:52,772 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:56:52,777 - root - INFO - Database tables created 2025-12-15 09:56:52,777 - root - INFO - Database initialized 2025-12-15 09:57:17,536 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 09:57:27,404 - root - INFO - Logging configured successfully 2025-12-15 09:57:27,556 - root - INFO - Logging configured successfully 2025-12-15 09:57:27,694 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:57:27,705 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:57:27,710 - root - INFO - Database tables created 2025-12-15 09:57:27,710 - root - INFO - Database initialized 2025-12-15 09:57:44,396 - root - INFO - Logging configured successfully 2025-12-15 09:57:44,592 - root - INFO - Logging configured successfully 2025-12-15 09:57:44,748 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:57:44,763 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:57:44,778 - root - INFO - Database tables created 2025-12-15 09:57:44,779 - root - INFO - Database initialized 2025-12-15 09:58:12,108 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 09:58:32,826 - root - INFO - Logging configured successfully 2025-12-15 09:58:33,056 - root - INFO - Logging configured successfully 2025-12-15 09:58:33,247 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:58:33,260 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:58:33,269 - root - INFO - Database tables created 2025-12-15 09:58:33,269 - root - INFO - Database initialized 2025-12-15 09:58:45,181 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 09:59:01,403 - root - INFO - Logging configured successfully 2025-12-15 09:59:01,606 - root - INFO - Logging configured successfully 2025-12-15 09:59:01,775 - root - INFO - Starting up TH-Agenter application... 2025-12-15 09:59:01,789 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 09:59:01,796 - root - INFO - Database tables created 2025-12-15 09:59:01,797 - root - INFO - Database initialized 2025-12-15 10:01:14,419 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:01:14,419 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:14,419 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:01:14,419 - root - INFO - Clearing user context 2025-12-15 10:01:14,419 - root - INFO - User context cleared before authentication 2025-12-15 10:01:14,419 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:14,444 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:14,444 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:14,444 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:14,445 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:14,448 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:14,448 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:14,449 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:14,450 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:14,450 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:14,450 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:14,460 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\20b12291-406f-4028-9e12-a1e809873e3a_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 10:01:14,464 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:01:14,573 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:01:14,584 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:01:14,738 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:01:14,739 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:01:14,753 - th_agenter.services.document - INFO - Deleted document: 20b12291-406f-4028-9e12-a1e809873e3a_发明专利申请说明书CN202411808464.5.pdf (ID: 5) 2025-12-15 10:01:14,753 - root - INFO - Clearing user context 2025-12-15 10:01:14,760 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:01:14,760 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:14,761 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:01:14,761 - root - INFO - Clearing user context 2025-12-15 10:01:14,761 - root - INFO - User context cleared before authentication 2025-12-15 10:01:14,761 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:14,763 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:14,763 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:14,763 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:14,763 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:14,764 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:14,764 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:14,765 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:14,765 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:14,766 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:14,766 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:14,777 - root - INFO - Clearing user context 2025-12-15 10:01:20,419 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:01:20,425 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:20,426 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:01:20,427 - root - INFO - Clearing user context 2025-12-15 10:01:20,428 - root - INFO - User context cleared before authentication 2025-12-15 10:01:20,428 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:20,436 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:20,437 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:20,437 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:20,437 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:20,442 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:20,443 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:20,444 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:20,445 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:20,446 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:20,446 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:20,613 - th_agenter.services.document - INFO - Uploaded document: testpdf.pdf to KB 7 (Doc ID: 5) 2025-12-15 10:01:20,616 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\6cfe36cf-273c-4c3f-b8cf-2f9dea0b4790_testpdf.pdf 2025-12-15 10:01:21,293 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\6cfe36cf-273c-4c3f-b8cf-2f9dea0b4790_testpdf.pdf, 页数: 2 2025-12-15 10:01:21,299 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-15 10:01:21,300 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 10:01:21,302 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 4 个文档块 2025-12-15 10:01:22,463 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:22,589 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:22,745 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:22,869 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:22,946 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-15 10:01:22,962 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 5, 'status': 'success', 'chunks_count': 4, 'message': '文档处理完成'} 2025-12-15 10:01:22,973 - th_agenter.services.document - INFO - Processed document: 6cfe36cf-273c-4c3f-b8cf-2f9dea0b4790_testpdf.pdf (ID: 5) 2025-12-15 10:01:22,974 - root - INFO - Clearing user context 2025-12-15 10:01:24,984 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:01:24,984 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:24,984 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:01:24,984 - root - INFO - Clearing user context 2025-12-15 10:01:24,984 - root - INFO - User context cleared before authentication 2025-12-15 10:01:24,984 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:24,985 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:24,985 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:24,985 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:24,986 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:24,986 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:24,987 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:24,987 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:24,990 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:24,991 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:24,992 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:24,997 - root - INFO - Clearing user context 2025-12-15 10:01:39,011 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 10:01:39,012 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:39,012 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 10:01:39,013 - root - INFO - Clearing user context 2025-12-15 10:01:39,013 - root - INFO - User context cleared before authentication 2025-12-15 10:01:39,013 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:39,015 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:39,016 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:39,017 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:39,018 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:39,020 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:39,020 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:39,021 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:39,023 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:39,024 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:39,025 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:39,352 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:39,403 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 4 个相关文档 2025-12-15 10:01:39,404 - root - INFO - Clearing user context 2025-12-15 10:01:46,896 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 10:01:46,897 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:01:46,897 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 10:01:46,898 - root - INFO - Clearing user context 2025-12-15 10:01:46,898 - root - INFO - User context cleared before authentication 2025-12-15 10:01:46,898 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:01:46,900 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:01:46,900 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:46,901 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:01:46,901 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:01:46,905 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:01:46,906 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:01:46,907 - root - INFO - Looking for user with username: admin 2025-12-15 10:01:46,908 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:01:46,908 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:01:46,909 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:01:47,188 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:01:47,243 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 4 个相关文档 2025-12-15 10:01:47,244 - root - INFO - Clearing user context 2025-12-15 10:03:05,912 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:09:54,155 - root - INFO - Logging configured successfully 2025-12-15 10:09:54,330 - root - INFO - Logging configured successfully 2025-12-15 10:09:54,473 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:09:54,482 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:09:54,487 - root - INFO - Database tables created 2025-12-15 10:09:54,487 - root - INFO - Database initialized 2025-12-15 10:10:14,240 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:10:14,241 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:14,241 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:10:14,242 - root - INFO - Clearing user context 2025-12-15 10:10:14,242 - root - INFO - User context cleared before authentication 2025-12-15 10:10:14,242 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:14,301 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:14,302 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:14,302 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:14,302 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:14,308 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:14,309 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:14,310 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:14,314 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:14,315 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:14,316 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:14,494 - th_agenter.services.document - INFO - Uploaded document: testdoc.doc to KB 7 (Doc ID: 6) 2025-12-15 10:10:14,500 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:10:14,591 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:10:14,596 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:10:14,600 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 6, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9a5bf938-37f8-4726-a095-841e45081f3a_testdoc.doc 2025-12-15 10:10:14,602 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9a5bf938-37f8-4726-a095-841e45081f3a_testdoc.doc: No module named 'docx2txt' 2025-12-15 10:10:14,603 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 6: No module named 'docx2txt' 2025-12-15 10:10:14,610 - root - INFO - Clearing user context 2025-12-15 10:10:16,919 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:10:16,920 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:16,920 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:10:16,920 - root - INFO - Clearing user context 2025-12-15 10:10:16,920 - root - INFO - User context cleared before authentication 2025-12-15 10:10:16,920 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:16,921 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:16,922 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:16,922 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:16,922 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:16,925 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:16,925 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:16,926 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:16,927 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:16,928 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:16,928 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:16,943 - root - INFO - Clearing user context 2025-12-15 10:10:20,961 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:10:20,962 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:20,962 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:10:20,962 - root - INFO - Clearing user context 2025-12-15 10:10:20,962 - root - INFO - User context cleared before authentication 2025-12-15 10:10:20,963 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:20,965 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:20,965 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:20,965 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:20,966 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:20,968 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:20,968 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:20,969 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:20,970 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:20,971 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:20,971 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:20,977 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\6cfe36cf-273c-4c3f-b8cf-2f9dea0b4790_testpdf.pdf 2025-12-15 10:10:21,103 - th_agenter.services.document_processor - INFO - 成功删除 4 个文档块: document_id=5 2025-12-15 10:10:21,104 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:10:21,118 - th_agenter.services.document - INFO - Deleted document: 6cfe36cf-273c-4c3f-b8cf-2f9dea0b4790_testpdf.pdf (ID: 5) 2025-12-15 10:10:21,121 - root - INFO - Clearing user context 2025-12-15 10:10:21,434 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:10:21,434 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:21,434 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:10:21,434 - root - INFO - Clearing user context 2025-12-15 10:10:21,435 - root - INFO - User context cleared before authentication 2025-12-15 10:10:21,435 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:21,436 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:21,436 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:21,436 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:21,436 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:21,437 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:21,438 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:21,438 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:21,439 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:21,439 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:21,440 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:21,443 - root - INFO - Clearing user context 2025-12-15 10:10:27,045 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 10:10:27,046 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:27,046 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 10:10:27,046 - root - INFO - Clearing user context 2025-12-15 10:10:27,046 - root - INFO - User context cleared before authentication 2025-12-15 10:10:27,047 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:27,049 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:27,049 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:27,049 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:27,050 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:27,052 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:27,053 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:27,055 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:27,057 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:27,057 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:27,058 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:27,870 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:10:28,273 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 10:10:28,275 - root - INFO - Clearing user context 2025-12-15 10:10:32,748 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/6 2025-12-15 10:10:32,748 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/6 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:32,748 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/6 2025-12-15 10:10:32,749 - root - INFO - Clearing user context 2025-12-15 10:10:32,749 - root - INFO - User context cleared before authentication 2025-12-15 10:10:32,749 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:32,750 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:32,750 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:32,750 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:32,751 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:32,751 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:32,752 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:32,752 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:32,752 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:32,753 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:32,753 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:32,754 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9a5bf938-37f8-4726-a095-841e45081f3a_testdoc.doc 2025-12-15 10:10:32,819 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=6 2025-12-15 10:10:32,820 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=6 2025-12-15 10:10:32,833 - th_agenter.services.document - INFO - Deleted document: 9a5bf938-37f8-4726-a095-841e45081f3a_testdoc.doc (ID: 6) 2025-12-15 10:10:32,834 - root - INFO - Clearing user context 2025-12-15 10:10:33,015 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:10:33,016 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:10:33,016 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:10:33,017 - root - INFO - Clearing user context 2025-12-15 10:10:33,018 - root - INFO - User context cleared before authentication 2025-12-15 10:10:33,018 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:10:33,020 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:10:33,020 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:33,020 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:10:33,021 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:10:33,023 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:10:33,024 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:10:33,024 - root - INFO - Looking for user with username: admin 2025-12-15 10:10:33,025 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:10:33,026 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:10:33,026 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:10:33,033 - root - INFO - Clearing user context 2025-12-15 10:11:19,728 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:11:19,729 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:19,730 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:19,730 - root - INFO - Clearing user context 2025-12-15 10:11:19,730 - root - INFO - User context cleared before authentication 2025-12-15 10:11:19,731 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:19,733 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:19,733 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:19,733 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:19,734 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:19,741 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:19,741 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:19,742 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:19,745 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:19,745 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:19,746 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:19,765 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:11:19,769 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\13410d79-ff5c-4cca-a88f-afdd4a3c326f_testdoc1.doc 2025-12-15 10:11:19,772 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\13410d79-ff5c-4cca-a88f-afdd4a3c326f_testdoc1.doc: No module named 'docx2txt' 2025-12-15 10:11:19,772 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: No module named 'docx2txt' 2025-12-15 10:11:19,777 - root - INFO - Clearing user context 2025-12-15 10:11:22,105 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:11:22,106 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:22,106 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:22,106 - root - INFO - Clearing user context 2025-12-15 10:11:22,106 - root - INFO - User context cleared before authentication 2025-12-15 10:11:22,106 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:22,107 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:22,108 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:22,108 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:22,108 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:22,109 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:22,109 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:22,110 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:22,110 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:22,110 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:22,111 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:22,113 - root - INFO - Clearing user context 2025-12-15 10:11:27,768 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 10:11:27,769 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:27,769 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 10:11:27,769 - root - INFO - Clearing user context 2025-12-15 10:11:27,770 - root - INFO - User context cleared before authentication 2025-12-15 10:11:27,770 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:27,772 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:27,772 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:27,772 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:27,773 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:27,776 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:27,778 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:27,779 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:27,781 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:27,781 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:27,782 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:28,195 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:11:28,255 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 10:11:28,256 - root - INFO - Clearing user context 2025-12-15 10:11:44,078 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:11:44,079 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:44,079 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:44,080 - root - INFO - Clearing user context 2025-12-15 10:11:44,081 - root - INFO - User context cleared before authentication 2025-12-15 10:11:44,081 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:44,083 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:44,084 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:44,085 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:44,085 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:44,090 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:44,092 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:44,093 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:44,094 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:44,095 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:44,095 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:44,117 - th_agenter.services.document - INFO - Uploaded document: testpdf.pdf to KB 7 (Doc ID: 6) 2025-12-15 10:11:44,120 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 6, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\7932d340-5bf8-4b2c-8c33-2d824baa4d65_testpdf.pdf 2025-12-15 10:11:44,719 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\7932d340-5bf8-4b2c-8c33-2d824baa4d65_testpdf.pdf, 页数: 2 2025-12-15 10:11:44,726 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-15 10:11:44,727 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 10:11:44,727 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 4 个文档块 2025-12-15 10:11:45,025 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:11:45,190 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:11:45,348 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:11:45,494 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 10:11:45,570 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-15 10:11:45,587 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 6, 'status': 'success', 'chunks_count': 4, 'message': '文档处理完成'} 2025-12-15 10:11:45,607 - th_agenter.services.document - INFO - Processed document: 7932d340-5bf8-4b2c-8c33-2d824baa4d65_testpdf.pdf (ID: 6) 2025-12-15 10:11:45,611 - root - INFO - Clearing user context 2025-12-15 10:11:47,622 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:11:47,623 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:47,623 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:47,623 - root - INFO - Clearing user context 2025-12-15 10:11:47,624 - root - INFO - User context cleared before authentication 2025-12-15 10:11:47,624 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:47,627 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:47,630 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:47,631 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:47,631 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:47,636 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:47,637 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:47,638 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:47,640 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:47,640 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:47,640 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:47,645 - root - INFO - Clearing user context 2025-12-15 10:11:51,234 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:11:51,234 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:51,235 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:11:51,235 - root - INFO - Clearing user context 2025-12-15 10:11:51,236 - root - INFO - User context cleared before authentication 2025-12-15 10:11:51,236 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:51,239 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:51,239 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:51,240 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:51,240 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:51,243 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:51,244 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:51,244 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:51,245 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:51,246 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:51,246 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:51,249 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\13410d79-ff5c-4cca-a88f-afdd4a3c326f_testdoc1.doc 2025-12-15 10:11:51,312 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:11:51,313 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:11:51,324 - th_agenter.services.document - INFO - Deleted document: 13410d79-ff5c-4cca-a88f-afdd4a3c326f_testdoc1.doc (ID: 5) 2025-12-15 10:11:51,327 - root - INFO - Clearing user context 2025-12-15 10:11:51,501 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:11:51,501 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:51,501 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:51,501 - root - INFO - Clearing user context 2025-12-15 10:11:51,502 - root - INFO - User context cleared before authentication 2025-12-15 10:11:51,502 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:51,503 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:51,503 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:51,503 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:51,503 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:51,504 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:51,505 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:51,505 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:51,506 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:51,506 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:51,506 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:51,509 - root - INFO - Clearing user context 2025-12-15 10:11:58,225 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/6 2025-12-15 10:11:58,226 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/6 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:58,226 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/6 2025-12-15 10:11:58,227 - root - INFO - Clearing user context 2025-12-15 10:11:58,227 - root - INFO - User context cleared before authentication 2025-12-15 10:11:58,227 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:58,229 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:58,230 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:58,230 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:58,231 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:58,233 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:58,234 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:58,234 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:58,235 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:58,236 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:58,236 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:58,239 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\7932d340-5bf8-4b2c-8c33-2d824baa4d65_testpdf.pdf 2025-12-15 10:11:58,317 - th_agenter.services.document_processor - INFO - 成功删除 4 个文档块: document_id=6 2025-12-15 10:11:58,318 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=6 2025-12-15 10:11:58,332 - th_agenter.services.document - INFO - Deleted document: 7932d340-5bf8-4b2c-8c33-2d824baa4d65_testpdf.pdf (ID: 6) 2025-12-15 10:11:58,333 - root - INFO - Clearing user context 2025-12-15 10:11:58,656 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:11:58,656 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:11:58,657 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:11:58,657 - root - INFO - Clearing user context 2025-12-15 10:11:58,657 - root - INFO - User context cleared before authentication 2025-12-15 10:11:58,658 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:11:58,659 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:11:58,659 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:58,659 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:11:58,659 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:11:58,662 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:11:58,662 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:11:58,663 - root - INFO - Looking for user with username: admin 2025-12-15 10:11:58,664 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:11:58,665 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:11:58,665 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:11:58,671 - root - INFO - Clearing user context 2025-12-15 10:12:01,457 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:12:01,459 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:12:01,460 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:12:01,461 - root - INFO - Clearing user context 2025-12-15 10:12:01,461 - root - INFO - User context cleared before authentication 2025-12-15 10:12:01,462 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:12:01,464 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:12:01,465 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:12:01,466 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:12:01,467 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:12:01,470 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:12:01,471 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:12:01,471 - root - INFO - Looking for user with username: admin 2025-12-15 10:12:01,473 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:12:01,473 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:12:01,474 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:12:01,497 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:12:01,501 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\b3379b05-ba6c-4b6d-bb76-48a9d6153eb8_testdoc1.doc 2025-12-15 10:12:01,504 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\b3379b05-ba6c-4b6d-bb76-48a9d6153eb8_testdoc1.doc: No module named 'docx2txt' 2025-12-15 10:12:01,505 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: No module named 'docx2txt' 2025-12-15 10:12:01,509 - root - INFO - Clearing user context 2025-12-15 10:12:03,840 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:12:03,841 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:12:03,841 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:12:03,842 - root - INFO - Clearing user context 2025-12-15 10:12:03,842 - root - INFO - User context cleared before authentication 2025-12-15 10:12:03,842 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:12:03,843 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:12:03,844 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:12:03,844 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:12:03,844 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:12:03,845 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:12:03,845 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:12:03,845 - root - INFO - Looking for user with username: admin 2025-12-15 10:12:03,846 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:12:03,846 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:12:03,846 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:12:03,850 - root - INFO - Clearing user context 2025-12-15 10:14:58,558 - root - INFO - Logging configured successfully 2025-12-15 10:14:58,722 - root - INFO - Logging configured successfully 2025-12-15 10:14:58,865 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:14:58,879 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:14:58,884 - root - INFO - Database tables created 2025-12-15 10:14:58,884 - root - INFO - Database initialized 2025-12-15 10:15:09,264 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 10:15:09,266 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:09,267 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 10:15:09,268 - root - INFO - Clearing user context 2025-12-15 10:15:09,268 - root - INFO - User context cleared before authentication 2025-12-15 10:15:09,268 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:09,316 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:09,316 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,317 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:09,317 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:09,320 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:09,320 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:09,321 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:09,322 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:09,322 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,322 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:09,327 - root - INFO - Clearing user context 2025-12-15 10:15:09,334 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 10:15:09,334 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:09,334 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 10:15:09,334 - root - INFO - Clearing user context 2025-12-15 10:15:09,335 - root - INFO - User context cleared before authentication 2025-12-15 10:15:09,335 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:09,336 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:09,336 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,336 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:09,336 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:09,340 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:09,341 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:09,341 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:09,343 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:09,344 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,345 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:09,357 - root - INFO - Clearing user context 2025-12-15 10:15:09,760 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 10:15:09,760 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:09,760 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 10:15:09,760 - root - INFO - Clearing user context 2025-12-15 10:15:09,761 - root - INFO - User context cleared before authentication 2025-12-15 10:15:09,761 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:09,765 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:09,776 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,777 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:09,778 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:09,780 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 10:15:09,783 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:09,784 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 10:15:09,785 - root - INFO - Clearing user context 2025-12-15 10:15:09,787 - root - INFO - User context cleared before authentication 2025-12-15 10:15:09,789 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:09,792 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:09,793 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,793 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:09,794 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:09,808 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:09,809 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:09,810 - root - INFO - Clearing user context 2025-12-15 10:15:09,811 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:09,815 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:09,816 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,817 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:09,855 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 10:15:09,855 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:09,855 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 10:15:09,856 - root - INFO - Clearing user context 2025-12-15 10:15:09,856 - root - INFO - User context cleared before authentication 2025-12-15 10:15:09,856 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:09,858 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:09,859 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:09,859 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:09,859 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:09,861 - root - INFO - Clearing user context 2025-12-15 10:15:09,866 - root - INFO - Clearing user context 2025-12-15 10:15:54,044 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 10:15:54,044 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:54,044 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 10:15:54,044 - root - INFO - Clearing user context 2025-12-15 10:15:54,044 - root - INFO - User context cleared before authentication 2025-12-15 10:15:54,045 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:54,047 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:54,048 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,049 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:54,049 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:54,052 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:54,052 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:54,053 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:54,054 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:54,055 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,055 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:54,057 - root - INFO - Clearing user context 2025-12-15 10:15:54,261 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 10:15:54,261 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:54,262 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 10:15:54,262 - root - INFO - Clearing user context 2025-12-15 10:15:54,262 - root - INFO - User context cleared before authentication 2025-12-15 10:15:54,262 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:54,263 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:54,263 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,263 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:54,263 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:54,264 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:54,265 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:54,265 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:54,266 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:54,267 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,267 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:54,270 - root - INFO - Clearing user context 2025-12-15 10:15:54,382 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 10:15:54,384 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:54,385 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 10:15:54,385 - root - INFO - Clearing user context 2025-12-15 10:15:54,386 - root - INFO - User context cleared before authentication 2025-12-15 10:15:54,387 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:54,391 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:54,392 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,393 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:54,393 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:54,396 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 10:15:54,396 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:54,401 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 10:15:54,402 - root - INFO - Clearing user context 2025-12-15 10:15:54,403 - root - INFO - User context cleared before authentication 2025-12-15 10:15:54,403 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:54,406 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:54,407 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,409 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:54,410 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:54,422 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:54,424 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:54,424 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:54,425 - root - INFO - Clearing user context 2025-12-15 10:15:54,426 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:54,427 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,428 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:54,452 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 10:15:54,453 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:54,454 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 10:15:54,454 - root - INFO - Clearing user context 2025-12-15 10:15:54,455 - root - INFO - User context cleared before authentication 2025-12-15 10:15:54,456 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:54,459 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:54,461 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:54,462 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:54,466 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:54,468 - root - INFO - Clearing user context 2025-12-15 10:15:54,474 - root - INFO - Clearing user context 2025-12-15 10:15:55,457 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:15:55,458 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:55,458 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:15:55,459 - root - INFO - Clearing user context 2025-12-15 10:15:55,459 - root - INFO - User context cleared before authentication 2025-12-15 10:15:55,459 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:55,461 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:55,462 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:55,462 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:55,463 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:55,466 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:55,467 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:55,468 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:55,469 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:55,470 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:55,470 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:55,476 - root - INFO - Clearing user context 2025-12-15 10:15:58,497 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:15:58,498 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:58,498 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:15:58,498 - root - INFO - Clearing user context 2025-12-15 10:15:58,499 - root - INFO - User context cleared before authentication 2025-12-15 10:15:58,499 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:58,501 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:58,501 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:58,502 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:58,502 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:58,503 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:58,504 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:58,504 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:58,505 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:58,505 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:58,506 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:58,517 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\b3379b05-ba6c-4b6d-bb76-48a9d6153eb8_testdoc1.doc 2025-12-15 10:15:58,527 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:15:58,684 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:15:58,696 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:15:58,775 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:15:58,775 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:15:58,792 - th_agenter.services.document - INFO - Deleted document: b3379b05-ba6c-4b6d-bb76-48a9d6153eb8_testdoc1.doc (ID: 5) 2025-12-15 10:15:58,804 - root - INFO - Clearing user context 2025-12-15 10:15:58,815 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:15:58,817 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:15:58,818 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:15:58,818 - root - INFO - Clearing user context 2025-12-15 10:15:58,818 - root - INFO - User context cleared before authentication 2025-12-15 10:15:58,818 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:15:58,820 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:15:58,820 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:58,820 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:15:58,821 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:15:58,823 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:15:58,823 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:15:58,823 - root - INFO - Looking for user with username: admin 2025-12-15 10:15:58,824 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:15:58,825 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:15:58,825 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:15:58,828 - root - INFO - Clearing user context 2025-12-15 10:16:02,236 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:16:02,236 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:16:02,236 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:16:02,237 - root - INFO - Clearing user context 2025-12-15 10:16:02,237 - root - INFO - User context cleared before authentication 2025-12-15 10:16:02,237 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:16:02,240 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:16:02,240 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:16:02,240 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:16:02,241 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:16:02,245 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:16:02,245 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:16:02,246 - root - INFO - Looking for user with username: admin 2025-12-15 10:16:02,247 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:16:02,247 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:16:02,247 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:16:02,423 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:16:02,427 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\ea34fe48-b70f-46c8-bb7e-5dabf874deb1_testdoc1.doc 2025-12-15 10:16:02,431 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\ea34fe48-b70f-46c8-bb7e-5dabf874deb1_testdoc1.doc: No module named 'docx2txt' 2025-12-15 10:16:02,432 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: No module named 'docx2txt' 2025-12-15 10:16:02,443 - root - INFO - Clearing user context 2025-12-15 10:16:04,473 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:16:04,478 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:16:04,478 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:16:04,478 - root - INFO - Clearing user context 2025-12-15 10:16:04,478 - root - INFO - User context cleared before authentication 2025-12-15 10:16:04,478 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:16:04,480 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:16:04,480 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:16:04,481 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:16:04,481 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:16:04,484 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:16:04,494 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:16:04,495 - root - INFO - Looking for user with username: admin 2025-12-15 10:16:04,497 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:16:04,497 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:16:04,498 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:16:04,501 - root - INFO - Clearing user context 2025-12-15 10:18:19,458 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:18:30,892 - root - INFO - Logging configured successfully 2025-12-15 10:18:31,031 - root - INFO - Logging configured successfully 2025-12-15 10:18:31,150 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:18:31,163 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:18:31,167 - root - INFO - Database tables created 2025-12-15 10:18:31,167 - root - INFO - Database initialized 2025-12-15 10:18:50,828 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:19:01,776 - root - INFO - Logging configured successfully 2025-12-15 10:19:01,921 - root - INFO - Logging configured successfully 2025-12-15 10:19:02,043 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:19:02,053 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:19:02,057 - root - INFO - Database tables created 2025-12-15 10:19:02,058 - root - INFO - Database initialized 2025-12-15 10:19:12,937 - root - INFO - Logging configured successfully 2025-12-15 10:19:13,090 - root - INFO - Logging configured successfully 2025-12-15 10:19:13,226 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:19:13,236 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:19:13,241 - root - INFO - Database tables created 2025-12-15 10:19:13,241 - root - INFO - Database initialized 2025-12-15 10:19:52,316 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:20:02,838 - root - INFO - Logging configured successfully 2025-12-15 10:20:02,968 - root - INFO - Logging configured successfully 2025-12-15 10:20:03,081 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:20:03,089 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:20:03,094 - root - INFO - Database tables created 2025-12-15 10:20:03,094 - root - INFO - Database initialized 2025-12-15 10:20:42,623 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:20:42,625 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:20:42,625 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:20:42,625 - root - INFO - Clearing user context 2025-12-15 10:20:42,626 - root - INFO - User context cleared before authentication 2025-12-15 10:20:42,626 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:20:42,652 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:20:42,653 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:42,653 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:20:42,653 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:20:42,656 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:20:42,657 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:20:42,657 - root - INFO - Looking for user with username: admin 2025-12-15 10:20:42,658 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:20:42,658 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:42,659 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:20:42,667 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\ea34fe48-b70f-46c8-bb7e-5dabf874deb1_testdoc1.doc 2025-12-15 10:20:42,673 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:20:42,746 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:20:42,749 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:20:42,816 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:20:42,816 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:20:42,827 - th_agenter.services.document - INFO - Deleted document: ea34fe48-b70f-46c8-bb7e-5dabf874deb1_testdoc1.doc (ID: 5) 2025-12-15 10:20:42,829 - root - INFO - Clearing user context 2025-12-15 10:20:42,886 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:20:42,886 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:20:42,886 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:20:42,887 - root - INFO - Clearing user context 2025-12-15 10:20:42,887 - root - INFO - User context cleared before authentication 2025-12-15 10:20:42,887 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:20:42,889 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:20:42,889 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:42,889 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:20:42,889 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:20:42,890 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:20:42,891 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:20:42,891 - root - INFO - Looking for user with username: admin 2025-12-15 10:20:42,892 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:20:42,892 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:42,893 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:20:42,900 - root - INFO - Clearing user context 2025-12-15 10:20:49,222 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:20:49,222 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:20:49,222 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:20:49,222 - root - INFO - Clearing user context 2025-12-15 10:20:49,223 - root - INFO - User context cleared before authentication 2025-12-15 10:20:49,223 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:20:49,225 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:20:49,225 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:49,225 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:20:49,226 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:20:49,228 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:20:49,229 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:20:49,229 - root - INFO - Looking for user with username: admin 2025-12-15 10:20:49,230 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:20:49,231 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:49,231 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:20:49,321 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:20:49,324 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9f1f03f8-7e00-4527-9d35-297be432e7f2_testdoc1.doc 2025-12-15 10:20:49,326 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9f1f03f8-7e00-4527-9d35-297be432e7f2_testdoc1.doc: No module named 'docx2txt' 2025-12-15 10:20:49,326 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: No module named 'docx2txt' 2025-12-15 10:20:49,330 - root - INFO - Clearing user context 2025-12-15 10:20:51,659 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:20:51,659 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:20:51,659 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:20:51,660 - root - INFO - Clearing user context 2025-12-15 10:20:51,660 - root - INFO - User context cleared before authentication 2025-12-15 10:20:51,660 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:20:51,662 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:20:51,662 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:51,662 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:20:51,662 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:20:51,664 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:20:51,665 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:20:51,665 - root - INFO - Looking for user with username: admin 2025-12-15 10:20:51,666 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:20:51,666 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:20:51,666 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:20:51,670 - root - INFO - Clearing user context 2025-12-15 10:21:31,648 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:21:31,649 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:21:31,649 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:21:31,650 - root - INFO - Clearing user context 2025-12-15 10:21:31,650 - root - INFO - User context cleared before authentication 2025-12-15 10:21:31,650 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:21:31,651 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:21:31,652 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:21:31,652 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:21:31,653 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:21:31,655 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:21:31,655 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:21:31,656 - root - INFO - Looking for user with username: admin 2025-12-15 10:21:31,657 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:21:31,657 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:21:31,658 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:21:31,660 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\9f1f03f8-7e00-4527-9d35-297be432e7f2_testdoc1.doc 2025-12-15 10:21:31,723 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:21:31,725 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:21:31,739 - th_agenter.services.document - INFO - Deleted document: 9f1f03f8-7e00-4527-9d35-297be432e7f2_testdoc1.doc (ID: 5) 2025-12-15 10:21:31,741 - root - INFO - Clearing user context 2025-12-15 10:21:32,057 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:21:32,058 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:21:32,058 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:21:32,058 - root - INFO - Clearing user context 2025-12-15 10:21:32,058 - root - INFO - User context cleared before authentication 2025-12-15 10:21:32,059 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:21:32,060 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:21:32,061 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:21:32,061 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:21:32,061 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:21:32,064 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:21:32,064 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:21:32,065 - root - INFO - Looking for user with username: admin 2025-12-15 10:21:32,066 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:21:32,066 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:21:32,067 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:21:32,072 - root - INFO - Clearing user context 2025-12-15 10:23:54,102 - root - INFO - Logging configured successfully 2025-12-15 10:23:54,256 - root - INFO - Logging configured successfully 2025-12-15 10:23:54,393 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:23:54,402 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:23:54,407 - root - INFO - Database tables created 2025-12-15 10:23:54,408 - root - INFO - Database initialized 2025-12-15 10:24:15,453 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 10:24:15,454 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:15,454 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 10:24:15,454 - root - INFO - Clearing user context 2025-12-15 10:24:15,455 - root - INFO - User context cleared before authentication 2025-12-15 10:24:15,455 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:15,498 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:15,498 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:15,499 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:15,499 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:15,504 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:15,505 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:15,505 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:15,506 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:15,507 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:15,507 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:15,513 - root - INFO - Clearing user context 2025-12-15 10:24:15,524 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 10:24:15,524 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:15,525 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 10:24:15,525 - root - INFO - Clearing user context 2025-12-15 10:24:15,526 - root - INFO - User context cleared before authentication 2025-12-15 10:24:15,526 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:15,528 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:15,529 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:15,529 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:15,529 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:15,532 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:15,532 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:15,533 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:15,535 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:15,535 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:15,535 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:15,545 - root - INFO - Clearing user context 2025-12-15 10:24:16,077 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 10:24:16,078 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:16,078 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 10:24:16,079 - root - INFO - Clearing user context 2025-12-15 10:24:16,079 - root - INFO - User context cleared before authentication 2025-12-15 10:24:16,080 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:16,082 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:16,083 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:16,084 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:16,084 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:16,086 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 10:24:16,087 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:16,087 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 10:24:16,088 - root - INFO - Clearing user context 2025-12-15 10:24:16,088 - root - INFO - User context cleared before authentication 2025-12-15 10:24:16,089 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:16,091 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:16,092 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:16,092 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:16,093 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:16,098 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:16,104 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:16,106 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:16,109 - root - INFO - Clearing user context 2025-12-15 10:24:16,112 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:16,112 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:16,113 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:16,148 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 10:24:16,148 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:16,149 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 10:24:16,149 - root - INFO - Clearing user context 2025-12-15 10:24:16,150 - root - INFO - User context cleared before authentication 2025-12-15 10:24:16,150 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:16,152 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:16,152 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:16,153 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:16,153 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:16,155 - root - INFO - Clearing user context 2025-12-15 10:24:16,161 - root - INFO - Clearing user context 2025-12-15 10:24:18,270 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 10:24:18,271 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:18,272 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 10:24:18,272 - root - INFO - Clearing user context 2025-12-15 10:24:18,273 - root - INFO - User context cleared before authentication 2025-12-15 10:24:18,273 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:18,275 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:18,275 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,276 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:18,276 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:18,278 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:18,278 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:18,279 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:18,281 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:18,281 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,281 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:18,284 - root - INFO - Clearing user context 2025-12-15 10:24:18,291 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 10:24:18,291 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:18,291 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 10:24:18,292 - root - INFO - Clearing user context 2025-12-15 10:24:18,292 - root - INFO - User context cleared before authentication 2025-12-15 10:24:18,293 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:18,295 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:18,295 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,296 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:18,296 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:18,299 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:18,299 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:18,299 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:18,300 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:18,301 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,301 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:18,305 - root - INFO - Clearing user context 2025-12-15 10:24:18,411 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 10:24:18,411 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:18,412 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 10:24:18,412 - root - INFO - Clearing user context 2025-12-15 10:24:18,413 - root - INFO - User context cleared before authentication 2025-12-15 10:24:18,413 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:18,414 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:18,415 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,416 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:18,416 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:18,419 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:18,419 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:18,420 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:18,421 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:18,421 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,422 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:18,436 - root - INFO - Clearing user context 2025-12-15 10:24:18,528 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 10:24:18,528 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:18,529 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 10:24:18,529 - root - INFO - Clearing user context 2025-12-15 10:24:18,530 - root - INFO - User context cleared before authentication 2025-12-15 10:24:18,530 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:18,532 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:18,532 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,533 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:18,533 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:18,538 - root - INFO - Clearing user context 2025-12-15 10:24:18,546 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 10:24:18,547 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:18,547 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 10:24:18,548 - root - INFO - Clearing user context 2025-12-15 10:24:18,548 - root - INFO - User context cleared before authentication 2025-12-15 10:24:18,548 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:18,550 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:18,551 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:18,551 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:18,551 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:18,556 - root - INFO - Clearing user context 2025-12-15 10:24:26,773 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:24:26,774 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:26,774 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:24:26,774 - root - INFO - Clearing user context 2025-12-15 10:24:26,775 - root - INFO - User context cleared before authentication 2025-12-15 10:24:26,776 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:26,778 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:26,778 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:26,778 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:26,779 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:26,781 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:26,782 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:26,782 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:26,784 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:26,785 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:26,785 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:26,793 - root - INFO - Clearing user context 2025-12-15 10:24:28,895 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:24:28,896 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:28,896 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:24:28,897 - root - INFO - Clearing user context 2025-12-15 10:24:28,897 - root - INFO - User context cleared before authentication 2025-12-15 10:24:28,897 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:28,899 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:28,899 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:28,900 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:28,900 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:28,902 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:28,902 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:28,903 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:28,904 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:28,904 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:28,905 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:28,909 - root - INFO - Clearing user context 2025-12-15 10:24:31,745 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:24:31,746 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:31,746 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:24:31,746 - root - INFO - Clearing user context 2025-12-15 10:24:31,746 - root - INFO - User context cleared before authentication 2025-12-15 10:24:31,747 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:31,748 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:31,748 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:31,748 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:31,748 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:31,750 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:31,751 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:31,751 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:31,752 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:31,752 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:31,753 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:31,835 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:24:31,841 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:24:31,911 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:24:31,916 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:24:31,918 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4af161ff-0375-4ec8-ae32-96a8d1fc1af9_testdoc1.doc 2025-12-15 10:24:31,920 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4af161ff-0375-4ec8-ae32-96a8d1fc1af9_testdoc1.doc: No module named 'docx2txt' 2025-12-15 10:24:31,920 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: No module named 'docx2txt' 2025-12-15 10:24:31,924 - root - INFO - Clearing user context 2025-12-15 10:24:34,243 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:24:34,244 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:24:34,244 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:24:34,244 - root - INFO - Clearing user context 2025-12-15 10:24:34,245 - root - INFO - User context cleared before authentication 2025-12-15 10:24:34,245 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:24:34,246 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:24:34,247 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:34,247 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:24:34,247 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:24:34,249 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:24:34,249 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:24:34,249 - root - INFO - Looking for user with username: admin 2025-12-15 10:24:34,251 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:24:34,251 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:24:34,251 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:24:34,254 - root - INFO - Clearing user context 2025-12-15 10:26:03,636 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:26:14,554 - root - INFO - Logging configured successfully 2025-12-15 10:26:14,697 - root - INFO - Logging configured successfully 2025-12-15 10:26:14,835 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:26:14,846 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:26:14,851 - root - INFO - Database tables created 2025-12-15 10:26:14,851 - root - INFO - Database initialized 2025-12-15 10:26:40,328 - root - INFO - Logging configured successfully 2025-12-15 10:26:40,468 - root - INFO - Logging configured successfully 2025-12-15 10:26:40,592 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:26:40,602 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:26:40,606 - root - INFO - Database tables created 2025-12-15 10:26:40,607 - root - INFO - Database initialized 2025-12-15 10:26:51,861 - root - INFO - Logging configured successfully 2025-12-15 10:26:52,000 - root - INFO - Logging configured successfully 2025-12-15 10:26:52,121 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:26:52,131 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:26:52,136 - root - INFO - Database tables created 2025-12-15 10:26:52,137 - root - INFO - Database initialized 2025-12-15 10:28:04,707 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:28:15,178 - root - INFO - Logging configured successfully 2025-12-15 10:28:15,354 - root - INFO - Logging configured successfully 2025-12-15 10:28:15,518 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:28:15,530 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:28:15,535 - root - INFO - Database tables created 2025-12-15 10:28:15,536 - root - INFO - Database initialized 2025-12-15 10:28:32,876 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:28:45,451 - root - INFO - Logging configured successfully 2025-12-15 10:28:45,600 - root - INFO - Logging configured successfully 2025-12-15 10:28:45,722 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:28:45,732 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:28:45,736 - root - INFO - Database tables created 2025-12-15 10:28:45,736 - root - INFO - Database initialized 2025-12-15 10:28:56,713 - root - INFO - Logging configured successfully 2025-12-15 10:28:56,880 - root - INFO - Logging configured successfully 2025-12-15 10:28:57,026 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:28:57,036 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:28:57,040 - root - INFO - Database tables created 2025-12-15 10:28:57,041 - root - INFO - Database initialized 2025-12-15 10:31:13,227 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:31:24,155 - root - INFO - Logging configured successfully 2025-12-15 10:31:24,296 - root - INFO - Logging configured successfully 2025-12-15 10:31:24,411 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:31:24,420 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:31:24,423 - root - INFO - Database tables created 2025-12-15 10:31:24,423 - root - INFO - Database initialized 2025-12-15 10:31:35,278 - root - INFO - Logging configured successfully 2025-12-15 10:31:35,423 - root - INFO - Logging configured successfully 2025-12-15 10:31:35,549 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:31:35,559 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:31:35,564 - root - INFO - Database tables created 2025-12-15 10:31:35,564 - root - INFO - Database initialized 2025-12-15 10:31:43,870 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:31:53,906 - root - INFO - Logging configured successfully 2025-12-15 10:31:54,051 - root - INFO - Logging configured successfully 2025-12-15 10:31:54,173 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:31:54,183 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:31:54,187 - root - INFO - Database tables created 2025-12-15 10:31:54,187 - root - INFO - Database initialized 2025-12-15 10:32:04,415 - root - INFO - Logging configured successfully 2025-12-15 10:32:04,553 - root - INFO - Logging configured successfully 2025-12-15 10:32:04,673 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:32:04,683 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:32:04,687 - root - INFO - Database tables created 2025-12-15 10:32:04,687 - root - INFO - Database initialized 2025-12-15 10:32:25,410 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:33:25,425 - root - INFO - Logging configured successfully 2025-12-15 10:33:25,579 - root - INFO - Logging configured successfully 2025-12-15 10:33:25,711 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:33:25,720 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:33:25,725 - root - INFO - Database tables created 2025-12-15 10:33:25,725 - root - INFO - Database initialized 2025-12-15 10:33:31,726 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:33:31,726 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:33:31,727 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:33:31,728 - root - INFO - Clearing user context 2025-12-15 10:33:31,728 - root - INFO - User context cleared before authentication 2025-12-15 10:33:31,729 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:33:31,794 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:33:31,795 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:31,796 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:33:31,797 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:33:31,801 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:33:31,802 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:33:31,803 - root - INFO - Looking for user with username: admin 2025-12-15 10:33:31,804 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:33:31,804 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:31,804 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:33:31,815 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4af161ff-0375-4ec8-ae32-96a8d1fc1af9_testdoc1.doc 2025-12-15 10:33:31,820 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:33:32,004 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:33:32,011 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:33:32,109 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:33:32,122 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:33:32,143 - th_agenter.services.document - INFO - Deleted document: 4af161ff-0375-4ec8-ae32-96a8d1fc1af9_testdoc1.doc (ID: 5) 2025-12-15 10:33:32,146 - root - INFO - Clearing user context 2025-12-15 10:33:32,162 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:33:32,163 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:33:32,164 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:33:32,164 - root - INFO - Clearing user context 2025-12-15 10:33:32,165 - root - INFO - User context cleared before authentication 2025-12-15 10:33:32,166 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:33:32,169 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:33:32,169 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:32,169 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:33:32,170 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:33:32,174 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:33:32,174 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:33:32,176 - root - INFO - Looking for user with username: admin 2025-12-15 10:33:32,177 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:33:32,179 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:32,179 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:33:32,195 - root - INFO - Clearing user context 2025-12-15 10:33:52,190 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:33:52,190 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:33:52,191 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:33:52,191 - root - INFO - Clearing user context 2025-12-15 10:33:52,191 - root - INFO - User context cleared before authentication 2025-12-15 10:33:52,191 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:33:52,193 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:33:52,194 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:52,195 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:33:52,195 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:33:52,198 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:33:52,199 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:33:52,199 - root - INFO - Looking for user with username: admin 2025-12-15 10:33:52,204 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:33:52,204 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:52,205 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:33:52,384 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:33:52,388 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f5f22616-05d8-4635-8923-548fd4329970_testdoc1.doc 2025-12-15 10:33:52,388 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f5f22616-05d8-4635-8923-548fd4329970_testdoc1.doc: local variable 'DOCX2TXT_AVAILABLE' referenced before assignment 2025-12-15 10:33:52,389 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: local variable 'DOCX2TXT_AVAILABLE' referenced before assignment 2025-12-15 10:33:52,392 - root - INFO - Clearing user context 2025-12-15 10:33:54,408 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:33:54,411 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:33:54,412 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:33:54,412 - root - INFO - Clearing user context 2025-12-15 10:33:54,413 - root - INFO - User context cleared before authentication 2025-12-15 10:33:54,414 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:33:54,415 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:33:54,415 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:54,418 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:33:54,419 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:33:54,423 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:33:54,425 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:33:54,426 - root - INFO - Looking for user with username: admin 2025-12-15 10:33:54,430 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:33:54,431 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:33:54,431 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:33:54,437 - root - INFO - Clearing user context 2025-12-15 10:34:48,522 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:34:59,086 - root - INFO - Logging configured successfully 2025-12-15 10:34:59,240 - root - INFO - Logging configured successfully 2025-12-15 10:34:59,363 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:34:59,373 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:34:59,378 - root - INFO - Database tables created 2025-12-15 10:34:59,378 - root - INFO - Database initialized 2025-12-15 10:35:09,324 - root - INFO - Logging configured successfully 2025-12-15 10:35:09,470 - root - INFO - Logging configured successfully 2025-12-15 10:35:09,596 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:35:09,605 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:35:09,610 - root - INFO - Database tables created 2025-12-15 10:35:09,610 - root - INFO - Database initialized 2025-12-15 10:35:30,634 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:35:39,696 - root - INFO - Logging configured successfully 2025-12-15 10:35:39,826 - root - INFO - Logging configured successfully 2025-12-15 10:35:39,928 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:35:39,937 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:35:39,941 - root - INFO - Database tables created 2025-12-15 10:35:39,941 - root - INFO - Database initialized 2025-12-15 10:35:49,925 - root - INFO - Logging configured successfully 2025-12-15 10:35:50,119 - root - INFO - Logging configured successfully 2025-12-15 10:35:50,280 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:35:50,293 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:35:50,298 - root - INFO - Database tables created 2025-12-15 10:35:50,298 - root - INFO - Database initialized 2025-12-15 10:36:00,551 - root - INFO - Logging configured successfully 2025-12-15 10:36:00,701 - root - INFO - Logging configured successfully 2025-12-15 10:36:00,828 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:36:00,837 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:36:00,843 - root - INFO - Database tables created 2025-12-15 10:36:00,843 - root - INFO - Database initialized 2025-12-15 10:36:11,478 - root - INFO - Logging configured successfully 2025-12-15 10:36:11,635 - root - INFO - Logging configured successfully 2025-12-15 10:36:11,772 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:36:11,782 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:36:11,787 - root - INFO - Database tables created 2025-12-15 10:36:11,788 - root - INFO - Database initialized 2025-12-15 10:37:57,024 - root - INFO - Logging configured successfully 2025-12-15 10:37:57,148 - root - INFO - Logging configured successfully 2025-12-15 10:37:57,257 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:37:57,265 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:37:57,269 - root - INFO - Database tables created 2025-12-15 10:37:57,269 - root - INFO - Database initialized 2025-12-15 10:38:12,037 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:38:12,038 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:38:12,039 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:38:12,039 - root - INFO - Clearing user context 2025-12-15 10:38:12,039 - root - INFO - User context cleared before authentication 2025-12-15 10:38:12,039 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:38:12,114 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:38:12,116 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:12,116 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:38:12,116 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:38:12,121 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:38:12,122 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:38:12,122 - root - INFO - Looking for user with username: admin 2025-12-15 10:38:12,123 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:38:12,124 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:12,124 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:38:12,130 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\f5f22616-05d8-4635-8923-548fd4329970_testdoc1.doc 2025-12-15 10:38:12,137 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:38:12,248 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:38:12,254 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:38:12,347 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:38:12,348 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:38:12,358 - th_agenter.services.document - INFO - Deleted document: f5f22616-05d8-4635-8923-548fd4329970_testdoc1.doc (ID: 5) 2025-12-15 10:38:12,377 - root - INFO - Clearing user context 2025-12-15 10:38:12,384 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:38:12,384 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:38:12,385 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:38:12,385 - root - INFO - Clearing user context 2025-12-15 10:38:12,385 - root - INFO - User context cleared before authentication 2025-12-15 10:38:12,385 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:38:12,387 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:38:12,387 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:12,387 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:38:12,387 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:38:12,389 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:38:12,389 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:38:12,389 - root - INFO - Looking for user with username: admin 2025-12-15 10:38:12,390 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:38:12,390 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:12,390 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:38:12,399 - root - INFO - Clearing user context 2025-12-15 10:38:17,677 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:38:17,677 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:38:17,677 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:38:17,677 - root - INFO - Clearing user context 2025-12-15 10:38:17,678 - root - INFO - User context cleared before authentication 2025-12-15 10:38:17,678 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:38:17,679 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:38:17,679 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:17,679 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:38:17,680 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:38:17,681 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:38:17,682 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:38:17,682 - root - INFO - Looking for user with username: admin 2025-12-15 10:38:17,690 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:38:17,691 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:17,692 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:38:17,857 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 5) 2025-12-15 10:38:17,859 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc 2025-12-15 10:38:17,860 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用替代方法加载: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc 2025-12-15 10:38:17,861 - th_agenter.services.document_processor - ERROR - 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc 2025-12-15 10:38:17,867 - th_agenter.services.document_processor - ERROR - 使用python-docx加载Word文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:38:17,868 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:38:17,869 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:38:17,877 - root - INFO - Clearing user context 2025-12-15 10:38:19,904 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:38:19,905 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:38:19,905 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:38:19,906 - root - INFO - Clearing user context 2025-12-15 10:38:19,907 - root - INFO - User context cleared before authentication 2025-12-15 10:38:19,908 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:38:19,909 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:38:19,910 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:19,917 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:38:19,932 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:38:19,943 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:38:19,948 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:38:19,949 - root - INFO - Looking for user with username: admin 2025-12-15 10:38:19,960 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:38:19,961 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:38:19,961 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:38:19,967 - root - INFO - Clearing user context 2025-12-15 10:39:10,027 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:39:10,029 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:39:10,030 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:39:10,030 - root - INFO - Clearing user context 2025-12-15 10:39:10,030 - root - INFO - User context cleared before authentication 2025-12-15 10:39:10,031 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:39:10,032 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:39:10,033 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:10,033 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:39:10,034 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:39:10,036 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:39:10,036 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:39:10,037 - root - INFO - Looking for user with username: admin 2025-12-15 10:39:10,038 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:39:10,039 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:10,039 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:39:10,042 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc 2025-12-15 10:39:10,120 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:39:10,128 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:39:10,140 - th_agenter.services.document - INFO - Deleted document: 4bff529c-a1ec-4e40-b296-83b973de4ddd_testdoc1.doc (ID: 5) 2025-12-15 10:39:10,142 - root - INFO - Clearing user context 2025-12-15 10:39:10,287 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:39:10,288 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:39:10,288 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:39:10,288 - root - INFO - Clearing user context 2025-12-15 10:39:10,289 - root - INFO - User context cleared before authentication 2025-12-15 10:39:10,289 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:39:10,293 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:39:10,293 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:10,294 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:39:10,295 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:39:10,299 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:39:10,299 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:39:10,300 - root - INFO - Looking for user with username: admin 2025-12-15 10:39:10,304 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:39:10,305 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:10,306 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:39:10,313 - root - INFO - Clearing user context 2025-12-15 10:39:13,362 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:39:13,362 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:39:13,363 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:39:13,363 - root - INFO - Clearing user context 2025-12-15 10:39:13,364 - root - INFO - User context cleared before authentication 2025-12-15 10:39:13,364 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:39:13,366 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:39:13,367 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:13,367 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:39:13,368 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:39:13,372 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:39:13,373 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:39:13,373 - root - INFO - Looking for user with username: admin 2025-12-15 10:39:13,376 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:39:13,377 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:13,378 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:39:13,399 - th_agenter.services.document - INFO - Uploaded document: testdoc2.docx to KB 7 (Doc ID: 5) 2025-12-15 10:39:13,403 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx 2025-12-15 10:39:13,405 - th_agenter.services.document_processor - ERROR - 使用python-docx加载Word文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx: Package not found at 'E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx' 2025-12-15 10:39:13,406 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx: Package not found at 'E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx' 2025-12-15 10:39:13,407 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 5: Package not found at 'E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx' 2025-12-15 10:39:13,412 - root - INFO - Clearing user context 2025-12-15 10:39:15,732 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:39:15,733 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:39:15,733 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:39:15,734 - root - INFO - Clearing user context 2025-12-15 10:39:15,734 - root - INFO - User context cleared before authentication 2025-12-15 10:39:15,735 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:39:15,736 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:39:15,737 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:15,737 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:39:15,737 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:39:15,748 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:39:15,749 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:39:15,749 - root - INFO - Looking for user with username: admin 2025-12-15 10:39:15,752 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:39:15,754 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:39:15,754 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:39:15,763 - root - INFO - Clearing user context 2025-12-15 10:40:02,547 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:40:02,551 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:40:02,551 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:40:02,552 - root - INFO - Clearing user context 2025-12-15 10:40:02,553 - root - INFO - User context cleared before authentication 2025-12-15 10:40:02,553 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:40:02,560 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:40:02,563 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:40:02,564 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:40:02,566 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:40:02,572 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:40:02,572 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:40:02,573 - root - INFO - Looking for user with username: admin 2025-12-15 10:40:02,576 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:40:02,578 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:40:02,578 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:40:02,603 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 6) 2025-12-15 10:40:02,609 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 6, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc 2025-12-15 10:40:02,611 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用替代方法加载: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc 2025-12-15 10:40:02,612 - th_agenter.services.document_processor - ERROR - 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc 2025-12-15 10:40:02,612 - th_agenter.services.document_processor - ERROR - 使用python-docx加载Word文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:40:02,613 - th_agenter.services.document_processor - ERROR - 加载文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:40:02,613 - th_agenter.services.document_processor - ERROR - 文档处理失败 ID: 6: 没有可用的.doc文档加载器,请安装docx2txt库或转换为.docx格式 2025-12-15 10:40:02,621 - root - INFO - Clearing user context 2025-12-15 10:40:04,941 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:40:04,943 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:40:04,943 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:40:04,944 - root - INFO - Clearing user context 2025-12-15 10:40:04,944 - root - INFO - User context cleared before authentication 2025-12-15 10:40:04,944 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:40:04,946 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:40:04,946 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:40:04,947 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:40:04,947 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:40:04,952 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:40:04,953 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:40:04,953 - root - INFO - Looking for user with username: admin 2025-12-15 10:40:04,956 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:40:04,957 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:40:04,957 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:40:04,968 - root - INFO - Clearing user context 2025-12-15 10:43:22,308 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:43:34,075 - root - INFO - Logging configured successfully 2025-12-15 10:43:34,207 - root - INFO - Logging configured successfully 2025-12-15 10:43:34,323 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:43:34,335 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:43:34,339 - root - INFO - Database tables created 2025-12-15 10:43:34,340 - root - INFO - Database initialized 2025-12-15 10:44:22,820 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:44:32,809 - root - INFO - Logging configured successfully 2025-12-15 10:44:32,934 - root - INFO - Logging configured successfully 2025-12-15 10:44:33,042 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:44:33,050 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:44:33,054 - root - INFO - Database tables created 2025-12-15 10:44:33,055 - root - INFO - Database initialized 2025-12-15 10:44:42,566 - root - INFO - Logging configured successfully 2025-12-15 10:44:42,709 - root - INFO - Logging configured successfully 2025-12-15 10:44:42,830 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:44:42,840 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:44:42,844 - root - INFO - Database tables created 2025-12-15 10:44:42,845 - root - INFO - Database initialized 2025-12-15 10:46:00,448 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:46:12,119 - root - INFO - Logging configured successfully 2025-12-15 10:46:12,238 - root - INFO - Logging configured successfully 2025-12-15 10:46:12,350 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:46:12,359 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:46:12,362 - root - INFO - Database tables created 2025-12-15 10:46:12,363 - root - INFO - Database initialized 2025-12-15 10:46:22,466 - root - INFO - Logging configured successfully 2025-12-15 10:46:22,597 - root - INFO - Logging configured successfully 2025-12-15 10:46:22,709 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:46:22,718 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:46:22,722 - root - INFO - Database tables created 2025-12-15 10:46:22,722 - root - INFO - Database initialized 2025-12-15 10:47:21,200 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 10:55:23,610 - root - INFO - Logging configured successfully 2025-12-15 10:55:23,744 - root - INFO - Logging configured successfully 2025-12-15 10:55:23,859 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:55:23,868 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:55:23,872 - root - INFO - Database tables created 2025-12-15 10:55:23,873 - root - INFO - Database initialized 2025-12-15 10:56:24,523 - root - INFO - Logging configured successfully 2025-12-15 10:56:24,660 - root - INFO - Logging configured successfully 2025-12-15 10:56:24,777 - root - INFO - Starting up TH-Agenter application... 2025-12-15 10:56:24,785 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 10:56:24,789 - root - INFO - Database tables created 2025-12-15 10:56:24,790 - root - INFO - Database initialized 2025-12-15 10:57:50,216 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:57:50,216 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:57:50,217 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:57:50,217 - root - INFO - Clearing user context 2025-12-15 10:57:50,217 - root - INFO - User context cleared before authentication 2025-12-15 10:57:50,217 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:57:50,245 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:57:50,245 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:57:50,245 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:57:50,245 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:57:50,250 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:57:50,250 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:57:50,250 - root - INFO - Looking for user with username: admin 2025-12-15 10:57:50,251 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:57:50,252 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:57:50,252 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:57:50,366 - th_agenter.services.document - INFO - Uploaded document: testdoc2.docx to KB 7 (Doc ID: 7) 2025-12-15 10:57:50,375 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 10:57:50,488 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 10:57:50,494 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 10:57:50,497 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 7, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx 2025-12-15 10:57:50,499 - th_agenter.services.document_processor - ERROR - 使用python-docx加载Word文档失败 E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx: Package not found at 'E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx' 2025-12-15 10:57:50,499 - th_agenter.services.document_processor - ERROR - 加载Word文档失败: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx, 错误: Package not found at 'E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx' 2025-12-15 10:57:50,500 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx, 页数: 1 2025-12-15 10:57:50,504 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-15 10:57:50,504 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 10:57:50,505 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 10:57:50,506 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx 2025-12-15 10:57:50,514 - root - INFO - Clearing user context 2025-12-15 10:57:52,532 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:57:52,532 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:57:52,533 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:57:52,533 - root - INFO - Clearing user context 2025-12-15 10:57:52,533 - root - INFO - User context cleared before authentication 2025-12-15 10:57:52,534 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:57:52,536 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:57:52,537 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:57:52,538 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:57:52,538 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:57:52,540 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:57:52,540 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:57:52,540 - root - INFO - Looking for user with username: admin 2025-12-15 10:57:52,542 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:57:52,542 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:57:52,542 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:57:52,552 - root - INFO - Clearing user context 2025-12-15 10:58:08,840 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 10:58:08,840 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:08,841 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 10:58:08,841 - root - INFO - Clearing user context 2025-12-15 10:58:08,841 - root - INFO - User context cleared before authentication 2025-12-15 10:58:08,841 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:08,842 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:08,842 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:08,842 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:08,842 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:08,844 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:08,844 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:08,844 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:08,845 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:08,845 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:08,846 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:08,850 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx 2025-12-15 10:58:08,930 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 10:58:08,931 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 10:58:08,937 - th_agenter.services.document - INFO - Deleted document: d40b4fd6-71b0-4930-baa7-f3dc06965f32_testdoc2.docx (ID: 5) 2025-12-15 10:58:08,938 - root - INFO - Clearing user context 2025-12-15 10:58:09,107 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:58:09,107 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:09,107 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:58:09,108 - root - INFO - Clearing user context 2025-12-15 10:58:09,108 - root - INFO - User context cleared before authentication 2025-12-15 10:58:09,108 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:09,110 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:09,110 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:09,110 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:09,110 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:09,111 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:09,112 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:09,112 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:09,113 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:09,113 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:09,113 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:09,117 - root - INFO - Clearing user context 2025-12-15 10:58:10,834 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/6 2025-12-15 10:58:10,835 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/6 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:10,835 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/6 2025-12-15 10:58:10,836 - root - INFO - Clearing user context 2025-12-15 10:58:10,836 - root - INFO - User context cleared before authentication 2025-12-15 10:58:10,837 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:10,838 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:10,839 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:10,839 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:10,839 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:10,840 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:10,841 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:10,841 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:10,842 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:10,842 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:10,843 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:10,844 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc 2025-12-15 10:58:10,908 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=6 2025-12-15 10:58:10,909 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=6 2025-12-15 10:58:10,921 - th_agenter.services.document - INFO - Deleted document: 0619733e-2f0f-40b2-b8cd-6e681836463a_testdoc1.doc (ID: 6) 2025-12-15 10:58:10,923 - root - INFO - Clearing user context 2025-12-15 10:58:11,242 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:58:11,242 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:11,242 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:58:11,243 - root - INFO - Clearing user context 2025-12-15 10:58:11,243 - root - INFO - User context cleared before authentication 2025-12-15 10:58:11,243 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:11,244 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:11,245 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:11,245 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:11,245 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:11,247 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:11,247 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:11,247 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:11,249 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:11,249 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:11,249 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:11,252 - root - INFO - Clearing user context 2025-12-15 10:58:12,848 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/7 2025-12-15 10:58:12,849 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/7 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:12,849 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/7 2025-12-15 10:58:12,849 - root - INFO - Clearing user context 2025-12-15 10:58:12,850 - root - INFO - User context cleared before authentication 2025-12-15 10:58:12,850 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:12,851 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:12,851 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:12,852 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:12,852 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:12,854 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:12,854 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:12,855 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:12,856 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:12,857 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:12,857 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:12,860 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx 2025-12-15 10:58:12,924 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=7 2025-12-15 10:58:12,924 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=7 2025-12-15 10:58:12,934 - th_agenter.services.document - INFO - Deleted document: 71453a96-1405-4c19-9695-57b5c6e3481e_testdoc2.docx (ID: 7) 2025-12-15 10:58:12,936 - root - INFO - Clearing user context 2025-12-15 10:58:13,258 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:58:13,258 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:13,258 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:58:13,259 - root - INFO - Clearing user context 2025-12-15 10:58:13,259 - root - INFO - User context cleared before authentication 2025-12-15 10:58:13,259 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:13,260 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:13,260 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:13,261 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:13,261 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:13,262 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:13,262 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:13,263 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:13,264 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:13,264 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:13,265 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:13,267 - root - INFO - Clearing user context 2025-12-15 10:58:17,305 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 10:58:17,305 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:17,306 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:58:17,306 - root - INFO - Clearing user context 2025-12-15 10:58:17,306 - root - INFO - User context cleared before authentication 2025-12-15 10:58:17,307 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:17,307 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:17,308 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:17,308 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:17,308 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:17,310 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:17,311 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:17,311 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:17,312 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:17,312 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:17,312 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:17,323 - th_agenter.services.document - INFO - Uploaded document: testdoc.doc to KB 7 (Doc ID: 5) 2025-12-15 10:58:17,326 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 5, 路径: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc 2025-12-15 10:58:17,326 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc 2025-12-15 10:58:17,327 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc 2025-12-15 10:58:17,327 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-15 10:58:17,329 - th_agenter.services.document_processor - INFO - 成功加载文档: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc, 页数: 1 2025-12-15 10:58:17,330 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (D:\Users\jiang\anaconda3\envs\langchain\lib\site-packages\langchain\chat_models\__init__.py) 2025-12-15 10:58:17,330 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 10:58:17,331 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 10:58:17,331 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc 2025-12-15 10:58:17,334 - root - INFO - Clearing user context 2025-12-15 10:58:19,672 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 10:58:19,672 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 10:58:19,672 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 10:58:19,672 - root - INFO - Clearing user context 2025-12-15 10:58:19,673 - root - INFO - User context cleared before authentication 2025-12-15 10:58:19,673 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 10:58:19,674 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 10:58:19,674 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:19,674 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 10:58:19,675 - root - INFO - Verified current user ID in context: 2 2025-12-15 10:58:19,676 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 10:58:19,677 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 10:58:19,677 - root - INFO - Looking for user with username: admin 2025-12-15 10:58:19,678 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 10:58:19,678 - root - INFO - Verification - ContextVar user: admin 2025-12-15 10:58:19,678 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 10:58:19,681 - root - INFO - Clearing user context 2025-12-15 10:59:52,426 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 11:00:02,609 - root - INFO - Logging configured successfully 2025-12-15 11:00:02,757 - root - INFO - Logging configured successfully 2025-12-15 11:00:02,888 - root - INFO - Starting up TH-Agenter application... 2025-12-15 11:00:02,898 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 11:00:02,905 - root - INFO - Database tables created 2025-12-15 11:00:02,905 - root - INFO - Database initialized 2025-12-15 11:00:04,108 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 11:00:14,479 - root - INFO - Logging configured successfully 2025-12-15 11:00:14,621 - root - INFO - Logging configured successfully 2025-12-15 11:00:14,739 - root - INFO - Starting up TH-Agenter application... 2025-12-15 11:00:14,749 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 11:00:14,753 - root - INFO - Database tables created 2025-12-15 11:00:14,753 - root - INFO - Database initialized 2025-12-15 11:19:22,575 - root - INFO - Logging configured successfully 2025-12-15 11:19:22,680 - root - INFO - Logging configured successfully 2025-12-15 11:19:22,762 - root - INFO - Starting up TH-Agenter application... 2025-12-15 11:19:22,769 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 11:19:22,771 - root - INFO - Database tables created 2025-12-15 11:19:22,771 - root - INFO - Database initialized 2025-12-15 11:31:28,945 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 11:31:28,945 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:31:28,945 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 11:31:28,946 - root - INFO - Clearing user context 2025-12-15 11:31:28,946 - root - INFO - User context cleared before authentication 2025-12-15 11:31:28,946 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:31:28,963 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:31:28,963 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:28,963 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:31:28,963 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:31:28,965 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:31:28,965 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:31:28,966 - root - INFO - Looking for user with username: admin 2025-12-15 11:31:28,966 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:31:28,966 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:28,966 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:31:29,009 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 6) 2025-12-15 11:31:29,025 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 11:31:29,068 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 11:31:29,069 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 11:31:29,070 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 6, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc 2025-12-15 11:31:29,071 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc 2025-12-15 11:31:29,071 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc 2025-12-15 11:31:29,071 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-15 11:31:29,072 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc, 页数: 1 2025-12-15 11:31:29,072 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-15 11:31:29,072 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 11:31:29,073 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 11:31:29,073 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc 2025-12-15 11:31:29,075 - root - INFO - Clearing user context 2025-12-15 11:31:31,134 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 11:31:31,134 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:31:31,134 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 11:31:31,135 - root - INFO - Clearing user context 2025-12-15 11:31:31,135 - root - INFO - User context cleared before authentication 2025-12-15 11:31:31,135 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:31:31,135 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:31:31,135 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:31,136 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:31:31,136 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:31:31,137 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:31:31,137 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:31:31,137 - root - INFO - Looking for user with username: admin 2025-12-15 11:31:31,137 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:31:31,137 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:31,137 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:31:31,143 - root - INFO - Clearing user context 2025-12-15 11:31:51,406 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-15 11:31:51,406 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:31:51,407 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-15 11:31:51,407 - root - INFO - Clearing user context 2025-12-15 11:31:51,407 - root - INFO - User context cleared before authentication 2025-12-15 11:31:51,407 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:31:51,410 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:31:51,410 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:51,410 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:31:51,410 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:31:51,411 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:31:51,411 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:31:51,411 - root - INFO - Looking for user with username: admin 2025-12-15 11:31:51,412 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:31:51,412 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:31:51,412 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:31:51,823 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 11:31:51,906 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 0 个相关文档 2025-12-15 11:31:51,907 - root - INFO - Clearing user context 2025-12-15 11:44:19,812 - root - INFO - Shutting down TH-Agenter application... 2025-12-15 11:44:45,742 - root - INFO - Logging configured successfully 2025-12-15 11:44:45,829 - root - INFO - Logging configured successfully 2025-12-15 11:44:45,909 - root - INFO - Starting up TH-Agenter application... 2025-12-15 11:44:45,915 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-15 11:44:45,917 - root - INFO - Database tables created 2025-12-15 11:44:45,917 - root - INFO - Database initialized 2025-12-15 11:45:01,646 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 11:45:01,647 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:45:01,647 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 11:45:01,647 - root - INFO - Clearing user context 2025-12-15 11:45:01,648 - root - INFO - User context cleared before authentication 2025-12-15 11:45:01,648 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:45:01,693 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:45:01,693 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:45:01,693 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:45:01,693 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:45:01,695 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:45:01,695 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:45:01,695 - root - INFO - Looking for user with username: admin 2025-12-15 11:45:01,695 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:45:01,696 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:45:01,696 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:45:01,699 - root - INFO - Clearing user context 2025-12-15 11:45:01,709 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 11:45:01,709 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:45:01,709 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 11:45:01,709 - root - INFO - Clearing user context 2025-12-15 11:45:01,709 - root - INFO - User context cleared before authentication 2025-12-15 11:45:01,709 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:45:01,710 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:45:01,710 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:45:01,710 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:45:01,710 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:45:01,711 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:45:01,711 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:45:01,711 - root - INFO - Looking for user with username: admin 2025-12-15 11:45:01,712 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:45:01,712 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:45:01,712 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:45:01,714 - root - INFO - Clearing user context 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:46:29,311 - root - INFO - Clearing user context 2025-12-15 11:46:29,311 - root - INFO - User context cleared before authentication 2025-12-15 11:46:29,311 - root - INFO - Authorization header received: None 2025-12-15 11:46:29,311 - root - INFO - Authorization header is missing 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:29,311 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:46:29,312 - root - INFO - Clearing user context 2025-12-15 11:46:29,312 - root - INFO - User context cleared before authentication 2025-12-15 11:46:29,312 - root - INFO - Authorization header received: None 2025-12-15 11:46:29,312 - root - INFO - Authorization header is missing 2025-12-15 11:46:29,316 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:46:29,316 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:29,316 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:46:29,316 - root - INFO - Clearing user context 2025-12-15 11:46:29,316 - root - INFO - User context cleared before authentication 2025-12-15 11:46:29,317 - root - INFO - Authorization header received: None 2025-12-15 11:46:29,317 - root - INFO - Authorization header is missing 2025-12-15 11:46:29,317 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:46:29,317 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:29,317 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:46:29,318 - root - INFO - Clearing user context 2025-12-15 11:46:29,318 - root - INFO - User context cleared before authentication 2025-12-15 11:46:29,318 - root - INFO - Authorization header received: None 2025-12-15 11:46:29,318 - root - INFO - Authorization header is missing 2025-12-15 11:46:29,321 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:46:29,321 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:29,321 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:46:29,321 - root - INFO - Clearing user context 2025-12-15 11:46:29,321 - root - INFO - User context cleared before authentication 2025-12-15 11:46:29,321 - root - INFO - Authorization header received: None 2025-12-15 11:46:29,321 - root - INFO - Authorization header is missing 2025-12-15 11:46:53,885 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 11:46:53,885 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:53,885 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 11:46:53,886 - root - INFO - Clearing user context 2025-12-15 11:46:53,886 - root - INFO - User context cleared before authentication 2025-12-15 11:46:53,886 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:53,889 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:53,889 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:53,890 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:53,890 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:53,892 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:53,893 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:53,893 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:53,898 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:53,898 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:53,898 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:53,899 - root - INFO - Clearing user context 2025-12-15 11:46:53,909 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 11:46:53,909 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:53,909 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 11:46:53,909 - root - INFO - Clearing user context 2025-12-15 11:46:53,909 - root - INFO - User context cleared before authentication 2025-12-15 11:46:53,909 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:53,910 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:53,910 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:53,910 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:53,910 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:53,911 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:53,911 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:53,911 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:53,911 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:53,911 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:53,911 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:53,912 - root - INFO - Clearing user context 2025-12-15 11:46:55,468 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 11:46:55,468 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:55,468 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 11:46:55,468 - root - INFO - Clearing user context 2025-12-15 11:46:55,468 - root - INFO - User context cleared before authentication 2025-12-15 11:46:55,468 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:55,469 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:55,469 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:55,469 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:55,469 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:55,469 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:55,470 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:55,470 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:55,470 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:55,470 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:55,470 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:55,471 - root - INFO - Clearing user context 2025-12-15 11:46:55,495 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 11:46:55,495 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:55,496 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 11:46:55,496 - root - INFO - Clearing user context 2025-12-15 11:46:55,496 - root - INFO - User context cleared before authentication 2025-12-15 11:46:55,496 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:55,496 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:55,496 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:55,496 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:55,496 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:55,497 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:55,497 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:55,497 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:55,498 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:55,498 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:55,498 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:55,499 - root - INFO - Clearing user context 2025-12-15 11:46:56,195 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:46:56,195 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:56,196 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:46:56,196 - root - INFO - Clearing user context 2025-12-15 11:46:56,196 - root - INFO - User context cleared before authentication 2025-12-15 11:46:56,196 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:56,196 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:56,196 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:56,196 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:56,197 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:56,197 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:56,198 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:56,198 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:56,198 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:56,198 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:56,198 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:56,208 - root - INFO - Clearing user context 2025-12-15 11:46:56,208 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:46:56,208 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:56,209 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:46:56,209 - root - INFO - Clearing user context 2025-12-15 11:46:56,209 - root - INFO - User context cleared before authentication 2025-12-15 11:46:56,209 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:56,210 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:56,210 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:56,210 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:56,210 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:56,213 - root - INFO - Clearing user context 2025-12-15 11:46:56,241 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 11:46:56,241 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:56,241 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 11:46:56,241 - root - INFO - Clearing user context 2025-12-15 11:46:56,241 - root - INFO - User context cleared before authentication 2025-12-15 11:46:56,241 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:56,242 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:56,242 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:56,242 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:56,242 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:56,244 - root - INFO - Clearing user context 2025-12-15 11:46:59,206 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 11:46:59,207 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:59,207 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 11:46:59,207 - root - INFO - Clearing user context 2025-12-15 11:46:59,208 - root - INFO - User context cleared before authentication 2025-12-15 11:46:59,208 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:59,211 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:59,211 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:59,211 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:59,211 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:59,211 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:59,212 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:59,212 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:59,212 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:59,212 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:59,212 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:59,213 - root - INFO - Clearing user context 2025-12-15 11:46:59,224 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 11:46:59,224 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:46:59,224 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 11:46:59,224 - root - INFO - Clearing user context 2025-12-15 11:46:59,224 - root - INFO - User context cleared before authentication 2025-12-15 11:46:59,224 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4MTA1OX0.HM7awqA8v5hga11zQfZ2tH_wzY3nQb6tCf3JlPqTu_k 2025-12-15 11:46:59,224 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:46:59,224 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:59,225 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:46:59,225 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:46:59,225 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:46:59,225 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765781059} 2025-12-15 11:46:59,225 - root - INFO - Looking for user with username: admin 2025-12-15 11:46:59,226 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:46:59,226 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:46:59,226 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:46:59,227 - root - INFO - Clearing user context 2025-12-15 11:47:01,252 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-15 11:47:01,253 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,253 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-15 11:47:01,253 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-15 11:47:01,449 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 11:47:01,449 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,450 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 11:47:01,450 - root - INFO - Clearing user context 2025-12-15 11:47:01,450 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,450 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,450 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,450 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,451 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,451 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,451 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:47:01,451 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 11:47:01,451 - root - INFO - Looking for user with username: admin 2025-12-15 11:47:01,452 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:47:01,452 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,452 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:47:01,453 - root - INFO - Clearing user context 2025-12-15 11:47:01,457 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 11:47:01,457 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,457 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 11:47:01,457 - root - INFO - Clearing user context 2025-12-15 11:47:01,457 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,457 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,458 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,458 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,458 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,458 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,459 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:47:01,459 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 11:47:01,459 - root - INFO - Looking for user with username: admin 2025-12-15 11:47:01,459 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:47:01,459 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,459 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:47:01,460 - root - INFO - Clearing user context 2025-12-15 11:47:01,837 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:47:01,837 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,838 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:47:01,838 - root - INFO - Clearing user context 2025-12-15 11:47:01,838 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,839 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,841 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,842 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,842 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,842 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,844 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:47:01,844 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,844 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:47:01,845 - root - INFO - Clearing user context 2025-12-15 11:47:01,845 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,845 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,848 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,848 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,849 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,849 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,851 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:47:01,852 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 11:47:01,857 - root - INFO - Looking for user with username: admin 2025-12-15 11:47:01,860 - root - INFO - Clearing user context 2025-12-15 11:47:01,861 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:47:01,863 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,864 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:47:01,886 - root - INFO - Clearing user context 2025-12-15 11:47:01,887 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:47:01,887 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,887 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:47:01,887 - root - INFO - Clearing user context 2025-12-15 11:47:01,887 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,887 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,889 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,889 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,889 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,889 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,890 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 11:47:01,890 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,890 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 11:47:01,890 - root - INFO - Clearing user context 2025-12-15 11:47:01,890 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,890 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,891 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,891 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,891 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,892 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,895 - root - INFO - Clearing user context 2025-12-15 11:47:01,895 - root - INFO - Clearing user context 2025-12-15 11:47:01,896 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:47:01,896 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,897 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:47:01,897 - root - INFO - Clearing user context 2025-12-15 11:47:01,897 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,897 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,898 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,898 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,898 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,898 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,899 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:47:01,899 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 11:47:01,899 - root - INFO - Looking for user with username: admin 2025-12-15 11:47:01,900 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:47:01,900 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,900 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:47:01,900 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 11:47:01,900 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:01,900 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 11:47:01,900 - root - INFO - Clearing user context 2025-12-15 11:47:01,901 - root - INFO - User context cleared before authentication 2025-12-15 11:47:01,901 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:01,901 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:01,901 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:01,901 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:01,902 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:01,909 - root - INFO - Clearing user context 2025-12-15 11:47:01,910 - root - INFO - Clearing user context 2025-12-15 11:47:02,245 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 11:47:02,246 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:02,246 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 11:47:02,246 - root - INFO - Clearing user context 2025-12-15 11:47:02,246 - root - INFO - User context cleared before authentication 2025-12-15 11:47:02,246 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:02,247 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:02,247 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:02,247 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:02,247 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:02,248 - root - INFO - Clearing user context 2025-12-15 11:47:02,574 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 11:47:02,574 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:02,575 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 11:47:02,575 - root - INFO - Clearing user context 2025-12-15 11:47:02,575 - root - INFO - User context cleared before authentication 2025-12-15 11:47:02,576 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:02,578 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:02,579 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:02,579 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:02,579 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:02,580 - root - INFO - Clearing user context 2025-12-15 11:47:04,441 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 11:47:04,441 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 11:47:04,442 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 11:47:04,442 - root - INFO - Clearing user context 2025-12-15 11:47:04,442 - root - INFO - User context cleared before authentication 2025-12-15 11:47:04,442 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 11:47:04,444 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 11:47:04,444 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:04,444 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 11:47:04,444 - root - INFO - Verified current user ID in context: 2 2025-12-15 11:47:04,445 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 11:47:04,445 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 11:47:04,445 - root - INFO - Looking for user with username: admin 2025-12-15 11:47:04,446 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 11:47:04,446 - root - INFO - Verification - ContextVar user: admin 2025-12-15 11:47:04,446 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 11:47:04,452 - root - INFO - Clearing user context 2025-12-15 12:58:50,246 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 12:58:50,246 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:58:50,246 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 12:58:50,246 - root - INFO - Clearing user context 2025-12-15 12:58:50,246 - root - INFO - User context cleared before authentication 2025-12-15 12:58:50,246 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:58:50,247 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:58:50,247 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:50,247 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:58:50,247 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:58:50,248 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:58:50,249 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:58:50,249 - root - INFO - Looking for user with username: admin 2025-12-15 12:58:50,249 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:58:50,249 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:50,250 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:58:50,253 - root - INFO - Clearing user context 2025-12-15 12:58:55,811 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 12:58:55,811 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:58:55,812 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 12:58:55,812 - root - INFO - Clearing user context 2025-12-15 12:58:55,812 - root - INFO - User context cleared before authentication 2025-12-15 12:58:55,813 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:58:55,815 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:58:55,815 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:55,816 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:58:55,816 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:58:55,817 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:58:55,817 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:58:55,817 - root - INFO - Looking for user with username: admin 2025-12-15 12:58:55,818 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:58:55,818 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:55,818 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:58:55,838 - th_agenter.services.document - INFO - Uploaded document: testdoc2.docx to KB 7 (Doc ID: 7) 2025-12-15 12:58:55,842 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-15 12:58:55,945 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-15 12:58:55,947 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-15 12:58:55,948 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 7, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx 2025-12-15 12:58:55,948 - th_agenter.services.document_processor - ERROR - 使用python-docx加载Word文档失败 /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx: Package not found at '/home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx' 2025-12-15 12:58:55,948 - th_agenter.services.document_processor - ERROR - 加载Word文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx, 错误: Package not found at '/home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx' 2025-12-15 12:58:55,949 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx, 页数: 1 2025-12-15 12:58:55,949 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-15 12:58:55,949 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 12:58:55,950 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 12:58:55,950 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx 2025-12-15 12:58:55,951 - root - INFO - Clearing user context 2025-12-15 12:58:58,301 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 12:58:58,301 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:58:58,302 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 12:58:58,302 - root - INFO - Clearing user context 2025-12-15 12:58:58,302 - root - INFO - User context cleared before authentication 2025-12-15 12:58:58,302 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:58:58,305 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:58:58,305 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:58,305 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:58:58,306 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:58:58,306 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:58:58,306 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:58:58,306 - root - INFO - Looking for user with username: admin 2025-12-15 12:58:58,307 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:58:58,307 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:58:58,307 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:58:58,308 - root - INFO - Clearing user context 2025-12-15 12:59:40,917 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-15 12:59:40,917 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:40,918 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-15 12:59:40,918 - root - INFO - Clearing user context 2025-12-15 12:59:40,918 - root - INFO - User context cleared before authentication 2025-12-15 12:59:40,919 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:40,921 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:40,922 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:40,922 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:40,923 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:40,925 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:59:40,926 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:59:40,926 - root - INFO - Looking for user with username: admin 2025-12-15 12:59:40,928 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:59:40,928 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:40,929 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:59:40,931 - root - INFO - Clearing user context 2025-12-15 12:59:41,088 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-15 12:59:41,089 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:41,089 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-15 12:59:41,090 - root - INFO - Clearing user context 2025-12-15 12:59:41,090 - root - INFO - User context cleared before authentication 2025-12-15 12:59:41,090 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:41,093 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:41,093 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,094 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:41,094 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:41,097 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:59:41,097 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:59:41,098 - root - INFO - Looking for user with username: admin 2025-12-15 12:59:41,100 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:59:41,100 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,101 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:59:41,105 - root - INFO - Clearing user context 2025-12-15 12:59:41,237 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-15 12:59:41,237 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:41,238 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-15 12:59:41,238 - root - INFO - Clearing user context 2025-12-15 12:59:41,238 - root - INFO - User context cleared before authentication 2025-12-15 12:59:41,238 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:41,239 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:41,239 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,239 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:41,239 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:41,240 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-15 12:59:41,240 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:41,240 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-15 12:59:41,240 - root - INFO - Clearing user context 2025-12-15 12:59:41,240 - root - INFO - User context cleared before authentication 2025-12-15 12:59:41,240 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:41,241 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:41,241 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,241 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:41,241 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:41,242 - root - INFO - Clearing user context 2025-12-15 12:59:41,242 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:59:41,243 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:59:41,243 - root - INFO - Looking for user with username: admin 2025-12-15 12:59:41,243 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:59:41,243 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,243 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:59:41,248 - root - INFO - Clearing user context 2025-12-15 12:59:41,249 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-15 12:59:41,249 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:41,249 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-15 12:59:41,249 - root - INFO - Clearing user context 2025-12-15 12:59:41,249 - root - INFO - User context cleared before authentication 2025-12-15 12:59:41,249 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:41,250 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:41,250 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:41,250 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:41,250 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:41,251 - root - INFO - Clearing user context 2025-12-15 12:59:44,727 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 12:59:44,727 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 12:59:44,728 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 12:59:44,728 - root - INFO - Clearing user context 2025-12-15 12:59:44,728 - root - INFO - User context cleared before authentication 2025-12-15 12:59:44,729 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 12:59:44,731 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 12:59:44,731 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:44,732 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 12:59:44,732 - root - INFO - Verified current user ID in context: 2 2025-12-15 12:59:44,732 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 12:59:44,732 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 12:59:44,732 - root - INFO - Looking for user with username: admin 2025-12-15 12:59:44,733 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 12:59:44,733 - root - INFO - Verification - ContextVar user: admin 2025-12-15 12:59:44,733 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 12:59:44,734 - root - INFO - Clearing user context 2025-12-15 13:00:02,540 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 13:00:02,541 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:02,541 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:02,541 - root - INFO - Clearing user context 2025-12-15 13:00:02,542 - root - INFO - User context cleared before authentication 2025-12-15 13:00:02,542 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:02,545 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:02,545 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:02,545 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:02,545 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:02,670 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:02,671 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:02,671 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:02,674 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:02,674 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:02,674 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:02,705 - th_agenter.services.document - INFO - Uploaded document: 发明专利申请说明书CN202411808464.5.pdf to KB 7 (Doc ID: 8) 2025-12-15 13:00:02,710 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 8, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 13:00:02,746 - th_agenter.services.document_processor - WARNING - PDF文档没有提取到文本内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf,可能是扫描版PDF需要OCR支持 2025-12-15 13:00:02,746 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf, 页数: 1 2025-12-15 13:00:02,746 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-15 13:00:02,747 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 13:00:02,747 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 13:00:02,747 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 13:00:02,749 - root - INFO - Clearing user context 2025-12-15 13:00:04,773 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:04,774 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:04,774 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:04,774 - root - INFO - Clearing user context 2025-12-15 13:00:04,775 - root - INFO - User context cleared before authentication 2025-12-15 13:00:04,775 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:04,778 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:04,778 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:04,778 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:04,778 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:04,779 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:04,779 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:04,779 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:04,780 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:04,780 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:04,780 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:04,781 - root - INFO - Clearing user context 2025-12-15 13:00:33,036 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 13:00:33,036 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:33,037 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:33,037 - root - INFO - Clearing user context 2025-12-15 13:00:33,038 - root - INFO - User context cleared before authentication 2025-12-15 13:00:33,038 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:33,041 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:33,041 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:33,042 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:33,042 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:33,046 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:33,047 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:33,047 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:33,050 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:33,050 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:33,050 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:33,078 - th_agenter.services.document - INFO - Uploaded document: testpdf.pdf to KB 7 (Doc ID: 9) 2025-12-15 13:00:33,083 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 9, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/9976cdff-e6b7-45af-aa89-3caf46ed273b_testpdf.pdf 2025-12-15 13:00:33,258 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/9976cdff-e6b7-45af-aa89-3caf46ed273b_testpdf.pdf, 页数: 2 2025-12-15 13:00:33,258 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-15 13:00:33,258 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 13:00:33,258 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 4 个文档块 2025-12-15 13:00:33,613 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 13:00:33,776 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 13:00:33,956 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 13:00:34,129 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-15 13:00:34,294 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-15 13:00:34,317 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 9, 'status': 'success', 'chunks_count': 4, 'message': '文档处理完成'} 2025-12-15 13:00:34,512 - th_agenter.services.document - INFO - Processed document: 9976cdff-e6b7-45af-aa89-3caf46ed273b_testpdf.pdf (ID: 9) 2025-12-15 13:00:34,515 - root - INFO - Clearing user context 2025-12-15 13:00:36,528 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:36,528 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:36,529 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:36,529 - root - INFO - Clearing user context 2025-12-15 13:00:36,529 - root - INFO - User context cleared before authentication 2025-12-15 13:00:36,530 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:36,533 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:36,533 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:36,533 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:36,534 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:36,537 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:36,537 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:36,538 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:36,540 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:36,541 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:36,541 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:36,549 - root - INFO - Clearing user context 2025-12-15 13:00:48,515 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/5 2025-12-15 13:00:48,515 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/5 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:48,515 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/5 2025-12-15 13:00:48,515 - root - INFO - Clearing user context 2025-12-15 13:00:48,515 - root - INFO - User context cleared before authentication 2025-12-15 13:00:48,515 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:48,516 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:48,516 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:48,516 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:48,516 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:48,517 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:48,517 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:48,517 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:48,518 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:48,518 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:48,518 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:48,521 - th_agenter.services.document - INFO - Deleted file: E:\Work\HXF_AI\HXF\backend\data\uploads\kb_7\e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc 2025-12-15 13:00:48,569 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=5 2025-12-15 13:00:48,569 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=5 2025-12-15 13:00:48,586 - th_agenter.services.document - INFO - Deleted document: e65dcd42-da1d-4762-a58f-3654c909ade2_testdoc.doc (ID: 5) 2025-12-15 13:00:48,587 - root - INFO - Clearing user context 2025-12-15 13:00:48,770 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:48,770 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:48,771 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:48,771 - root - INFO - Clearing user context 2025-12-15 13:00:48,771 - root - INFO - User context cleared before authentication 2025-12-15 13:00:48,771 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:48,774 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:48,775 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:48,775 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:48,775 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:48,778 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:48,778 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:48,779 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:48,781 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:48,781 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:48,782 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:48,784 - root - INFO - Clearing user context 2025-12-15 13:00:50,403 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/6 2025-12-15 13:00:50,403 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/6 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:50,403 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/6 2025-12-15 13:00:50,404 - root - INFO - Clearing user context 2025-12-15 13:00:50,404 - root - INFO - User context cleared before authentication 2025-12-15 13:00:50,404 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:50,407 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:50,407 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:50,407 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:50,408 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:50,410 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:50,411 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:50,411 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:50,413 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:50,414 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:50,414 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:50,418 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc 2025-12-15 13:00:50,484 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=6 2025-12-15 13:00:50,484 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=6 2025-12-15 13:00:50,498 - th_agenter.services.document - INFO - Deleted document: 245b9c36-26c4-4cb9-9d1d-7f29b6e40b94_testdoc1.doc (ID: 6) 2025-12-15 13:00:50,498 - root - INFO - Clearing user context 2025-12-15 13:00:50,839 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:50,840 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:50,840 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:50,840 - root - INFO - Clearing user context 2025-12-15 13:00:50,840 - root - INFO - User context cleared before authentication 2025-12-15 13:00:50,841 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:50,843 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:50,844 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:50,844 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:50,844 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:50,847 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:50,847 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:50,848 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:50,850 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:50,850 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:50,850 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:50,857 - root - INFO - Clearing user context 2025-12-15 13:00:52,536 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/7 2025-12-15 13:00:52,536 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/7 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:52,536 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/7 2025-12-15 13:00:52,536 - root - INFO - Clearing user context 2025-12-15 13:00:52,536 - root - INFO - User context cleared before authentication 2025-12-15 13:00:52,537 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:52,537 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:52,537 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:52,538 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:52,538 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:52,538 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:52,538 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:52,538 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:52,539 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:52,539 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:52,539 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:52,540 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx 2025-12-15 13:00:52,578 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=7 2025-12-15 13:00:52,578 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=7 2025-12-15 13:00:52,593 - th_agenter.services.document - INFO - Deleted document: 90536805-dbc8-4d37-80f7-7c0bffad3138_testdoc2.docx (ID: 7) 2025-12-15 13:00:52,593 - root - INFO - Clearing user context 2025-12-15 13:00:52,936 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:52,937 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:52,937 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:52,937 - root - INFO - Clearing user context 2025-12-15 13:00:52,937 - root - INFO - User context cleared before authentication 2025-12-15 13:00:52,937 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:52,937 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:52,938 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:52,938 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:52,938 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:52,938 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:52,938 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:52,938 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:52,939 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:52,939 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:52,939 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:52,940 - root - INFO - Clearing user context 2025-12-15 13:00:55,332 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/8 2025-12-15 13:00:55,333 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/8 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:55,333 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/8 2025-12-15 13:00:55,333 - root - INFO - Clearing user context 2025-12-15 13:00:55,334 - root - INFO - User context cleared before authentication 2025-12-15 13:00:55,334 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:55,336 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:55,337 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:55,337 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:55,337 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:55,337 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:55,338 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:55,338 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:55,338 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:55,338 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:55,338 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:55,339 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf 2025-12-15 13:00:55,378 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=8 2025-12-15 13:00:55,379 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=8 2025-12-15 13:00:55,395 - th_agenter.services.document - INFO - Deleted document: b5d6c8fa-5342-4d81-8c9a-61724c252fa0_发明专利申请说明书CN202411808464.5.pdf (ID: 8) 2025-12-15 13:00:55,395 - root - INFO - Clearing user context 2025-12-15 13:00:55,728 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:00:55,728 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:00:55,728 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:00:55,728 - root - INFO - Clearing user context 2025-12-15 13:00:55,728 - root - INFO - User context cleared before authentication 2025-12-15 13:00:55,728 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:00:55,729 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:00:55,729 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:55,729 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:00:55,729 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:00:55,729 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:00:55,730 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:00:55,730 - root - INFO - Looking for user with username: admin 2025-12-15 13:00:55,730 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:00:55,730 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:00:55,730 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:00:55,732 - root - INFO - Clearing user context 2025-12-15 13:01:03,301 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-15 13:01:03,301 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:01:03,302 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:01:03,302 - root - INFO - Clearing user context 2025-12-15 13:01:03,303 - root - INFO - User context cleared before authentication 2025-12-15 13:01:03,303 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:01:03,306 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:01:03,306 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:01:03,306 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:01:03,306 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:01:03,307 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:01:03,307 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:01:03,307 - root - INFO - Looking for user with username: admin 2025-12-15 13:01:03,307 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:01:03,307 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:01:03,307 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:01:03,325 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 10) 2025-12-15 13:01:03,330 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 10, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc 2025-12-15 13:01:03,331 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc 2025-12-15 13:01:03,332 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc 2025-12-15 13:01:03,332 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-15 13:01:03,336 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc, 页数: 1 2025-12-15 13:01:03,337 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-15 13:01:03,337 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-15 13:01:03,338 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-15 13:01:03,338 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc 2025-12-15 13:01:03,343 - root - INFO - Clearing user context 2025-12-15 13:01:05,689 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-15 13:01:05,689 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-15 13:01:05,690 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-15 13:01:05,690 - root - INFO - Clearing user context 2025-12-15 13:01:05,690 - root - INFO - User context cleared before authentication 2025-12-15 13:01:05,691 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-15 13:01:05,692 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-15 13:01:05,692 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:01:05,692 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-15 13:01:05,692 - root - INFO - Verified current user ID in context: 2 2025-12-15 13:01:05,693 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-15 13:01:05,693 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765788421} 2025-12-15 13:01:05,693 - root - INFO - Looking for user with username: admin 2025-12-15 13:01:05,693 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-15 13:01:05,694 - root - INFO - Verification - ContextVar user: admin 2025-12-15 13:01:05,694 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-15 13:01:05,695 - root - INFO - Clearing user context 2025-12-16 10:09:15,213 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:09:15,214 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:09:15,214 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:09:15,214 - root - INFO - Clearing user context 2025-12-16 10:09:15,215 - root - INFO - User context cleared before authentication 2025-12-16 10:09:15,215 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:09:15,216 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:09:15,217 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:09:15,217 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:09:15,217 - root - ERROR - Algorithm: HS256 2025-12-16 10:09:15,352 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:09:15,353 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:09:15,353 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:09:15,353 - root - INFO - Clearing user context 2025-12-16 10:09:15,353 - root - INFO - User context cleared before authentication 2025-12-16 10:09:15,353 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:09:15,353 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:09:15,353 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:09:15,353 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:09:15,354 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:25,074 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:25,075 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:25,075 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:25,075 - root - INFO - Clearing user context 2025-12-16 10:42:25,076 - root - INFO - User context cleared before authentication 2025-12-16 10:42:25,076 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:25,077 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:25,077 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:25,077 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:25,077 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:25,291 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:25,292 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:25,292 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:25,293 - root - INFO - Clearing user context 2025-12-16 10:42:25,293 - root - INFO - User context cleared before authentication 2025-12-16 10:42:25,293 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:25,294 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:25,294 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:25,295 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:25,295 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:25,295 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:42:25,295 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:25,295 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:42:25,296 - root - INFO - Clearing user context 2025-12-16 10:42:25,296 - root - INFO - User context cleared before authentication 2025-12-16 10:42:25,296 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:25,296 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:25,296 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:25,296 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:25,296 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:25,316 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:25,316 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:25,316 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:25,316 - root - INFO - Clearing user context 2025-12-16 10:42:25,316 - root - INFO - User context cleared before authentication 2025-12-16 10:42:25,316 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:25,316 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:25,316 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:25,317 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:25,317 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:25,319 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:42:25,319 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:25,319 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:42:25,319 - root - INFO - Clearing user context 2025-12-16 10:42:25,319 - root - INFO - User context cleared before authentication 2025-12-16 10:42:25,320 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:25,320 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:25,320 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:25,320 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:25,320 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:41,190 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:41,190 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:41,191 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:41,191 - root - INFO - Clearing user context 2025-12-16 10:42:41,191 - root - INFO - User context cleared before authentication 2025-12-16 10:42:41,192 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:41,192 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:41,192 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:41,193 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:41,193 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:41,371 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:41,371 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:41,371 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:41,371 - root - INFO - Clearing user context 2025-12-16 10:42:41,371 - root - INFO - User context cleared before authentication 2025-12-16 10:42:41,371 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTc4ODQyMX0.gsR-avVU0NYQ1VZFzevDj1ATDWLUjt2QoRKDQhMScuE 2025-12-16 10:42:41,372 - root - ERROR - Token verification failed: Signature has expired 2025-12-16 10:42:41,372 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:41,372 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-16 10:42:41,372 - root - ERROR - Algorithm: HS256 2025-12-16 10:42:48,224 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-16 10:42:48,224 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:48,225 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-16 10:42:48,225 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-16 10:42:48,460 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:42:48,460 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:48,460 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:42:48,460 - root - INFO - Clearing user context 2025-12-16 10:42:48,461 - root - INFO - User context cleared before authentication 2025-12-16 10:42:48,461 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:48,461 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:48,461 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:48,461 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:48,461 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:48,462 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:48,462 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:42:48,462 - root - INFO - Looking for user with username: admin 2025-12-16 10:42:48,462 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:42:48,462 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:48,462 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:42:48,463 - root - INFO - Clearing user context 2025-12-16 10:42:48,790 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-16 10:42:48,790 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:48,790 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-16 10:42:48,790 - root - INFO - Clearing user context 2025-12-16 10:42:48,790 - root - INFO - User context cleared before authentication 2025-12-16 10:42:48,790 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:48,791 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:48,791 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:48,791 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:48,791 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:48,791 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:48,792 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:42:48,792 - root - INFO - Looking for user with username: admin 2025-12-16 10:42:48,792 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:42:48,792 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:48,792 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:42:48,793 - root - INFO - Clearing user context 2025-12-16 10:42:49,236 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:42:49,236 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,236 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:42:49,236 - root - INFO - Clearing user context 2025-12-16 10:42:49,236 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,236 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,238 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,238 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,238 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,238 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,239 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:42:49,239 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,239 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:42:49,239 - root - INFO - Clearing user context 2025-12-16 10:42:49,239 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,239 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,240 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,240 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,240 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,241 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,244 - root - INFO - Clearing user context 2025-12-16 10:42:49,245 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:49,245 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:42:49,245 - root - INFO - Looking for user with username: admin 2025-12-16 10:42:49,246 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:42:49,247 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,247 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:42:49,261 - root - INFO - Clearing user context 2025-12-16 10:42:49,262 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:42:49,262 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,262 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:42:49,262 - root - INFO - Clearing user context 2025-12-16 10:42:49,263 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,263 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,264 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,264 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,264 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,265 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,268 - root - INFO - Clearing user context 2025-12-16 10:42:49,383 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:42:49,383 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,383 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:42:49,384 - root - INFO - Clearing user context 2025-12-16 10:42:49,384 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,384 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,385 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,385 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,385 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,386 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,386 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:42:49,386 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,386 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:42:49,386 - root - INFO - Clearing user context 2025-12-16 10:42:49,386 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,386 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,387 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,387 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,387 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,387 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,387 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:42:49,387 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,387 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:42:49,387 - root - INFO - Clearing user context 2025-12-16 10:42:49,387 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,387 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,388 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,388 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,388 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,388 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,391 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:42:49,391 - root - INFO - Clearing user context 2025-12-16 10:42:49,391 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:42:49,392 - root - INFO - Clearing user context 2025-12-16 10:42:49,392 - root - INFO - Looking for user with username: admin 2025-12-16 10:42:49,393 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:42:49,393 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,393 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:42:49,398 - root - INFO - Clearing user context 2025-12-16 10:42:49,591 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:42:49,591 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,591 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:42:49,591 - root - INFO - Clearing user context 2025-12-16 10:42:49,591 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,591 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,592 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,592 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,592 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,592 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,593 - root - INFO - Clearing user context 2025-12-16 10:42:49,596 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:42:49,596 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:49,596 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:42:49,596 - root - INFO - Clearing user context 2025-12-16 10:42:49,596 - root - INFO - User context cleared before authentication 2025-12-16 10:42:49,596 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:49,597 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:49,597 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:49,597 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:49,597 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:49,598 - root - INFO - Clearing user context 2025-12-16 10:42:50,952 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/3 2025-12-16 10:42:50,952 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:50,952 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3 2025-12-16 10:42:50,952 - root - INFO - Clearing user context 2025-12-16 10:42:50,952 - root - INFO - User context cleared before authentication 2025-12-16 10:42:50,952 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:50,953 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:50,953 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:50,953 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:50,953 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:50,955 - root - INFO - Clearing user context 2025-12-16 10:42:50,963 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/3/messages 2025-12-16 10:42:50,963 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:50,964 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/messages 2025-12-16 10:42:50,964 - root - INFO - Clearing user context 2025-12-16 10:42:50,964 - root - INFO - User context cleared before authentication 2025-12-16 10:42:50,964 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:50,965 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:50,965 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:50,965 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:50,965 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:50,970 - root - INFO - Clearing user context 2025-12-16 10:42:59,783 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/3/chat/stream 2025-12-16 10:42:59,783 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:42:59,784 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/chat/stream 2025-12-16 10:42:59,784 - root - INFO - Clearing user context 2025-12-16 10:42:59,784 - root - INFO - User context cleared before authentication 2025-12-16 10:42:59,784 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:42:59,785 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:42:59,785 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:42:59,785 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:42:59,785 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:42:59,790 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-16 10:42:59,871 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:42:59,872 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:42:59,872 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:42:59,872 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:42:59,873 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-16 10:42:59,893 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-16 10:42:59,894 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:42:59,894 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:42:59,894 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:42:59,894 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:42:59,894 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-16 10:42:59,895 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-16 10:42:59,895 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-16 10:42:59,895 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-16 10:42:59,895 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-16 10:42:59,895 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-16 10:42:59,895 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-16 10:42:59,895 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-16 10:42:59,895 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-16 10:42:59,895 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-16 10:42:59,895 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-16 10:42:59,895 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-16 10:42:59,897 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-16 10:42:59,897 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-16 10:42:59,898 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-16 10:42:59,898 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-16 10:42:59,898 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:42:59,898 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:42:59,898 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:42:59,898 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-16 10:42:59,899 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 3 via LangChain 2025-12-16 10:42:59,899 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 3 2025-12-16 10:42:59,927 - root - INFO - Clearing user context 2025-12-16 10:43:00,682 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-16 10:43:02,530 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 3 2025-12-16 10:43:09,698 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/3/chat/stream 2025-12-16 10:43:09,698 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/3/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:43:09,698 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/3/chat/stream 2025-12-16 10:43:09,698 - root - INFO - Clearing user context 2025-12-16 10:43:09,698 - root - INFO - User context cleared before authentication 2025-12-16 10:43:09,699 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:43:09,699 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:43:09,700 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:43:09,700 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:43:09,700 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:43:09,701 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-16 10:43:09,704 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:43:09,704 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:43:09,704 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:43:09,704 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:43:09,706 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-16 10:43:09,736 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-16 10:43:09,737 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:43:09,737 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:43:09,737 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:43:09,737 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:43:09,737 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-16 10:43:09,738 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-16 10:43:09,738 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-16 10:43:09,738 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:43:09,738 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:43:09,738 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:43:09,738 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-16 10:43:09,739 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 3 via LangChain 2025-12-16 10:43:09,739 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 3 2025-12-16 10:43:09,752 - root - INFO - Clearing user context 2025-12-16 10:43:10,995 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-16 10:43:17,919 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 3 2025-12-16 10:43:19,686 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:43:19,686 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:43:19,686 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:43:19,686 - root - INFO - Clearing user context 2025-12-16 10:43:19,687 - root - INFO - User context cleared before authentication 2025-12-16 10:43:19,687 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:43:19,688 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:43:19,688 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:43:19,688 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:43:19,688 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:43:19,689 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:43:19,690 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:43:19,690 - root - INFO - Looking for user with username: admin 2025-12-16 10:43:19,691 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:43:19,691 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:43:19,691 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:43:19,705 - root - INFO - Clearing user context 2025-12-16 10:43:21,088 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-16 10:43:21,088 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:43:21,089 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:43:21,089 - root - INFO - Clearing user context 2025-12-16 10:43:21,089 - root - INFO - User context cleared before authentication 2025-12-16 10:43:21,089 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:43:21,092 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:43:21,092 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:43:21,092 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:43:21,092 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:43:21,093 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:43:21,093 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:43:21,093 - root - INFO - Looking for user with username: admin 2025-12-16 10:43:21,094 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:43:21,094 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:43:21,094 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:43:21,095 - root - INFO - Clearing user context 2025-12-16 10:44:33,404 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-16 10:44:33,405 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:33,405 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:44:33,405 - root - INFO - Clearing user context 2025-12-16 10:44:33,406 - root - INFO - User context cleared before authentication 2025-12-16 10:44:33,406 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:33,408 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:33,409 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:33,409 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:33,409 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:33,410 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:33,410 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:33,410 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:33,410 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:33,411 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:33,411 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:33,428 - th_agenter.services.document - INFO - Uploaded document: testpdf.pdf to KB 7 (Doc ID: 11) 2025-12-16 10:44:33,429 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 11, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/f41fa3b5-4e35-4b5e-aecc-950878c902aa_testpdf.pdf 2025-12-16 10:44:33,578 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/f41fa3b5-4e35-4b5e-aecc-950878c902aa_testpdf.pdf, 页数: 2 2025-12-16 10:44:33,578 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-16 10:44:33,579 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-16 10:44:33,579 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 4 个文档块 2025-12-16 10:44:33,858 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:34,027 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:34,176 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:34,316 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:34,413 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-16 10:44:34,427 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 11, 'status': 'success', 'chunks_count': 4, 'message': '文档处理完成'} 2025-12-16 10:44:34,445 - th_agenter.services.document - INFO - Processed document: f41fa3b5-4e35-4b5e-aecc-950878c902aa_testpdf.pdf (ID: 11) 2025-12-16 10:44:34,448 - root - INFO - Clearing user context 2025-12-16 10:44:36,462 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-16 10:44:36,462 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:36,463 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:44:36,463 - root - INFO - Clearing user context 2025-12-16 10:44:36,463 - root - INFO - User context cleared before authentication 2025-12-16 10:44:36,463 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:36,463 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:36,464 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:36,464 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:36,464 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:36,464 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:36,465 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:36,465 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:36,465 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:36,465 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:36,465 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:36,467 - root - INFO - Clearing user context 2025-12-16 10:44:40,983 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/9 2025-12-16 10:44:40,983 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/9 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:40,983 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/9 2025-12-16 10:44:40,983 - root - INFO - Clearing user context 2025-12-16 10:44:40,983 - root - INFO - User context cleared before authentication 2025-12-16 10:44:40,983 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:40,984 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:40,984 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:40,984 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:40,984 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:40,984 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:40,985 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:40,985 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:40,985 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:40,985 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:40,985 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:40,986 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/9976cdff-e6b7-45af-aa89-3caf46ed273b_testpdf.pdf 2025-12-16 10:44:41,044 - th_agenter.services.document_processor - INFO - 成功删除 4 个文档块: document_id=9 2025-12-16 10:44:41,044 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=9 2025-12-16 10:44:41,061 - th_agenter.services.document - INFO - Deleted document: 9976cdff-e6b7-45af-aa89-3caf46ed273b_testpdf.pdf (ID: 9) 2025-12-16 10:44:41,061 - root - INFO - Clearing user context 2025-12-16 10:44:41,247 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-16 10:44:41,247 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:41,247 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:44:41,247 - root - INFO - Clearing user context 2025-12-16 10:44:41,247 - root - INFO - User context cleared before authentication 2025-12-16 10:44:41,247 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:41,248 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:41,249 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:41,249 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:41,249 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:41,250 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:41,250 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:41,250 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:41,251 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:41,251 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:41,251 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:41,253 - root - INFO - Clearing user context 2025-12-16 10:44:45,901 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-16 10:44:45,902 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:45,902 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:44:45,902 - root - INFO - Clearing user context 2025-12-16 10:44:45,903 - root - INFO - User context cleared before authentication 2025-12-16 10:44:45,903 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:45,906 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:45,906 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:45,906 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:45,906 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:45,907 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:45,907 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:45,907 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:45,908 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:45,908 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:45,908 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:45,935 - th_agenter.services.document - INFO - Uploaded document: 周报.txt to KB 7 (Doc ID: 12) 2025-12-16 10:44:45,939 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 12, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/da0ec296-a120-4114-8edc-a03f35fd4d6e_周报.txt 2025-12-16 10:44:45,940 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/da0ec296-a120-4114-8edc-a03f35fd4d6e_周报.txt, 页数: 1 2025-12-16 10:44:45,941 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-16 10:44:45,941 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-16 10:44:45,943 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 7 个文档块 2025-12-16 10:44:46,147 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:46,283 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:46,456 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:46,578 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:46,684 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:46,899 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:47,062 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:44:47,151 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-16 10:44:47,168 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 12, 'status': 'success', 'chunks_count': 7, 'message': '文档处理完成'} 2025-12-16 10:44:47,178 - th_agenter.services.document - INFO - Processed document: da0ec296-a120-4114-8edc-a03f35fd4d6e_周报.txt (ID: 12) 2025-12-16 10:44:47,179 - root - INFO - Clearing user context 2025-12-16 10:44:49,523 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-16 10:44:49,523 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:49,523 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-16 10:44:49,523 - root - INFO - Clearing user context 2025-12-16 10:44:49,523 - root - INFO - User context cleared before authentication 2025-12-16 10:44:49,523 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:49,524 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:49,524 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:49,524 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:49,524 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:49,524 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:49,524 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:49,525 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:49,525 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:49,525 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:49,525 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:44:49,527 - root - INFO - Clearing user context 2025-12-16 10:44:59,853 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/search 2025-12-16 10:44:59,853 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/search against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:44:59,853 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/search 2025-12-16 10:44:59,853 - root - INFO - Clearing user context 2025-12-16 10:44:59,853 - root - INFO - User context cleared before authentication 2025-12-16 10:44:59,853 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:44:59,854 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:44:59,854 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:59,854 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:44:59,854 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:44:59,855 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:44:59,856 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:44:59,856 - root - INFO - Looking for user with username: admin 2025-12-16 10:44:59,856 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:44:59,856 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:44:59,856 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:45:00,141 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-16 10:45:00,226 - th_agenter.services.document_processor - INFO - PostgreSQL pgvector搜索完成,找到 5 个相关文档 2025-12-16 10:45:00,226 - root - INFO - Clearing user context 2025-12-16 10:45:25,496 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:45:25,496 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,497 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:45:25,497 - root - INFO - Clearing user context 2025-12-16 10:45:25,497 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,498 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,500 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,501 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,501 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,501 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,502 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:45:25,502 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,502 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:45:25,502 - root - INFO - Clearing user context 2025-12-16 10:45:25,502 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,502 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,503 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,503 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,503 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,503 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,505 - root - INFO - Clearing user context 2025-12-16 10:45:25,505 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:45:25,505 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:45:25,505 - root - INFO - Looking for user with username: admin 2025-12-16 10:45:25,506 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:45:25,506 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,506 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:45:25,511 - root - INFO - Clearing user context 2025-12-16 10:45:25,742 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:45:25,742 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,742 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:45:25,742 - root - INFO - Clearing user context 2025-12-16 10:45:25,742 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,742 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,743 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,743 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,743 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,743 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,744 - root - INFO - Clearing user context 2025-12-16 10:45:25,832 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:45:25,832 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,832 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:45:25,832 - root - INFO - Clearing user context 2025-12-16 10:45:25,832 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,833 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,833 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,833 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,833 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,833 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,834 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:45:25,834 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,834 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:45:25,834 - root - INFO - Clearing user context 2025-12-16 10:45:25,834 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,834 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,835 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,835 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,835 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,835 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,836 - root - INFO - Clearing user context 2025-12-16 10:45:25,836 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:45:25,836 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:45:25,836 - root - INFO - Looking for user with username: admin 2025-12-16 10:45:25,837 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:45:25,837 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,837 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:45:25,842 - root - INFO - Clearing user context 2025-12-16 10:45:25,842 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:45:25,842 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:25,842 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:45:25,842 - root - INFO - Clearing user context 2025-12-16 10:45:25,842 - root - INFO - User context cleared before authentication 2025-12-16 10:45:25,842 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:25,843 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:25,843 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:25,843 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:25,843 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:25,844 - root - INFO - Clearing user context 2025-12-16 10:45:26,696 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations 2025-12-16 10:45:26,696 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:26,696 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:45:26,696 - root - INFO - Clearing user context 2025-12-16 10:45:26,696 - root - INFO - User context cleared before authentication 2025-12-16 10:45:26,697 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:26,698 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:26,698 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:26,698 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:26,698 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:26,700 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:45:26,700 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:45:26,700 - root - INFO - Looking for user with username: admin 2025-12-16 10:45:26,701 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:45:26,701 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:26,701 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:45:26,702 - th_agenter.conversation_service - INFO - Creating new conversation for user 2 2025-12-16 10:45:26,716 - th_agenter.conversation_service - INFO - Successfully created conversation 4 for user 2 2025-12-16 10:45:26,716 - root - INFO - Clearing user context 2025-12-16 10:45:39,796 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/4/chat/stream 2025-12-16 10:45:39,796 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/4/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:45:39,796 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/4/chat/stream 2025-12-16 10:45:39,796 - root - INFO - Clearing user context 2025-12-16 10:45:39,796 - root - INFO - User context cleared before authentication 2025-12-16 10:45:39,796 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:45:39,797 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:45:39,797 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:45:39,797 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:45:39,797 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:45:39,797 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-16 10:45:39,800 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:45:39,800 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:45:39,800 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:45:39,800 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:45:39,801 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-16 10:45:39,821 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-16 10:45:39,822 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:45:39,822 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:45:39,822 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:45:39,822 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-16 10:45:39,822 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-16 10:45:39,823 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-16 10:45:39,823 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-16 10:45:39,823 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-16 10:45:39,824 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-16 10:45:39,824 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-16 10:45:39,824 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-16 10:45:39,824 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 4 via LangChain 2025-12-16 10:45:39,824 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 4 2025-12-16 10:45:39,873 - root - INFO - Clearing user context 2025-12-16 10:45:40,672 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-16 10:45:42,804 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 4 2025-12-16 10:51:39,676 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-16 10:51:39,677 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:39,677 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-16 10:51:39,677 - root - INFO - Clearing user context 2025-12-16 10:51:39,677 - root - INFO - User context cleared before authentication 2025-12-16 10:51:39,677 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:39,678 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:39,678 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:39,678 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:39,678 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:39,679 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:51:39,679 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:51:39,679 - root - INFO - Looking for user with username: admin 2025-12-16 10:51:39,680 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:51:39,680 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:39,680 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:51:39,681 - root - INFO - Clearing user context 2025-12-16 10:51:39,687 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-16 10:51:39,687 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:39,687 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-16 10:51:39,687 - root - INFO - Clearing user context 2025-12-16 10:51:39,687 - root - INFO - User context cleared before authentication 2025-12-16 10:51:39,687 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:39,688 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:39,688 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:39,689 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:39,689 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:39,689 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:51:39,690 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:51:39,690 - root - INFO - Looking for user with username: admin 2025-12-16 10:51:39,690 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:51:39,691 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:39,691 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:51:39,692 - root - INFO - Clearing user context 2025-12-16 10:51:40,170 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:51:40,170 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,171 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:51:40,171 - root - INFO - Clearing user context 2025-12-16 10:51:40,171 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,171 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,173 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,173 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,174 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,174 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,175 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:51:40,175 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,175 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:51:40,175 - root - INFO - Clearing user context 2025-12-16 10:51:40,175 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,175 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,176 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,176 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,176 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,176 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,177 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:51:40,177 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:51:40,178 - root - INFO - Looking for user with username: admin 2025-12-16 10:51:40,178 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:51:40,178 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,178 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:51:40,184 - root - INFO - Clearing user context 2025-12-16 10:51:40,184 - root - INFO - Clearing user context 2025-12-16 10:51:40,189 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:51:40,189 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,189 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:51:40,189 - root - INFO - Clearing user context 2025-12-16 10:51:40,189 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,189 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,190 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,190 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,190 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,190 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,190 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-16 10:51:40,190 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,190 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-16 10:51:40,190 - root - INFO - Clearing user context 2025-12-16 10:51:40,190 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,191 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,191 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,191 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,191 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,191 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,192 - root - INFO - Clearing user context 2025-12-16 10:51:40,193 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-16 10:51:40,193 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765870968} 2025-12-16 10:51:40,193 - root - INFO - Looking for user with username: admin 2025-12-16 10:51:40,193 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:51:40,193 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-16 10:51:40,194 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,194 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,194 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:51:40,194 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-16 10:51:40,194 - root - INFO - Clearing user context 2025-12-16 10:51:40,194 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,194 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,194 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,194 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,195 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,195 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,200 - root - INFO - Clearing user context 2025-12-16 10:51:40,200 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-16 10:51:40,200 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,200 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-16 10:51:40,200 - root - INFO - Clearing user context 2025-12-16 10:51:40,200 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,200 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,201 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,201 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,201 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,201 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,202 - root - INFO - Clearing user context 2025-12-16 10:51:40,203 - root - INFO - Clearing user context 2025-12-16 10:51:40,531 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:51:40,531 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,531 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:51:40,531 - root - INFO - Clearing user context 2025-12-16 10:51:40,532 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,532 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,534 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,534 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,534 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,534 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,538 - root - INFO - Clearing user context 2025-12-16 10:51:40,867 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-16 10:51:40,868 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-16 10:51:40,868 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-16 10:51:40,868 - root - INFO - Clearing user context 2025-12-16 10:51:40,868 - root - INFO - User context cleared before authentication 2025-12-16 10:51:40,869 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-16 10:51:40,871 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-16 10:51:40,872 - root - INFO - Verification - ContextVar user: admin 2025-12-16 10:51:40,872 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-16 10:51:40,872 - root - INFO - Verified current user ID in context: 2 2025-12-16 10:51:40,876 - root - INFO - Clearing user context 2025-12-17 18:34:21,366 - root - INFO - Logging configured successfully 2025-12-17 18:34:21,469 - root - INFO - Logging configured successfully 2025-12-17 18:34:21,554 - root - INFO - Starting up TH-Agenter application... 2025-12-17 18:34:21,563 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 18:34:21,565 - root - INFO - Database tables created 2025-12-17 18:34:21,565 - root - INFO - Database initialized 2025-12-17 18:35:16,860 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:16,860 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:16,860 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:16,860 - root - INFO - Clearing user context 2025-12-17 18:35:16,860 - root - INFO - User context cleared before authentication 2025-12-17 18:35:16,860 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:16,860 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:16,860 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:16,860 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:16,860 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,001 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:18,002 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,002 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:18,002 - root - INFO - Clearing user context 2025-12-17 18:35:18,002 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,002 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,002 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,002 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,002 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,002 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,002 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:35:18,002 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,003 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:35:18,003 - root - INFO - Clearing user context 2025-12-17 18:35:18,003 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,003 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,003 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,003 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,003 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,003 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,003 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:18,003 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,003 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:18,003 - root - INFO - Clearing user context 2025-12-17 18:35:18,003 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,003 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,004 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,004 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,004 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,004 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,007 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:35:18,007 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,007 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:35:18,007 - root - INFO - Clearing user context 2025-12-17 18:35:18,007 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,007 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,008 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,008 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,008 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,008 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,008 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:18,008 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,008 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:18,008 - root - INFO - Clearing user context 2025-12-17 18:35:18,008 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,008 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,008 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,008 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,008 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,009 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,360 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:18,360 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,360 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:18,360 - root - INFO - Clearing user context 2025-12-17 18:35:18,360 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,360 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,360 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,360 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,360 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,360 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:18,361 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:18,361 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:18,361 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:18,361 - root - INFO - Clearing user context 2025-12-17 18:35:18,361 - root - INFO - User context cleared before authentication 2025-12-17 18:35:18,361 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:18,361 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:18,361 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:18,361 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:18,361 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:57,854 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:57,855 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:57,855 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:57,855 - root - INFO - Clearing user context 2025-12-17 18:35:57,856 - root - INFO - User context cleared before authentication 2025-12-17 18:35:57,856 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:57,857 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:57,857 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:57,857 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:57,858 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,403 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:58,404 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,404 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:58,404 - root - INFO - Clearing user context 2025-12-17 18:35:58,404 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,405 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,405 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,405 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,406 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,406 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,408 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:35:58,408 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,409 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:35:58,409 - root - INFO - Clearing user context 2025-12-17 18:35:58,409 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,410 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,410 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,410 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,411 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,411 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,412 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:58,412 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,412 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:58,413 - root - INFO - Clearing user context 2025-12-17 18:35:58,413 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,414 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,414 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,415 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,415 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,415 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,417 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:58,418 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,418 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:58,419 - root - INFO - Clearing user context 2025-12-17 18:35:58,419 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,420 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,420 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,421 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,421 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,421 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,427 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:35:58,427 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,427 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:35:58,428 - root - INFO - Clearing user context 2025-12-17 18:35:58,428 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,428 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,429 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,429 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,429 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,429 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,456 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:58,456 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,457 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:58,457 - root - INFO - Clearing user context 2025-12-17 18:35:58,457 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,457 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,457 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,457 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,458 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,458 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,790 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:35:58,790 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,790 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:35:58,790 - root - INFO - Clearing user context 2025-12-17 18:35:58,790 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,790 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,790 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,790 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,791 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,791 - root - ERROR - Algorithm: HS256 2025-12-17 18:35:58,810 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:35:58,810 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:35:58,810 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:35:58,810 - root - INFO - Clearing user context 2025-12-17 18:35:58,810 - root - INFO - User context cleared before authentication 2025-12-17 18:35:58,810 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTg3MDk2OH0.lrjvhYA8x8GSWjG6awEx96Tw9R0LDcYQC-L1uED4vgY 2025-12-17 18:35:58,810 - root - ERROR - Token verification failed: Signature has expired 2025-12-17 18:35:58,811 - root - ERROR - Token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:35:58,811 - root - ERROR - Secret key: your-strong-secret-k... 2025-12-17 18:35:58,811 - root - ERROR - Algorithm: HS256 2025-12-17 18:36:05,181 - root - INFO - [MIDDLEWARE] Processing request: POST /api/auth/login 2025-12-17 18:36:05,182 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/login against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,182 - root - INFO - [MIDDLEWARE] Path /api/auth/login exactly matches exclude_path /api/auth/login 2025-12-17 18:36:05,182 - root - INFO - [MIDDLEWARE] Skipping authentication for excluded path: /api/auth/login 2025-12-17 18:36:05,398 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:36:05,398 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,398 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:36:05,398 - root - INFO - Clearing user context 2025-12-17 18:36:05,398 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,398 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,399 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,399 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,400 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,400 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,400 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:05,400 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:05,400 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:05,401 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:05,401 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,401 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:05,403 - root - INFO - Clearing user context 2025-12-17 18:36:05,415 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-17 18:36:05,415 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,415 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-17 18:36:05,415 - root - INFO - Clearing user context 2025-12-17 18:36:05,415 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,415 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,415 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,415 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,415 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,416 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,416 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:05,417 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:05,417 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:05,417 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:05,417 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,417 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:05,419 - root - INFO - Clearing user context 2025-12-17 18:36:05,459 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:36:05,459 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,460 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:36:05,460 - root - INFO - Clearing user context 2025-12-17 18:36:05,460 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,460 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,460 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,460 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,461 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,461 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,466 - root - INFO - Clearing user context 2025-12-17 18:36:05,799 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:36:05,799 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,800 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:36:05,800 - root - INFO - Clearing user context 2025-12-17 18:36:05,800 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,800 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,803 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,804 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,804 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,804 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,808 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:36:05,808 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,809 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:36:05,809 - root - INFO - Clearing user context 2025-12-17 18:36:05,809 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,809 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,812 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,812 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,813 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,813 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,821 - root - INFO - Clearing user context 2025-12-17 18:36:05,821 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:05,824 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:05,825 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:05,827 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:05,828 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,828 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:05,859 - root - INFO - Clearing user context 2025-12-17 18:36:05,859 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-17 18:36:05,859 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:05,859 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-17 18:36:05,860 - root - INFO - Clearing user context 2025-12-17 18:36:05,860 - root - INFO - User context cleared before authentication 2025-12-17 18:36:05,860 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:05,861 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:05,861 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:05,861 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:05,861 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:05,864 - root - INFO - Clearing user context 2025-12-17 18:36:06,166 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:36:06,166 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:06,166 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:36:06,166 - root - INFO - Clearing user context 2025-12-17 18:36:06,167 - root - INFO - User context cleared before authentication 2025-12-17 18:36:06,167 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:06,170 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:06,170 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:06,170 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:06,171 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:06,176 - root - INFO - Clearing user context 2025-12-17 18:36:06,198 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:36:06,198 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:06,198 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:36:06,198 - root - INFO - Clearing user context 2025-12-17 18:36:06,198 - root - INFO - User context cleared before authentication 2025-12-17 18:36:06,199 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:06,199 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:06,199 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:06,199 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:06,199 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:06,200 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:06,200 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:06,200 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:06,200 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:06,200 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:06,200 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:06,206 - root - INFO - Clearing user context 2025-12-17 18:36:06,206 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-17 18:36:06,206 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:06,206 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-17 18:36:06,206 - root - INFO - Clearing user context 2025-12-17 18:36:06,206 - root - INFO - User context cleared before authentication 2025-12-17 18:36:06,206 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:06,207 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:06,207 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:06,207 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:06,207 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:06,208 - root - INFO - Clearing user context 2025-12-17 18:36:06,541 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-17 18:36:06,541 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:06,541 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-17 18:36:06,541 - root - INFO - Clearing user context 2025-12-17 18:36:06,541 - root - INFO - User context cleared before authentication 2025-12-17 18:36:06,541 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:06,542 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:06,542 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:06,542 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:06,542 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:06,543 - root - INFO - Clearing user context 2025-12-17 18:36:10,607 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/4 2025-12-17 18:36:10,607 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/4 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:10,607 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/4 2025-12-17 18:36:10,607 - root - INFO - Clearing user context 2025-12-17 18:36:10,608 - root - INFO - User context cleared before authentication 2025-12-17 18:36:10,608 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:10,608 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:10,608 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:10,608 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:10,609 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:10,610 - root - INFO - Clearing user context 2025-12-17 18:36:10,944 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/4/messages 2025-12-17 18:36:10,945 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/4/messages against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:10,945 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/4/messages 2025-12-17 18:36:10,945 - root - INFO - Clearing user context 2025-12-17 18:36:10,945 - root - INFO - User context cleared before authentication 2025-12-17 18:36:10,945 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:10,945 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:10,945 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:10,946 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:10,946 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:10,948 - root - INFO - Clearing user context 2025-12-17 18:36:30,529 - root - INFO - [MIDDLEWARE] Processing request: POST /api/chat/conversations/4/chat/stream 2025-12-17 18:36:30,529 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/4/chat/stream against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:30,530 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/4/chat/stream 2025-12-17 18:36:30,530 - root - INFO - Clearing user context 2025-12-17 18:36:30,530 - root - INFO - User context cleared before authentication 2025-12-17 18:36:30,530 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:30,533 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:30,534 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:30,534 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:30,534 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:30,540 - th_agenter.langchain_chat_service - INFO - LLM Provider: doubao 2025-12-17 18:36:30,815 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-17 18:36:30,815 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-17 18:36:30,815 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-17 18:36:30,815 - th_agenter.langchain_chat_service - INFO - LangChain ChatService initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-17 18:36:30,818 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-17 18:36:30,839 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-17 18:36:30,840 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-17 18:36:30,840 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-17 18:36:30,840 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-17 18:36:30,840 - th_agenter.knowledge_chat_service - INFO - Knowledge Chat Service initialized with model: doubao-1-5-pro-32k-250115 and Redis memory 2025-12-17 18:36:30,841 - th_agenter.postgresql_tool_manager - INFO - 创建全局PostgreSQL工具实例 2025-12-17 18:36:30,841 - th_agenter.mysql_tool_manager - INFO - 创建全局MySQL工具实例 2025-12-17 18:36:30,841 - th_agenter.agent_tools - INFO - Registered tool: weather_query_tool (enabled: True) 2025-12-17 18:36:30,841 - th_agenter.agent_service - INFO - Registered tool: weather_query_tool 2025-12-17 18:36:30,841 - th_agenter.agent_tools - INFO - Registered tool: tavily_search_tool (enabled: True) 2025-12-17 18:36:30,841 - th_agenter.agent_service - INFO - Registered tool: tavily_search_tool 2025-12-17 18:36:30,841 - th_agenter.agent_tools - INFO - Registered tool: datetime_tool (enabled: True) 2025-12-17 18:36:30,841 - th_agenter.agent_service - INFO - Registered tool: datetime_tool 2025-12-17 18:36:30,841 - th_agenter.agent_tools - INFO - Registered tool: postgresql_mcp (enabled: True) 2025-12-17 18:36:30,841 - th_agenter.agent_service - INFO - Registered tool: postgresql_mcp 2025-12-17 18:36:30,841 - th_agenter.agent_tools - INFO - Registered tool: mysql_mcp (enabled: True) 2025-12-17 18:36:30,841 - th_agenter.agent_service - INFO - Registered tool: mysql_mcp 2025-12-17 18:36:30,844 - th_agenter.agent_service - INFO - Loaded agent configuration from database 2025-12-17 18:36:30,844 - th_agenter.langgraph_agent_service - WARNING - Failed to load config from database: 'AgentConfigService' object has no attribute 'get_active_config' 2025-12-17 18:36:30,845 - th_agenter.langgraph_agent_service - ERROR - Failed to create agent: init_chat_model() missing 1 required positional argument: 'model_name' 2025-12-17 18:36:30,845 - th_agenter.chat_service - WARNING - Failed to initialize LangGraphAgentService: init_chat_model() missing 1 required positional argument: 'model_name'. LangGraph functionality will be disabled. 2025-12-17 18:36:30,845 - th_agenter.redis_memory_service - INFO - Successfully connected to Redis at 192.168.10.66:6379 db=0 2025-12-17 18:36:30,846 - th_agenter.redis_memory_service - INFO - Conversation history directory: /home/thsw2/jcq/workspace/HXF/backend/th_agenter/services/../../conversation_history (exists: True) 2025-12-17 18:36:30,846 - th_agenter.redis_memory_service - INFO - Current working directory: /home/thsw2/jcq/workspace/HXF/backend 2025-12-17 18:36:30,846 - th_agenter.chat_service - INFO - ChatService initialized with LangChain backend, Agent support, and Redis memory 2025-12-17 18:36:30,846 - th_agenter.chat_service - INFO - Processing streaming chat request for conversation 4 via LangChain 2025-12-17 18:36:30,846 - th_agenter.langchain_chat_service - INFO - Processing LangChain streaming chat request for conversation 4 2025-12-17 18:36:30,869 - root - INFO - Clearing user context 2025-12-17 18:36:31,778 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-17 18:36:33,299 - th_agenter.langchain_chat_service - INFO - Successfully processed LangChain streaming chat request for conversation 4 2025-12-17 18:36:38,221 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:36:38,222 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:38,222 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:36:38,222 - root - INFO - Clearing user context 2025-12-17 18:36:38,222 - root - INFO - User context cleared before authentication 2025-12-17 18:36:38,222 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:38,223 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:38,223 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:38,223 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:38,223 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:38,224 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:38,224 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:38,224 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:38,224 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:38,224 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:38,224 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:38,230 - root - INFO - Clearing user context 2025-12-17 18:36:40,007 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:36:40,008 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:40,008 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:36:40,008 - root - INFO - Clearing user context 2025-12-17 18:36:40,008 - root - INFO - User context cleared before authentication 2025-12-17 18:36:40,009 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:40,011 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:40,012 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:40,012 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:40,012 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:40,013 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:40,013 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:40,013 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:40,014 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:40,014 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:40,014 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:40,016 - root - INFO - Clearing user context 2025-12-17 18:36:54,733 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-17 18:36:54,733 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:54,733 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:36:54,733 - root - INFO - Clearing user context 2025-12-17 18:36:54,733 - root - INFO - User context cleared before authentication 2025-12-17 18:36:54,733 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:54,734 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:54,734 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:54,734 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:54,734 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:54,735 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:54,736 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:54,736 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:54,736 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:54,736 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:54,736 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:54,756 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 13) 2025-12-17 18:36:54,759 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-17 18:36:54,779 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-17 18:36:54,781 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-17 18:36:54,781 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 13, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc 2025-12-17 18:36:54,781 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc 2025-12-17 18:36:54,781 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc 2025-12-17 18:36:54,782 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-17 18:36:54,782 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc, 页数: 1 2025-12-17 18:36:54,783 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-17 18:36:54,783 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-17 18:36:54,783 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-17 18:36:54,783 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc 2025-12-17 18:36:54,785 - root - INFO - Clearing user context 2025-12-17 18:36:56,804 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:36:56,804 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:36:56,804 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:36:56,805 - root - INFO - Clearing user context 2025-12-17 18:36:56,805 - root - INFO - User context cleared before authentication 2025-12-17 18:36:56,805 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:36:56,807 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:36:56,807 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:56,808 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:36:56,808 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:36:56,809 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:36:56,809 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:36:56,809 - root - INFO - Looking for user with username: admin 2025-12-17 18:36:56,809 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:36:56,809 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:36:56,810 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:36:56,811 - root - INFO - Clearing user context 2025-12-17 18:37:02,893 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/13 2025-12-17 18:37:02,893 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/13 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:02,894 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/13 2025-12-17 18:37:02,894 - root - INFO - Clearing user context 2025-12-17 18:37:02,894 - root - INFO - User context cleared before authentication 2025-12-17 18:37:02,895 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:02,897 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:02,898 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:02,898 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:02,898 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:02,902 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:02,903 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:02,903 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:02,905 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:02,905 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:02,906 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:02,914 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc 2025-12-17 18:37:02,987 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=13 2025-12-17 18:37:02,988 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=13 2025-12-17 18:37:03,004 - th_agenter.services.document - INFO - Deleted document: 808cdf0c-f003-449b-a212-eedb378bd04e_testdoc1.doc (ID: 13) 2025-12-17 18:37:03,005 - root - INFO - Clearing user context 2025-12-17 18:37:03,022 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:37:03,023 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:03,023 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:37:03,023 - root - INFO - Clearing user context 2025-12-17 18:37:03,023 - root - INFO - User context cleared before authentication 2025-12-17 18:37:03,024 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:03,026 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:03,027 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:03,027 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:03,027 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:03,030 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:03,030 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:03,031 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:03,034 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:03,034 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:03,034 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:03,036 - root - INFO - Clearing user context 2025-12-17 18:37:06,326 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/10 2025-12-17 18:37:06,326 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/10 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:06,327 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/10 2025-12-17 18:37:06,327 - root - INFO - Clearing user context 2025-12-17 18:37:06,327 - root - INFO - User context cleared before authentication 2025-12-17 18:37:06,327 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:06,329 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:06,329 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:06,330 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:06,330 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:06,331 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:06,331 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:06,331 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:06,333 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:06,333 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:06,333 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:06,335 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc 2025-12-17 18:37:06,359 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=10 2025-12-17 18:37:06,359 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=10 2025-12-17 18:37:06,378 - th_agenter.services.document - INFO - Deleted document: b74f8e37-600a-4880-9f24-ce5a33d132e6_testdoc1.doc (ID: 10) 2025-12-17 18:37:06,379 - root - INFO - Clearing user context 2025-12-17 18:37:06,591 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:37:06,592 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:06,592 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:37:06,592 - root - INFO - Clearing user context 2025-12-17 18:37:06,592 - root - INFO - User context cleared before authentication 2025-12-17 18:37:06,593 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:06,595 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:06,596 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:06,596 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:06,596 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:06,599 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:06,599 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:06,600 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:06,602 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:06,602 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:06,603 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:06,610 - root - INFO - Clearing user context 2025-12-17 18:37:12,328 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-17 18:37:12,328 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:12,329 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:37:12,329 - root - INFO - Clearing user context 2025-12-17 18:37:12,329 - root - INFO - User context cleared before authentication 2025-12-17 18:37:12,329 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:12,332 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:12,332 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:12,332 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:12,333 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:12,334 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:12,334 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:12,334 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:12,334 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:12,334 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:12,334 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:12,350 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 13) 2025-12-17 18:37:12,351 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 13, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc 2025-12-17 18:37:12,351 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc 2025-12-17 18:37:12,351 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc 2025-12-17 18:37:12,351 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-17 18:37:12,352 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc, 页数: 1 2025-12-17 18:37:12,352 - th_agenter.services.document_processor - ERROR - 获取语义分割点失败: cannot import name 'ChatOpenAI' from 'langchain.chat_models' (/home/thsw2/miniconda3/envs/langchain/lib/python3.12/site-packages/langchain/chat_models/__init__.py) 2025-12-17 18:37:12,352 - th_agenter.services.document_processor - WARNING - 语义分割失败,使用默认分割器 2025-12-17 18:37:12,352 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-17 18:37:12,352 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc 2025-12-17 18:37:12,353 - root - INFO - Clearing user context 2025-12-17 18:37:14,697 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:37:14,697 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:37:14,697 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:37:14,697 - root - INFO - Clearing user context 2025-12-17 18:37:14,697 - root - INFO - User context cleared before authentication 2025-12-17 18:37:14,697 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:37:14,698 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:37:14,698 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:14,698 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:37:14,698 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:37:14,699 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:37:14,699 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:37:14,699 - root - INFO - Looking for user with username: admin 2025-12-17 18:37:14,699 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:37:14,699 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:37:14,699 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:37:14,701 - root - INFO - Clearing user context 2025-12-17 18:41:59,619 - root - INFO - Shutting down TH-Agenter application... 2025-12-17 18:42:01,730 - root - INFO - Logging configured successfully 2025-12-17 18:42:01,817 - root - INFO - Logging configured successfully 2025-12-17 18:42:01,897 - root - INFO - Starting up TH-Agenter application... 2025-12-17 18:42:01,902 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 18:42:01,904 - root - INFO - Database tables created 2025-12-17 18:42:01,904 - root - INFO - Database initialized 2025-12-17 18:42:56,538 - root - INFO - Shutting down TH-Agenter application... 2025-12-17 18:43:18,569 - root - INFO - Logging configured successfully 2025-12-17 18:43:18,656 - root - INFO - Logging configured successfully 2025-12-17 18:43:18,736 - root - INFO - Starting up TH-Agenter application... 2025-12-17 18:43:18,741 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 18:43:18,743 - root - INFO - Database tables created 2025-12-17 18:43:18,744 - root - INFO - Database initialized 2025-12-17 18:44:27,795 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 18:44:27,796 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:27,796 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 18:44:27,796 - root - INFO - Clearing user context 2025-12-17 18:44:27,796 - root - INFO - User context cleared before authentication 2025-12-17 18:44:27,796 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:27,813 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:27,813 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:27,813 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:27,814 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:27,815 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:27,815 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:27,815 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:27,815 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:27,816 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:27,816 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:27,818 - root - INFO - Clearing user context 2025-12-17 18:44:27,830 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-17 18:44:27,831 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:27,831 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-17 18:44:27,831 - root - INFO - Clearing user context 2025-12-17 18:44:27,831 - root - INFO - User context cleared before authentication 2025-12-17 18:44:27,831 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:27,831 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:27,831 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:27,831 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:27,831 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:27,832 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:27,833 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:27,833 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:27,833 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:27,833 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:27,833 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:27,835 - root - INFO - Clearing user context 2025-12-17 18:44:28,386 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 18:44:28,386 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:28,387 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 18:44:28,387 - root - INFO - Clearing user context 2025-12-17 18:44:28,387 - root - INFO - User context cleared before authentication 2025-12-17 18:44:28,387 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:28,390 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:28,390 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:28,391 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:28,391 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:28,395 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 18:44:28,396 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:28,396 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 18:44:28,396 - root - INFO - Clearing user context 2025-12-17 18:44:28,396 - root - INFO - User context cleared before authentication 2025-12-17 18:44:28,397 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:28,399 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:28,400 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:28,400 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:28,400 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:28,409 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:28,415 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:28,419 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:28,424 - root - INFO - Clearing user context 2025-12-17 18:44:28,426 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:28,426 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:28,427 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:28,449 - root - INFO - Clearing user context 2025-12-17 18:44:28,449 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-17 18:44:28,449 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:28,449 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-17 18:44:28,449 - root - INFO - Clearing user context 2025-12-17 18:44:28,449 - root - INFO - User context cleared before authentication 2025-12-17 18:44:28,449 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:28,450 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:28,450 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:28,450 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:28,450 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:28,452 - root - INFO - Clearing user context 2025-12-17 18:44:33,491 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:44:33,491 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:33,491 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:44:33,492 - root - INFO - Clearing user context 2025-12-17 18:44:33,492 - root - INFO - User context cleared before authentication 2025-12-17 18:44:33,492 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:33,495 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:33,495 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:33,495 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:33,495 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:33,496 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:33,496 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:33,496 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:33,497 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:33,497 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:33,497 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:33,499 - root - INFO - Clearing user context 2025-12-17 18:44:39,274 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/13 2025-12-17 18:44:39,274 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/13 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:39,274 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/13 2025-12-17 18:44:39,275 - root - INFO - Clearing user context 2025-12-17 18:44:39,275 - root - INFO - User context cleared before authentication 2025-12-17 18:44:39,275 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:39,278 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:39,278 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:39,278 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:39,278 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:39,279 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:39,279 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:39,279 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:39,280 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:39,280 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:39,280 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:39,282 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc 2025-12-17 18:44:39,285 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-17 18:44:39,395 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-17 18:44:39,396 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-17 18:44:39,434 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=13 2025-12-17 18:44:39,434 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=13 2025-12-17 18:44:39,465 - th_agenter.services.document - INFO - Deleted document: dd1eceb3-950e-4b9b-9556-3cc153215747_testdoc1.doc (ID: 13) 2025-12-17 18:44:39,465 - root - INFO - Clearing user context 2025-12-17 18:44:39,511 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:44:39,512 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:39,512 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:44:39,512 - root - INFO - Clearing user context 2025-12-17 18:44:39,512 - root - INFO - User context cleared before authentication 2025-12-17 18:44:39,512 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:39,513 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:39,513 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:39,513 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:39,513 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:39,513 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:39,513 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:39,513 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:39,514 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:39,514 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:39,514 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:39,515 - root - INFO - Clearing user context 2025-12-17 18:44:44,580 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-17 18:44:44,580 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:44,581 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:44:44,581 - root - INFO - Clearing user context 2025-12-17 18:44:44,581 - root - INFO - User context cleared before authentication 2025-12-17 18:44:44,582 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:44,584 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:44,585 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:44,585 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:44,585 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:44,587 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:44,587 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:44,587 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:44,587 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:44,588 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:44,588 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:44,603 - th_agenter.services.document - INFO - Uploaded document: testdoc1.doc to KB 7 (Doc ID: 13) 2025-12-17 18:44:44,605 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 13, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc 2025-12-17 18:44:44,605 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc 2025-12-17 18:44:44,605 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc 2025-12-17 18:44:44,605 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-17 18:44:44,606 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc, 页数: 1 2025-12-17 18:44:45,530 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-17 18:44:45,538 - th_agenter.services.document_processor - INFO - 语义分析得到 1 个分割点 2025-12-17 18:44:45,538 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-17 18:44:45,538 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc 2025-12-17 18:44:45,541 - root - INFO - Clearing user context 2025-12-17 18:44:47,896 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:44:47,897 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:44:47,897 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:44:47,898 - root - INFO - Clearing user context 2025-12-17 18:44:47,898 - root - INFO - User context cleared before authentication 2025-12-17 18:44:47,898 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:44:47,902 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:44:47,902 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:47,903 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:44:47,903 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:44:47,906 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:44:47,907 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:44:47,907 - root - INFO - Looking for user with username: admin 2025-12-17 18:44:47,910 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:44:47,910 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:44:47,911 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:44:47,919 - root - INFO - Clearing user context 2025-12-17 18:45:00,685 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-17 18:45:00,685 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:45:00,685 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:45:00,685 - root - INFO - Clearing user context 2025-12-17 18:45:00,685 - root - INFO - User context cleared before authentication 2025-12-17 18:45:00,685 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:45:00,686 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:45:00,686 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:45:00,686 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:45:00,686 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:45:00,687 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:45:00,687 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:45:00,687 - root - INFO - Looking for user with username: admin 2025-12-17 18:45:00,688 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:45:00,688 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:45:00,688 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:45:00,712 - th_agenter.services.document - INFO - Uploaded document: testdoc.doc to KB 7 (Doc ID: 14) 2025-12-17 18:45:00,714 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 14, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc 2025-12-17 18:45:00,714 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc 2025-12-17 18:45:00,714 - th_agenter.services.document_processor - INFO - 使用doc2txt.process处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc 2025-12-17 18:45:00,714 - th_agenter.services.document_processor - ERROR - 使用doc2txt加载.doc文档失败: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc, 错误: module 'doc2txt' has no attribute 'process' 2025-12-17 18:45:00,715 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc, 页数: 1 2025-12-17 18:45:02,021 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-17 18:45:02,022 - th_agenter.services.document_processor - INFO - 语义分析得到 1 个分割点 2025-12-17 18:45:02,022 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 0 个文档块 2025-12-17 18:45:02,022 - th_agenter.services.document_processor - WARNING - 文档分割后无内容: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc 2025-12-17 18:45:02,023 - root - INFO - Clearing user context 2025-12-17 18:45:04,369 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 18:45:04,370 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 18:45:04,370 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 18:45:04,370 - root - INFO - Clearing user context 2025-12-17 18:45:04,371 - root - INFO - User context cleared before authentication 2025-12-17 18:45:04,371 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 18:45:04,374 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 18:45:04,374 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:45:04,374 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 18:45:04,374 - root - INFO - Verified current user ID in context: 2 2025-12-17 18:45:04,375 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 18:45:04,375 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 18:45:04,375 - root - INFO - Looking for user with username: admin 2025-12-17 18:45:04,376 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 18:45:04,376 - root - INFO - Verification - ContextVar user: admin 2025-12-17 18:45:04,376 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 18:45:04,377 - root - INFO - Clearing user context 2025-12-17 18:45:16,659 - root - INFO - Shutting down TH-Agenter application... 2025-12-17 19:05:22,150 - root - INFO - Logging configured successfully 2025-12-17 19:05:22,238 - root - INFO - Logging configured successfully 2025-12-17 19:05:22,318 - root - INFO - Starting up TH-Agenter application... 2025-12-17 19:05:22,326 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 19:05:22,328 - root - INFO - Database tables created 2025-12-17 19:05:22,328 - root - INFO - Database initialized 2025-12-17 19:07:04,473 - root - INFO - Shutting down TH-Agenter application... 2025-12-17 19:07:06,556 - root - INFO - Logging configured successfully 2025-12-17 19:07:06,641 - root - INFO - Logging configured successfully 2025-12-17 19:07:06,720 - root - INFO - Starting up TH-Agenter application... 2025-12-17 19:07:06,726 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 19:07:06,727 - root - INFO - Database tables created 2025-12-17 19:07:06,728 - root - INFO - Database initialized 2025-12-17 19:08:34,336 - root - INFO - Shutting down TH-Agenter application... 2025-12-17 19:08:38,804 - root - INFO - Logging configured successfully 2025-12-17 19:08:38,890 - root - INFO - Logging configured successfully 2025-12-17 19:08:38,968 - root - INFO - Starting up TH-Agenter application... 2025-12-17 19:08:38,974 - root - INFO - SQLite database engine created: sqlite:///./TH-Agenter.db 2025-12-17 19:08:38,976 - root - INFO - Database tables created 2025-12-17 19:08:38,976 - root - INFO - Database initialized 2025-12-17 19:08:55,582 - root - INFO - [MIDDLEWARE] Processing request: GET /api/auth/me 2025-12-17 19:08:55,582 - root - INFO - [MIDDLEWARE] Checking path: /api/auth/me against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:55,582 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/auth/me 2025-12-17 19:08:55,582 - root - INFO - Clearing user context 2025-12-17 19:08:55,582 - root - INFO - User context cleared before authentication 2025-12-17 19:08:55,582 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:55,598 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:55,598 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:55,598 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:55,598 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:55,600 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:08:55,600 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:08:55,600 - root - INFO - Looking for user with username: admin 2025-12-17 19:08:55,600 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:08:55,600 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:55,601 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:08:55,603 - root - INFO - Clearing user context 2025-12-17 19:08:55,675 - root - INFO - [MIDDLEWARE] Processing request: GET /api/admin/roles/user-roles/user/2 2025-12-17 19:08:55,675 - root - INFO - [MIDDLEWARE] Checking path: /api/admin/roles/user-roles/user/2 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:55,675 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/admin/roles/user-roles/user/2 2025-12-17 19:08:55,675 - root - INFO - Clearing user context 2025-12-17 19:08:55,675 - root - INFO - User context cleared before authentication 2025-12-17 19:08:55,675 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:55,676 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:55,676 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:55,676 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:55,676 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:55,677 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:08:55,678 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:08:55,678 - root - INFO - Looking for user with username: admin 2025-12-17 19:08:55,678 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:08:55,678 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:55,678 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:08:55,681 - root - INFO - Clearing user context 2025-12-17 19:08:56,161 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/ 2025-12-17 19:08:56,161 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/ against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:56,161 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/ 2025-12-17 19:08:56,161 - root - INFO - Clearing user context 2025-12-17 19:08:56,161 - root - INFO - User context cleared before authentication 2025-12-17 19:08:56,161 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:56,162 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:56,162 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:56,162 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:56,162 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:56,164 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations 2025-12-17 19:08:56,164 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:56,164 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations 2025-12-17 19:08:56,164 - root - INFO - Clearing user context 2025-12-17 19:08:56,164 - root - INFO - User context cleared before authentication 2025-12-17 19:08:56,164 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:56,165 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:56,165 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:56,165 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:56,165 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:56,169 - root - INFO - Clearing user context 2025-12-17 19:08:56,170 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:08:56,170 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:08:56,170 - root - INFO - Looking for user with username: admin 2025-12-17 19:08:56,171 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:08:56,171 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:56,171 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:08:56,181 - root - INFO - Clearing user context 2025-12-17 19:08:56,182 - root - INFO - [MIDDLEWARE] Processing request: GET /api/chat/conversations/count 2025-12-17 19:08:56,182 - root - INFO - [MIDDLEWARE] Checking path: /api/chat/conversations/count against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:56,182 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/chat/conversations/count 2025-12-17 19:08:56,182 - root - INFO - Clearing user context 2025-12-17 19:08:56,182 - root - INFO - User context cleared before authentication 2025-12-17 19:08:56,182 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:56,183 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:56,183 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:56,183 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:56,183 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:56,185 - root - INFO - Clearing user context 2025-12-17 19:08:58,273 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 19:08:58,274 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:08:58,274 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 19:08:58,274 - root - INFO - Clearing user context 2025-12-17 19:08:58,275 - root - INFO - User context cleared before authentication 2025-12-17 19:08:58,275 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:08:58,276 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:08:58,276 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:58,276 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:08:58,276 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:08:58,277 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:08:58,277 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:08:58,277 - root - INFO - Looking for user with username: admin 2025-12-17 19:08:58,277 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:08:58,277 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:08:58,277 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:08:58,280 - root - INFO - Clearing user context 2025-12-17 19:09:02,622 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/14 2025-12-17 19:09:02,622 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/14 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:02,622 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/14 2025-12-17 19:09:02,623 - root - INFO - Clearing user context 2025-12-17 19:09:02,623 - root - INFO - User context cleared before authentication 2025-12-17 19:09:02,623 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:02,624 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:02,624 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:02,624 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:02,625 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:02,626 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:02,626 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:02,626 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:02,626 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:02,626 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:02,626 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:02,628 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc 2025-12-17 19:09:02,630 - th_agenter.embedding_factory - INFO - Creating embeddings with provider: zhipu, model: embedding-3 2025-12-17 19:09:02,733 - th_agenter.zhipu_embeddings - INFO - ZhipuOpenAI Embeddings initialized with model: embedding-3 2025-12-17 19:09:02,734 - th_agenter.services.document_processor - INFO - PGVector连接池已初始化: 192.168.10.11:5432 2025-12-17 19:09:02,772 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=14 2025-12-17 19:09:02,772 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=14 2025-12-17 19:09:02,795 - th_agenter.services.document - INFO - Deleted document: 3904a2d0-e378-4609-94e7-8ce5471832b8_testdoc.doc (ID: 14) 2025-12-17 19:09:02,795 - root - INFO - Clearing user context 2025-12-17 19:09:02,885 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 19:09:02,885 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:02,886 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 19:09:02,886 - root - INFO - Clearing user context 2025-12-17 19:09:02,886 - root - INFO - User context cleared before authentication 2025-12-17 19:09:02,886 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:02,889 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:02,890 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:02,890 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:02,890 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:02,892 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:02,893 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:02,893 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:02,896 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:02,896 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:02,897 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:02,903 - root - INFO - Clearing user context 2025-12-17 19:09:04,786 - root - INFO - [MIDDLEWARE] Processing request: DELETE /api/knowledge-bases/7/documents/13 2025-12-17 19:09:04,786 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents/13 against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:04,786 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents/13 2025-12-17 19:09:04,787 - root - INFO - Clearing user context 2025-12-17 19:09:04,787 - root - INFO - User context cleared before authentication 2025-12-17 19:09:04,787 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:04,789 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:04,789 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:04,789 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:04,789 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:04,789 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:04,790 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:04,790 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:04,790 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:04,790 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:04,790 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:04,791 - th_agenter.services.document - INFO - Deleted file: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc 2025-12-17 19:09:04,830 - th_agenter.services.document_processor - WARNING - 未找到要删除的文档ID: document_id=13 2025-12-17 19:09:04,831 - th_agenter.services.document_processor - INFO - 文档已从PostgreSQL pgvector存储中删除: document_id=13 2025-12-17 19:09:04,847 - th_agenter.services.document - INFO - Deleted document: 8de50626-00ef-4b31-9928-7ede181ad074_testdoc1.doc (ID: 13) 2025-12-17 19:09:04,848 - root - INFO - Clearing user context 2025-12-17 19:09:05,192 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 19:09:05,192 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:05,192 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 19:09:05,192 - root - INFO - Clearing user context 2025-12-17 19:09:05,192 - root - INFO - User context cleared before authentication 2025-12-17 19:09:05,192 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:05,193 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:05,193 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:05,193 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:05,193 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:05,194 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:05,194 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:05,194 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:05,195 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:05,195 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:05,195 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:05,196 - root - INFO - Clearing user context 2025-12-17 19:09:09,139 - root - INFO - [MIDDLEWARE] Processing request: POST /api/knowledge-bases/7/documents 2025-12-17 19:09:09,140 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:09,140 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 19:09:09,140 - root - INFO - Clearing user context 2025-12-17 19:09:09,140 - root - INFO - User context cleared before authentication 2025-12-17 19:09:09,141 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:09,142 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:09,142 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:09,143 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:09,143 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:09,148 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:09,149 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:09,149 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:09,151 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:09,151 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:09,152 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:09,185 - th_agenter.services.document - INFO - Uploaded document: testdoc.doc to KB 7 (Doc ID: 13) 2025-12-17 19:09:09,192 - th_agenter.services.document_processor - INFO - 开始处理文档 ID: 13, 路径: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/a5fb94a0-dc86-495f-af2b-b288e4b06362_testdoc.doc 2025-12-17 19:09:09,193 - th_agenter.services.document_processor - WARNING - 检测到.doc格式文件,尝试使用doc2txt加载: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/a5fb94a0-dc86-495f-af2b-b288e4b06362_testdoc.doc 2025-12-17 19:09:09,193 - th_agenter.services.document_processor - INFO - 使用doc2txt.extract_text处理.doc文件: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/a5fb94a0-dc86-495f-af2b-b288e4b06362_testdoc.doc 2025-12-17 19:09:09,213 - th_agenter.services.document_processor - INFO - .doc文件处理完成,获取到文本长度: 5134 字符 2025-12-17 19:09:09,213 - th_agenter.services.document_processor - INFO - 成功加载文档: /home/thsw2/jcq/workspace/HXF/backend/data/uploads/kb_7/a5fb94a0-dc86-495f-af2b-b288e4b06362_testdoc.doc, 页数: 1 2025-12-17 19:09:20,076 - httpx - INFO - HTTP Request: POST https://ark.cn-beijing.volces.com/api/v3/chat/completions "HTTP/1.1 200 OK" 2025-12-17 19:09:20,104 - th_agenter.services.document_processor - INFO - 语义分析得到 47 个分割点 2025-12-17 19:09:20,105 - th_agenter.services.document_processor - INFO - 文档分割完成,共生成 17 个文档块 2025-12-17 19:09:20,435 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:20,586 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:20,715 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:20,862 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,008 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,135 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,240 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,393 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,525 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,648 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,778 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:21,883 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,002 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,111 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,205 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,344 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,489 - httpx - INFO - HTTP Request: POST https://open.bigmodel.cn/api/paas/v4/embeddings "HTTP/1.1 200 OK" 2025-12-17 19:09:22,657 - th_agenter.services.document_processor - INFO - 文档已添加到PostgreSQL pgvector存储: embeddings_kb_7 2025-12-17 19:09:22,672 - th_agenter.services.document_processor - INFO - 文档处理完成: {'document_id': 13, 'status': 'success', 'chunks_count': 17, 'message': '文档处理完成'} 2025-12-17 19:09:22,686 - th_agenter.services.document - INFO - Processed document: a5fb94a0-dc86-495f-af2b-b288e4b06362_testdoc.doc (ID: 13) 2025-12-17 19:09:22,688 - root - INFO - Clearing user context 2025-12-17 19:09:25,025 - root - INFO - [MIDDLEWARE] Processing request: GET /api/knowledge-bases/7/documents 2025-12-17 19:09:25,025 - root - INFO - [MIDDLEWARE] Checking path: /api/knowledge-bases/7/documents against exclude_paths: ['/docs', '/redoc', '/openapi.json', '/api/auth/login', '/api/auth/register', '/api/auth/login-oauth', '/auth/login', '/auth/register', '/auth/login-oauth', '/health', '/test'] 2025-12-17 19:09:25,026 - root - INFO - [MIDDLEWARE] Processing authenticated request: /api/knowledge-bases/7/documents 2025-12-17 19:09:25,026 - root - INFO - Clearing user context 2025-12-17 19:09:25,026 - root - INFO - User context cleared before authentication 2025-12-17 19:09:25,026 - root - INFO - Authorization header received: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTc2NTk4NTc2NX0.nfXHwiXXmdZC1erm5nJU_HwBDnbVb7FaEU52CYn4oeU 2025-12-17 19:09:25,029 - root - INFO - Setting user in context with token: admin (ID: 2) 2025-12-17 19:09:25,029 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:25,029 - root - INFO - User admin (ID: 2) authenticated and set in context 2025-12-17 19:09:25,029 - root - INFO - Verified current user ID in context: 2 2025-12-17 19:09:25,031 - root - INFO - Received token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJhZ... 2025-12-17 19:09:25,031 - root - INFO - Token payload: {'sub': 'admin', 'exp': 1765985765} 2025-12-17 19:09:25,031 - root - INFO - Looking for user with username: admin 2025-12-17 19:09:25,031 - root - INFO - Setting user in context: admin (ID: 2) 2025-12-17 19:09:25,031 - root - INFO - Verification - ContextVar user: admin 2025-12-17 19:09:25,031 - root - INFO - User admin (ID: 2) set in UserContext 2025-12-17 19:09:25,033 - root - INFO - Clearing user context