Replace all print()/stderr logging with Python logging module using
logger = logging.getLogger(__name__) pattern for consistent log levels
and formatting. Extract score conversion to shared score_utils module.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Auto-create system KBs from data/knowledge_base/ subdirectories on startup
- Upgrade existing user KBs to system KBs when matching directory found
- Admin can upload to system KBs (saved to knowledge_base dir)
- Regular users see only their own KBs on knowledge page
- Fix API permission checks for system KBs (list, detail, documents, update, delete)
- Add is_superuser to UserResponse and frontend User type
- Fix sidebar session menu visibility for long titles
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Fix knowledge_base_service calling async process_document synchronously
in background threads — use asyncio.new_event_loop().run_until_complete()
instead of bare call that returned unawaited coroutine
- Same fix for _update_document and reindex_document
- Replace ModeSelector with auto-detect: RAG mode when knowledge bases selected
- Convert regenerateMessage to streaming (was synchronous API call)
- Show "知识库检索模式" indicator above input when KB selected
- Remove loadSessions side-effect from streaming onComplete
- Fix chat page loading state to avoid flash
- Improve forum page spacing and sizing
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>