Commit graph

4345 commits

Author SHA1 Message Date
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
498c771d7b feat: add thinking indicator for reasoning models (GLM4.7, Kimi K2.5)
All checks were successful
BotServer CI/CD / build (push) Successful in 3m27s
- Show thinking indicator while LLM is in reasoning mode
- Skip reasoning content (thinking text) from user response
- Only show actual HTML content after thinking ends

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 15:35:22 -03:00
3e99235a49 fix: support reasoning models (GLM4.7, Kimi K2.5) - use reasoning_content when content is null
All checks were successful
BotServer CI/CD / build (push) Successful in 3m19s
- GLM4.7 and Kimi K2.5 send response in 'reasoning_content' field, 'content' is null
- Prefer 'content' for normal models, fallback to 'reasoning_content' for reasoning models
- Fixes blank white screen when using z-ai/glm4.7 model

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 15:18:21 -03:00
c5d30adebe revert: restore llm/mod.rs to stable April 9 version
All checks were successful
BotServer CI/CD / build (push) Successful in 3m26s
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 15:07:19 -03:00
765bd624f4 fix: use Redis SADD instead of RPUSH for suggestions to prevent duplicate buttons
All checks were successful
BotServer CI/CD / build (push) Successful in 3m11s
SADD stores suggestions in a set (deduplicated) instead of a list (accumulates).
get_suggestions now uses SMEMBERS instead of LRANGE. Removed the TODO about
clearing suggestions since SADD inherently prevents duplicates.
2026-04-13 14:09:57 -03:00
f8b47d1ac2 refactor: unify BASIC compilation into BasicCompiler only, runtime uses ScriptService::run() on pre-compiled .ast
Some checks failed
BotServer CI/CD / build (push) Has been cancelled
- Move all preprocessing transforms (convert_multiword_keywords, preprocess_llm_keyword,
  convert_while_wend_syntax, predeclare_variables) into BasicCompiler::preprocess_basic
  so .ast files are fully preprocessed by Drive Monitor
- Replace ScriptService compile/compile_preprocessed/compile_tool_script with
  single run(ast_content) that does engine.compile() + eval_ast_with_scope()
- Remove .bas fallback in tool_executor and start.bas paths - .ast only
- Remove dead code: preprocess_basic_script, normalize_variables_to_lowercase,
  convert_save_for_tools, parse_save_parts, normalize_word
- Fix: USE KB 'cartas' in tool .ast now correctly converted to USE_KB('cartas')
  during compilation, ensuring KB context injection works after tool execution
- Fix: add trace import in llm/mod.rs
2026-04-13 14:05:55 -03:00
723407cfd6 fix: add 60s timeout to LLM stream reads and add concurrent scan guard
All checks were successful
BotServer CI/CD / build (push) Successful in 3m53s
- Add tokio timeout to SSE stream reads in OpenAI client (60s)
- Prevents indefinite hang when Kimi/Nvidia stops responding
- Add scanning AtomicBool to prevent concurrent check_gbkb_changes calls
- Skip GBKB scan entirely when all KBs already indexed in Qdrant

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 12:58:11 -03:00
c1df15eb48 fix: skip GBKB scan when all KBs already indexed in Qdrant
All checks were successful
BotServer CI/CD / build (push) Successful in 3m39s
- Check kb_indexed_folders before acquiring file_states write lock
- Eliminates deadlock from concurrent check_gbkb_changes calls
- Prevents unnecessary PDF re-downloads every 10 seconds
- Removes debug logging, adds clean early-return

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 12:22:11 -03:00
326305d55e debug: add LLM output traces to diagnose blank HTML rendering issue
All checks were successful
BotServer CI/CD / build (push) Successful in 4m0s
- Log full LLM response preview (500 chars) with has_html detection
- Log WebSocket send with message type, completeness, and content preview
- Use clone() for chunk in BotResponse to ensure accurate logging

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 11:57:43 -03:00
d1652fc413 feat: add build_date to health endpoint for CI deploy verification
All checks were successful
BotServer CI/CD / build (push) Successful in 4m21s
- Add BOTSERVER_BUILD_DATE env var to /api/health response
- Set build date during CI compilation via environment variable
- Enables checking deployed binary age without SSH access

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 11:49:10 -03:00
4fb626399d fix: prevent infinite KB reindexing loop by using last_modified as primary change detector
All checks were successful
BotServer CI/CD / build (push) Successful in 4m2s
- Use last_modified timestamp instead of ETag for change detection
- Skip re-queueing KBs that are already indexed in Qdrant
- Preserve indexed status across scans when content unchanged
- Add normalize_etag helper for consistent ETag comparison

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 11:24:37 -03:00
e98dc47ea1 fix: TOOL_EXEC with USE KB now falls through to LLM pipeline for KB-injected response
All checks were successful
BotServer CI/CD / build (push) Successful in 3m50s
When a tool button like Cartas activates a KB via USE KB, instead of
returning just the tool result (empty/label), the handler now checks
if session has active KBs. If so and result is empty/trivial,
falls through to the full LLM pipeline which injects KB context.
2026-04-13 10:02:47 -03:00
1f77d7f099 fix: skip KB re-indexing when kb_collections already has docs, prevents vector DB loop
All checks were successful
BotServer CI/CD / build (push) Successful in 4m5s
2026-04-13 09:53:25 -03:00
86939c17d8 fix: stop KB re-indexing every cycle, add kb_indexed_folders tracking
All checks were successful
BotServer CI/CD / build (push) Successful in 6m13s
- Add kb_indexed_folders set to track successfully indexed KB folders
- Skip re-queuing KB for indexing if already indexed and files unchanged
- Remove kb_key from indexed set when files change (forces re-index)
- Clear indexed set on KB folder deletion
- Fix hardcoded salesianos in drive_monitor prompt key (from previous commit)
2026-04-13 09:37:15 -03:00
dd68cdbe6c fix: remove hardcoded salesianos, strip think tags globally, block reasoning_content leak
All checks were successful
BotServer CI/CD / build (push) Successful in 6m38s
- drive_monitor: replace hardcoded salesianos.gbot with dynamic bot_name
- llm/mod.rs: stop falling back to reasoning_content as content
- llm/claude.rs: same fix for Claude handler
- deepseek_r3: export strip_think_tags for reuse
- gpt_oss_20b: use strip_think_tags so all models strip tags
- gpt_oss_120b: use strip_think_tags so all models strip tags
2026-04-13 09:04:22 -03:00
dbec0df923 fix: DriveMonitor config.csv sync uses Last-Modified in addition to ETag
All checks were successful
BotServer CI/CD / build (push) Successful in 5m46s
ETag in MinIO is an MD5 content hash, so re-uploading the same content
preserves the ETag. Add last_modified comparison so config.csv changes
that don't alter content hash still get synced. Also fixes EmbeddingConfig
fallback from previous commit.
2026-04-13 08:33:37 -03:00
1148069652 fix: EmbeddingConfig::from_bot_config fallback to default bot config
All checks were successful
BotServer CI/CD / build (push) Successful in 6m9s
When a bot lacks embedding-url in its own config, from_bot_config now
falls back to the default bot's config via ConfigManager::get_config.
Previously it returned empty string, causing embedding server connection
failures for bots without explicit embedding configuration.
2026-04-13 08:19:42 -03:00
782618e265 fix: ADD_SUGGESTION compilation error - AS keyword case mismatch
All checks were successful
BotServer CI/CD / build (push) Successful in 2m50s
Root cause: compiler converts AS -> as (lowercase keywords) but Rhai
custom syntax expected uppercase 'AS'. Rhai syntax is case-sensitive.

