Commit Graph

11 Commits

Author SHA1 Message Date
6ffb769b95 Eagerly initialize MCP tools at startup so loading is logged to console
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:22:31 +02:00
3932e44495 Log MCP tool loading outcome (fetching, loaded names, or failure with traceback)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:16:22 +02:00
fa090412d2 Auto-update config.json with new scalar fields from config.example.json on startup
On each startup, if config.json exists alongside config.example.json, any scalar
fields (strings, ints, booleans) present in the example but absent in the running
config are added automatically and the file is rewritten atomically. Existing values
and dict/list sections are never touched. Added fields are logged at INFO level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:58:09 +02:00
9a3b7aa4f5 Add OpenAI tool-calling agentic loop with file tools and MiniMax MCP integration
- AIService.generate() now runs an agentic loop: sends tools to the API,
  handles tool_calls responses, executes tools, appends results, and repeats
  until a text response (up to tool_max_rounds, default 10)
- New app/ai/tools.py: six sandboxed file tools (write/read/create/modify/delete/list),
  OpenAI JSON schemas, path sandbox validator, and MCP→OpenAI schema converter
- Paths are sandboxed to workspace/ (project root) and prompts/ai/; traversal blocked
- MinimaxImageUnderstandClient gains list_tools() and call_tool() methods; MCP tool
  schemas are lazily fetched once per session and forwarded to the AI as callable tools
- AIConfig gains workspace_dir (Path, default workspace/) and tool_max_rounds (int, default 10)
- MCP client opened lazily only when an MCP tool is actually called during a loop

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:55:45 +02:00
fb78d813af Use free Telegram reactions for AI status (🤔/👍/👎)
Replace premium-only ⏳/✅/❌ with reactions available to all users:
🤔 while processing, 👍 on success, 👎 on error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 16:02:13 +02:00
65088c2fdc Replace AI status message with emoji reactions
Instead of sending/editing a verbose status message, now reacts to the
command message: ⏳ while processing, ✅ on success, ❌ on error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:19:14 +02:00
e4e47c4649 Fix UTF-8 decode error for providers returning invalid encoding (Ollama)
Some providers (e.g. Ollama) may return response bytes that aren't valid
UTF-8. json.loads() raises UnicodeDecodeError in that case. Add an httpx
response event hook that replaces invalid bytes before the SDK parses the
response body.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 15:14:27 +02:00
ba41ad6a70 Fix wrong-prefix silent ignore and Minimax image understand host
- Remove "Use .cmd for this role" reply when owner uses wrong prefix;
  wrong-prefix commands are now silently ignored for all users
- Fix AIImageUnderstandConfig default api_host to api.minimax.chat
  (minimax-coding-plan-mcp routes all calls there, not api.minimax.io)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-15 12:34:43 +02:00
Codex
86f7827802 Refine AI image context handling 2026-05-14 18:34:40 +02:00
Codex
2a731600e0 Add dual-prefix AI command 2026-05-14 13:24:47 +02:00
Codex
27b2760079 Add multi-account command ACL system 2026-05-13 22:19:27 +02:00