Commit graph

4368 commits

Author SHA1 Message Date
c9d5bf361a refactor: drive monitor to use postgres instead of json
All checks were successful
BotServer CI/CD / build (push) Successful in 7m19s
2026-04-14 15:31:30 -03:00
45d5a444eb fix: DriveFileRepository compilation errors
All checks were successful
BotServer CI/CD / build (push) Successful in 7m25s
- Add Debug derive for DriveFileRepository
- Clone etag/last_modified for upsert to avoid move errors
- Fix max fail_count query to handle nullable integer
2026-04-14 14:50:47 -03:00
09f4c876b4 Update HTML rendering: buffer chunks and render visual elements only
Some checks failed
BotServer CI/CD / build (push) Failing after 4m19s
2026-04-14 14:39:08 -03:00
73d9531563 fix: buffer HTML chunks to avoid flashing, flush on closing tags
All checks were successful
BotServer CI/CD / build (push) Successful in 8m7s
2026-04-14 14:22:07 -03:00
f06c071b2c fix: drive monitor file state tracking
All checks were successful
BotServer CI/CD / build (push) Successful in 2m55s
2026-04-14 14:05:48 -03:00
32f8a10825 fix: normalize episodic/compact roles to system in all LLM providers
All checks were successful
BotServer CI/CD / build (push) Successful in 4m1s
2026-04-14 13:47:18 -03:00
d6527a438b fix: normalize roles to system for bedrock and vertex LLM providers 2026-04-14 13:44:12 -03:00
f04745ae1c fix: DriveMonitor loop performance and WebSocket blocking
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
- Remove excessive trace/debug logging in hot loops

- Fix broadcast_theme_change lock contention by cloning channels before iterating

- Increase default sleep interval from 10s to 30s

- Remove [MODULE] prefixes from log messages

- Fix PDF re-download bug by using only last_modified (not ETag) for change detection

- Re-enable DriveMonitor in bootstrap (was disabled for testing)
2026-04-14 13:42:23 -03:00
a884c650a3 fix: CI deploy reliability — stop before transfer, enable after, health endpoint fix
All checks were successful
BotServer CI/CD / build (push) Successful in 1m3s
2026-04-14 10:37:23 -03:00
679bf05504 fix: Kimi K2.5 factory + LLM chunk traces
All checks were successful
BotServer CI/CD / build (push) Successful in 4m35s
- Kimi factory: add max_tokens=16384, temperature=1.0, top_p=1.0,
  and chat_template_kwargs.thinking=true for kimi models
- Add chunk count traces in stream_response so we see LLM progress
  immediately in logs: 'LLM chunk #N received (len=X)'
- Keep generic stream parser clean — model-specific logic lives in
  the request builder (Kimi factory pattern)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 10:20:02 -03:00
03f060680e fix: CI git path for BOTSERVER_COMMIT + deploy health check wait
All checks were successful
BotServer CI/CD / build (push) Successful in 4m16s
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 10:01:41 -03:00
d20ecdb89c fix: enterprise-grade reliability — three changes
Some checks failed
BotServer CI/CD / build (push) Failing after 6s
1. CI: restart system container instead of just systemctl restart botserver
   — ensures full env reload, Vault re-auth, DriveMonitor fresh state

2. Health endpoint: add 'commit' field with short git SHA
   — build.rs passes BOTSERVER_COMMIT from CI via rustc-env
   - Both /health and /api/health now report the running commit

3. WebSocket recv_task: spawn stream_response in separate tokio task
   - prevents one hung LLM from freezing all message processing
   - each WebSocket connection can now handle multiple messages
     concurrently regardless of LLM latency

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 09:51:54 -03:00
251ee9e106 chore: disable DriveMonitor temporarily for WebSocket/LLM testing
All checks were successful
BotServer CI/CD / build (push) Successful in 7m30s
DriveMonitor polling may be consuming resources and interfering with
LLM response delivery. Disabling to isolate the chat pipeline.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 09:18:49 -03:00
3159d04414 fix: spawn LLM response in separate task to prevent recv_task blocking
All checks were successful
BotServer CI/CD / build (push) Successful in 5m3s
Previously the recv_task awaited stream_response() directly, which
froze the entire WebSocket message receiver while the LLM ran (30s+).
This meant a second user message couldn't be processed until the
first LLM call finished — a race condition that locked the session.

