Commit Graph

211 Commits

Author SHA1 Message Date
Xubin Ren
196e0ddbb6 fix(openrouter): revert custom_llm_provider, always apply gateway prefix 2026-03-15 10:52:36 +08:00
Xubin Ren
350d110fb9 fix(openrouter): remove litellm_prefix to prevent double-prefixed model names
With custom_llm_provider kwarg handling routing, the openrouter/ prefix
caused model names like anthropic/claude-sonnet-4-6 to become
openrouter/anthropic/claude-sonnet-4-6, which OpenRouter API rejects.
2026-03-15 10:52:36 +08:00
Xubin Ren
5ccf350db1 test(litellm_kwargs): add regression tests for PR #2026 OpenRouter kwargs injection 2026-03-15 10:52:36 +08:00
Xubin Ren
19ae7a167e fix(feishu): avoid breaking tool hint formatting and think stripping 2026-03-14 15:40:53 +00:00
Xubin Ren
44af7eca3f merge: resolve PR #1966 conflicts with main 2026-03-14 15:32:19 +00:00
Xubin Ren
a4f6b7d978 merge: resolve PR #1963 conflicts with main 2026-03-14 14:00:00 +00:00
Xubin Ren
86cfbce077 Merge remote-tracking branch 'origin/main' into pr-1796 2026-03-14 13:11:56 +00:00
Xubin Ren
61f0923c66 fix(telegram): include restart in help text 2026-03-14 10:45:37 +00:00
Xubin Ren
a1241ee68c fix(mcp): clarify enabledTools filtering semantics
- support both raw and wrapped MCP tool names
- treat [\"*\"] as all tools and [] as no tools
- add warnings, tests, and README docs for enabledTools
2026-03-14 18:33:48 +08:00
Xubin Ren
411b059dd2 refactor: replace <SILENT_OK> with structured post-run evaluation
- Add nanobot/utils/evaluator.py: lightweight LLM tool-call to decide notify/silent after background task execution
- Remove magic token injection from heartbeat and cron prompts
- Clean session history (no more <SILENT_OK> pollution)
- Add tests for evaluator and updated heartbeat three-phase flow
2026-03-14 17:41:08 +08:00
Protocol Zero
c9cc160600 merge: resolve PR #1796 conflicts with main
Merge the latest main branch into the Telegram media filename fix and keep the file_unique_id-based download path on top of the refactored media handling and newer Telegram tests.

Made-with: Cursor
2026-03-14 08:33:56 +00:00
Xubin Ren
af65145bc8 fix(qq): add configurable message format and onboard backfill 2026-03-14 08:25:44 +00:00
chengyongru
91d95f139e fix: cross-platform test compatibility
- test_channel_plugins: fix assertion logic for discoverable channels
- test_filesystem_tools: normalize path separators for Windows
- test_tool_validation: use python to generate output, avoid cmd line limits
2026-03-14 16:13:38 +08:00
Xubin Ren
dbdb43faff feat: channel plugin architecture with decoupled configs
- Add plugin discovery via Python entry_points (group: nanobot.channels)
- Move 11 channel Config classes from schema.py into their own channel modules
- ChannelsConfig now only keeps send_progress + send_tool_hints (extra=allow)
- Each built-in channel parses dict->Pydantic in __init__, zero internal changes
- All channels implement default_config() for onboard auto-population
- nanobot onboard injects defaults for all discovered channels (built-in + plugins)
- Add nanobot plugins list CLI command
- Add Channel Plugin Guide (docs/CHANNEL_PLUGIN_GUIDE.md)
- Fully backward compatible: existing config.json and sessions work as-is
- 340 tests pass, zero regressions
2026-03-14 16:13:38 +08:00
Hua
b24ad7b526 feat(channels): support multi-instance channel configs 2026-03-13 22:41:24 +08:00
mru4913
670d2a6ff8 feat(feishu): implement message reply/quote support
- Add `reply_to_message: bool = False` config to `FeishuConfig`
- Parse `parent_id` and `root_id` from incoming events into metadata
- Fetch quoted message content via `im.v1.message.get` and prepend
  `[Reply to: ...]` context for the LLM when a user quotes a message
- Add `_reply_message_sync` using `im.v1.message.reply` API so the
  bot's response appears as a threaded quote in Feishu
- First outbound message uses reply API; subsequent chunks fall back
  to `create` to avoid duplicate quote bubbles; progress messages
  always use `create`
- Add 19 unit tests covering all new code paths
2026-03-13 15:02:57 +08:00
Tony
87ab980bd1 refactor(feishu): extract tool hint card sending into dedicated method
- Extract card creation logic into _send_tool_hint_card() helper
- Improves code organization and testability
- Update tests to use pytest.mark.asyncio for cleaner async testing
- Remove redundant asyncio.run() calls in favor of native async test functions
2026-03-13 14:52:15 +08:00
Tony
82064efe51 feat(feishu): improve tool call card formatting for multiple tools
- Format multiple tool calls each on their own line
- Change title from 'Tool Call' to 'Tool Calls' (plural)
- Add explicit 'text' language for code block
- Improves readability and supports displaying longer content
- Update tests to match new formatting
2026-03-13 14:48:36 +08:00
Tony
7261bd8c3f feat(feishu): display tool calls in code block messages
- Tool hint messages with _tool_hint metadata now render as formatted code blocks
- Uses Feishu interactive card message type with markdown code fences
- Shows "Tool Call" header followed by code in a monospace block
- Adds comprehensive unit tests for the new functionality

Co-Authorship-Bot: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:43:47 +08:00
Tony
df89bd2dfa feat(feishu): display tool calls in code block messages
- Add special handling for tool hint messages (_tool_hint metadata)
- Send tool calls using Feishu's "code" message type with formatting
- Tool calls now appear as formatted code snippets in Feishu chat
- Add unit tests for the new functionality

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 14:41:54 +08:00
Tony
da740c871d test 2026-03-13 14:06:22 +08:00
Xubin Ren
ca5047b602 feat(web): multi-provider web search + Jina Reader fetch 2026-03-13 05:44:16 +00:00
Xubin Ren
84b107cf6c fix(ci): upgrade setup-python, add system deps, simplify test assertions 2026-03-13 04:05:08 +00:00
Xubin Ren
4b50a7b6c0 Merge branch 'main' into pr-1916 2026-03-13 03:57:09 +00:00
Xubin Ren
6d3a0ab6c9 fix(memory): validate save_memory payload and raw-archive on repeated failure
- Require both history_entry and memory_update, reject null/empty values
- Fallback to tool_choice=auto when provider rejects forced function call
- After 3 consecutive consolidation failures, raw-archive messages to
  HISTORY.md without LLM summarization to prevent context window overflow
2026-03-13 03:53:50 +00:00
Hua
83826f3904 Add persona and language command localization 2026-03-13 11:32:06 +08:00
Xubin Ren
60c29702cc Merge branch 'main' into pr-1810
# Conflicts:
#	nanobot/agent/memory.py
#	tests/test_memory_consolidation_types.py
2026-03-13 03:29:16 +00:00
Hua
b2584dd2cf Merge remote-tracking branch 'origin/main' 2026-03-13 11:24:46 +08:00
Xubin Ren
4f77b9385c fix(memory): fallback to tool_choice=auto when provider rejects forced function call
Some providers (e.g. Dashscope in thinking mode) reject object-style
tool_choice with "does not support being set to required or object".
Retry once with tool_choice="auto" instead of failing silently.

Made-with: Cursor
2026-03-13 03:18:08 +00:00
Hua
f4018dcce5 Merge remote-tracking branch 'origin/main' 2026-03-13 09:39:01 +08:00
Frank
a09245e919 fix(qq): restore plain text replies for legacy clients 2026-03-12 12:48:25 -07:00
Re-bin
3467a7faa6 fix: improve local provider auto-selection and update docs for VolcEngine/BytePlus 2026-03-12 15:22:15 +00:00
Jiajun Xie
ec6e099393 feat(ci): add GitHub Actions workflow for test directory
- nanobot/channels/matrix.py: Add keyword-only parameters restrict_to_workspace/workspace to MatrixChannel.__init__ and assign them to _restrict_to_workspace/_workspace with proper type conversion and path resolution
- tests/test_commands.py: Add _strip_ansi() function to remove ANSI escape codes, use regex assertions for --workspace/--config parameters to allow 1 or 2 dashes
2026-03-12 21:54:22 +08:00
Hua
cf3c88014f fix: searxng搜索引擎支持 2026-03-12 14:44:19 +08:00
Hua
4de0bf9c4a Merge remote-tracking branch 'origin/main' 2026-03-12 14:40:14 +08:00
Re-bin
64888b4b09 Simplify reply context extraction, fix slash commands broken by reply injection, attach reply media regardless of caption 2026-03-12 06:16:57 +00:00
Re-bin
869149ef1e Merge branch 'main' into pr-1900 2026-03-12 06:06:26 +00:00
Hua
10cd9bf228 Merge remote-tracking branch 'origin/main' 2026-03-12 13:43:37 +08:00
Hua
7f1e42c3fd fix: searxng搜索引擎支持 2026-03-12 12:38:01 +08:00
Re-bin
64aeeceed0 Add /restart command: restart the bot process from any channel 2026-03-12 04:33:51 +00:00
Re-bin
35260ca157 fix: raise persisted tool result limit to 16k 2026-03-12 02:50:28 +00:00
John Doe
3f799531cc Add media download functionality 2026-03-12 06:43:59 +07:00
John Doe
1eedee0c40 add reply context extraction for Telegram messages 2026-03-12 06:23:02 +07:00
Re-bin
0d94211a93 enhance: improve filesystem & shell tools with pagination, fallback matching, and smarter output 2026-03-11 16:20:11 +00:00
Re-bin
9d0db072a3 fix: guard quoted home paths in shell tool 2026-03-11 15:43:04 +00:00
Re-bin
85609c99b3 Merge remote-tracking branch 'origin/main' into pr-1827 2026-03-11 15:32:52 +00:00
Re-bin
9fc74bde9a Merge remote-tracking branch 'origin/main' into pr-1874 2026-03-11 15:26:39 +00:00
Re-bin
c72c2ce7e2 refactor: move generation settings to provider level, eliminate parameter passthrough 2026-03-11 09:47:04 +00:00
Re-bin
a180e84536 Merge remote-tracking branch 'origin/main' into pr-1868 2026-03-11 09:10:29 +00:00
Re-bin
4478838424 fix(pr-1863): complete Ollama provider routing and README docs 2026-03-11 08:42:12 +00:00