Changed:
- ADD_SUGGESTION_TOOL: 'AS' -> 'as'
- ADD_SUGGESTION_TEXT: 'AS' -> 'as'
- ADD_SUGGESTION: 'AS' -> 'as'

This fixes: 'Syntax error: Expecting AS for ADD_SUGGESTION_TOOL expression'

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-13 07:40:16 -03:00
666acb9360 fix: DEADLOCK in check_gbkb_changes - removed nested file_states read lock
All checks were successful
BotServer CI/CD / build (push) Successful in 3m44s
Root cause: file_states.write().await was held while trying to acquire
file_states.read().await for KB backoff check. Tokio RwLock is not
reentrant - this caused permanent deadlock.

Fix: Removed the file_states.read() backoff check. KB processor now
just checks files_being_indexed set and queues to pending_kb_index.
Backoff is handled by the KB processor itself based on fail_count.

This fixes salesianos DriveMonitor hanging for 5+ minutes every cycle.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 22:28:02 -03:00
3322234712 debug: add logging to track check_gbkb_changes hang
All checks were successful
BotServer CI/CD / build (push) Successful in 3m40s
Added debug logging at key points in check_gbkb_changes:
- ENTER with bot ID and prefix
- Object listing results
- File states lock acquisition
- New/modified file detection
- PDF detection
- File download batches
- Final remaining files download
- EXIT confirmation

This will help identify exactly where the 5-minute timeout occurs.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 22:09:38 -03:00
8e539206d4 fix: KB processor works with and without llm/research features
All checks were successful
BotServer CI/CD / build (push) Successful in 3m55s
- Added stub start_kb_processor() for non-llm builds
- Added _pending_kb_index field for non-llm builds
- Extracted KB processor logic into start_kb_processor_inner()
- Removed unused is_embedding_server_ready import

This ensures DriveMonitor compiles and runs correctly in production
where CI builds without --features llm.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 21:40:06 -03:00
112ac51da3 fix: KB processor runs as background task, no longer blocks check_for_changes
All checks were successful
BotServer CI/CD / build (push) Successful in 3m50s
- Added start_kb_processor() method: long-running background task per bot
- check_gbkb_changes now queues KB folders to pending_kb_index (non-blocking)
- KB processor polls pending_kb_index and processes one at a time per bot
- Removed inline tokio::spawn from check_gbkb_changes that was causing 5min timeouts
- Added pending_kb_index field to DriveMonitor struct

This fixes salesianos DriveMonitor timeout - check_for_changes now completes
in seconds instead of hanging on KB embedding/indexing.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 21:28:03 -03:00
ad998b52d4 fix: check_gbot only scans .gbot/ folder, not entire bucket
All checks were successful
BotServer CI/CD / build (push) Successful in 4m21s
- Added prefix filter to list_objects_v2 call: only scans {bot}.gbot/
- Removed scanning of .gbkb and .gbdialog paths which caused 5min timeouts
- This fixes salesianos DriveMonitor timeout and embed/index failure

Also fixed header detection for name,value CSV format.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 21:02:01 -03:00
4dbc418aab fix: detect name,value header in config.csv
Header detection was only checking for key,value but the actual
CSV uses name,value as header row. Now both are detected and skipped.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-04-12 20:47:56 -03:00