Now stream_response runs in its own tokio::spawn, keeping recv_task
free to handle new messages immediately. Also fixed borrow/lifetime
issue by cloning the response channel sender out of the lock scope.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-14 08:59:10 -03:00
dc97813614 fix: revert stream timeout that broke message processing
All checks were successful
BotServer CI/CD / build (push) Successful in 4m40s
2026-04-14 02:11:46 -03:00
ed3406dd80 revert: restore working LLM streaming code from 260a13e7
All checks were successful
BotServer CI/CD / build (push) Successful in 11m59s
The recent LLM changes (timeouts, tool call accumulation, extra logging)
broke the WebSocket message flow. Reverting to the known working version.
2026-04-14 01:15:20 -03:00
301a7dda33 Add LLM stream timeout and debug logs
All checks were successful
BotServer CI/CD / build (push) Successful in 4m8s
2026-04-14 00:55:43 -03:00
da9facf036 fix: add 5s connect_timeout to LLM HTTP client so unreachable APIs fail fast
All checks were successful
BotServer CI/CD / build (push) Successful in 3m52s
Without connect_timeout, reqwest can hang for the full 60s timeout
when the remote server is unreachable (DNS, TCP connect, etc.).
Now fails in 5s max for connection issues, 30s for full request.

This means one user's LLM failure no longer blocks new users for
a full minute — the channel closes quickly and the WebSocket is freed.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 23:54:50 -03:00
3ec72f6121 fix: add 60s timeout to OpenAI-compatible HTTP client preventing LLM deadlock
All checks were successful
BotServer CI/CD / build (push) Successful in 4m2s
reqwest::Client::new() has no timeout — when external APIs (NVIDIA,
Groq, etc.) hang or throttle, the request blocks forever, freezing the
entire response pipeline for the user.

Also add std::time::Duration import to llm/mod.rs.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 23:31:12 -03:00
25d6d2fd57 fix: eliminate LLM keyword deadlock with isolated worker thread
All checks were successful
BotServer CI/CD / build (push) Successful in 3m32s
The previous fix used Handle::current().block_on() which deadlocks when
the Rhai engine runs on a Tokio worker thread — it blocks the very
thread the async task needs to make progress.

New approach: spawn a dedicated background thread with its own
single-threaded Tokio runtime, communicate via mpsc channel with a
45s timeout. This completely isolates the LLM runtime from the
caller's runtime, eliminating any possibility of thread starvation
or nested-runtime deadlock.

Also remove unused 'trace' import from llm/mod.rs.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 23:20:10 -03:00
b3fd90b056 fix: remove blocking recv_timeout from LLM keyword
All checks were successful
BotServer CI/CD / build (push) Successful in 3m41s
2026-04-13 23:01:54 -03:00
6468588f58 fix: remove LLM streaming lock that caused deadlocks
All checks were successful
BotServer CI/CD / build (push) Successful in 3m40s
2026-04-13 22:51:29 -03:00
7d911194f3 fix: disable all thinking detection to prevent deadlock
All checks were successful
BotServer CI/CD / build (push) Successful in 3m36s
2026-04-13 22:47:27 -03:00
f48f87cadc debug: add processing traces
All checks were successful
BotServer CI/CD / build (push) Successful in 3m29s
2026-04-13 22:34:27 -03:00
99909de75d fix: disable thinking detection to prevent deadlock
All checks were successful
BotServer CI/CD / build (push) Successful in 3m19s
2026-04-13 22:26:31 -03:00
318d199d6c fix: clear thinking indicator on stream complete
All checks were successful
BotServer CI/CD / build (push) Successful in 3m21s
2026-04-13 22:19:10 -03:00
200b026efe fix: add thinking indicator and 30s timeout to prevent deadlock
All checks were successful
BotServer CI/CD / build (push) Successful in 3m16s
2026-04-13 21:40:50 -03:00
3ddcc5a1d1 fix: simplify MinimaxHandler without regex
All checks were successful
BotServer CI/CD / build (push) Successful in 3m17s
2026-04-13 21:35:41 -03:00
6acf5fb4c0 fix: add reasoning_split=false to Minimax API calls
All checks were successful
BotServer CI/CD / build (push) Successful in 3m8s
2026-04-13 21:22:02 -03:00
2c82a8bd2e fix: add MinimaxHandler to strip thinking tags from content
All checks were successful
BotServer CI/CD / build (push) Successful in 4m8s
2026-04-13 21:17:01 -03:00
ea8857ec8a debug: trace LLM delta content for Minimax
All checks were successful
BotServer CI/CD / build (push) Successful in 4m7s
2026-04-13 21:08:46 -03:00
22e94f32ed fix: filter reasoning when content exists (Minimax/GLM/Kimi)
All checks were successful
BotServer CI/CD / build (push) Successful in 3m57s
2026-04-13 20:58:58 -03:00
850db4b588 fix: add missing debug import
All checks were successful
BotServer CI/CD / build (push) Successful in 3m16s
2026-04-13 20:51:18 -03:00
650cb70961 debug: add WebSocket message tracing
Some checks failed
BotServer CI/CD / build (push) Failing after 4m10s
2026-04-13 20:46:28 -03:00
517d5435a9 fix: add max_tokens 131072 to OpenAI provider for minimax
All checks were successful
BotServer CI/CD / build (push) Successful in 4m25s
2026-04-13 20:26:03 -03:00
1b040a4278 fix: kimi stream - handle channel close, add parse error trace, fix buffer handling
All checks were successful
BotServer CI/CD / build (push) Successful in 3m27s
2026-04-13 19:59:00 -03:00
79997fc3b3 fix: kimi max_tokens 131072, add stream traces, content chars tracking
All checks were successful
BotServer CI/CD / build (push) Successful in 4m12s
2026-04-13 19:42:31 -03:00
4d9d38ffda fix: enable chat_template_kwargs for GLM thinking mode, add stream traces, fix config_manager scope
All checks were successful
BotServer CI/CD / build (push) Successful in 3m55s
2026-04-13 19:23:19 -03:00
d6ffe265ef fix: GLM max_tokens 131072, disable thinking kwargs - model sends content after reasoning naturally
All checks were successful
BotServer CI/CD / build (push) Successful in 3m11s
2026-04-13 18:52:02 -03:00
c9fa057203 fix: TOOL_EXEC uses correct MessageType constant from botlib, not enums
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 18:43:14 -03:00
87df733db0 fix: GLM client - add chat_template_kwargs, handle reasoning_content, increase max_tokens to 16384
All checks were successful
BotServer CI/CD / build (push) Successful in 5m52s
2026-04-13 18:33:16 -03:00
8a65afbfc5 feat: add [BASIC_EXEC] traces for start, tool, scheduler, webhook execution
All checks were successful
BotServer CI/CD / build (push) Successful in 3m18s
2026-04-13 18:16:01 -03:00
99572f0dc5 fix: ensure websocket_session_id and channel context are set before tool execution so TALK can route messages to frontend
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 18:04:02 -03:00
5a24137a5b fix: remove extra_body param from GLM client - NVIDIA API rejects it
All checks were successful
BotServer CI/CD / build (push) Successful in 5m58s
2026-04-13 17:57:02 -03:00
81c60ceb25 feat: add Kimi client and GLM thinking mode support, fix tool exec direct return
All checks were successful
BotServer CI/CD / build (push) Successful in 6m22s
2026-04-13 17:36:31 -03:00
e48b5610db fix: prevent KB re-download loop when file_states fails to load
All checks were successful
BotServer CI/CD / build (push) Successful in 3m28s
- Add fallback: skip files from indexed KB folders even when file_states is empty
- Add file_states_count to debug log to detect load failures
- Add indexed_kb_names set for quick KB folder lookup
- This prevents the infinite download loop when file_states.json fails to deserialize

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 16:26:12 -03:00
60fd3dbbc4 fix: handle both reasoning_content and reasoning fields for NVIDIA API
All checks were successful
BotServer CI/CD / build (push) Successful in 3m12s
2026-04-13 16:21:05 -03:00
8ddcde4830 fix: detect NVIDIA API as GLM provider, handle full URL path
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
2026-04-13 16:18:00 -03:00
32fbdb4b17 fix: detect new PDFs in already-indexed KB folders
All checks were successful
BotServer CI/CD / build (push) Successful in 3m11s
- Don't skip entire GBKB scan when all KBs are indexed
- Instead, skip individual files that are already tracked (not new)
- This allows new PDFs added to existing KB folders to be detected and indexed

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 16:03:22 -03:00
6d987c0eea feat: add ADD_SWITCHER keyword with underscore preprocessing
All checks were successful
BotServer CI/CD / build (push) Successful in 3m25s
Implement ADD_SWITCHER keyword following the same pattern as ADD_SUGGESTION_TOOL:
- Created switcher.rs module with add_switcher_keyword() and clear_switchers_keyword()
- Added preprocessing to convert "ADD SWITCHER" to "ADD_SWITCHER"
- Added to keyword patterns and get_all_keywords()
- Stores switcher suggestions in Redis with type "switcher" and action "switch_context"
- Supports both "ADD SWITCHER" and "ADD_SWITCHER" syntax

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-13 15:47:21 -03:00