Commit Graph

178 Commits

Author SHA1 Message Date
Re-bin
4752e95a24 merge origin/main into pr-1361 2026-03-01 06:36:29 +00:00
Re-bin
c2bbd6d20d Merge branch 'main' into pr-1361 2026-03-01 06:30:10 +00:00
Jack Lu
3ee061b879 Merge branch 'main' into main 2026-03-01 13:35:24 +08:00
yzchen
2fc16596d0 fix(feishu): parse post wrapper payload for rich text messages 2026-03-01 02:17:10 +08:00
Xubin Ren
422969d468 Merge PR #1348: fix(lark): Remove non-existent stop() call on Lark ws.Client when enable lark channel
fix(lark): Remove non-existent stop() call on Lark ws.Client when enable lark channel
2026-03-01 01:23:27 +08:00
zhangxiaoyu.york
9e2f69bd5a tidy up 2026-03-01 00:51:17 +08:00
Re-bin
c34e1053f0 fix(qq): disable botpy file log to fix read-only filesystem error 2026-02-28 16:45:06 +00:00
zerone0x
cfe33ff7cd fix(qq): disable botpy file log to fix read-only filesystem error
When nanobot is run as a systemd service with ProtectSystem=strict,
the process cwd defaults to the read-only root filesystem (/). botpy's
default Client configuration includes a TimedRotatingFileHandler that
writes 'botpy.log' to os.getcwd(), which raises [Errno 30] Read-only
file system.

Pass ext_handlers=False when constructing the botpy Client subclass to
suppress the file handler. nanobot already routes all log output through
loguru, so botpy's file handler is redundant.

Fixes #1343

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-28 17:35:07 +01:00
zhangxiaoyu.york
5d829ca575 bugfix: remove client.stop 2026-03-01 00:30:03 +08:00
Re-bin
73a708770e refactor: compress DingTalk helpers 2026-02-28 16:23:43 +00:00
zhangxiaoyu.york
b3af59fc8e bugfix: remove client.stop 2026-03-01 00:20:32 +08:00
JK_Lu
977ca725f2 style: unify code formatting and import order
- Remove trailing whitespace and normalize blank lines
- Unify string quotes and line breaks for long lines
- Sort imports alphabetically across modules
2026-02-28 20:55:43 +08:00
siyuan.qsy
cfc55d626a feat(dingtalk): send images as image messages, keep files as attachments 2026-02-28 20:34:23 +08:00
Re-bin
95ffe47e34 refactor: use OrderedDict for WhatsApp dedup, consistent with Feishu 2026-02-28 08:38:29 +00:00
Re-bin
d8d954ad46 Merge remote-tracking branch 'origin/main' into pr-1325 2026-02-28 08:33:13 +00:00
spartan077
c0ad986504 fix: add message deduplication to WhatsApp channel
Prevent infinite loops by tracking processed message IDs in WhatsApp
channel. The bridge may send duplicate messages which caused the bot
to respond repeatedly with the same generic message.

Changes:
- Add _processed_message_ids deque (max 2000) to track seen messages
- Skip processing if message_id was already processed
- Align WhatsApp dedup with other channels (Feishu, Email, Mochat, QQ)

This fixes the issue where WhatsApp gets stuck in a loop sending
identical responses repeatedly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 13:44:22 +05:30
Xubin Ren
08752fab2f Merge PR #1307 to pass msg_id in QQ C2C reply
fix: pass msg_id in QQ C2C reply to avoid proactive message permissio…
2026-02-28 15:54:39 +08:00
阿正
e440aa72c5 fix the interactive message text cannot be extracted 2026-02-28 15:10:35 +08:00
GabrielWithTina
8842fb2b4d fix: pass msg_id in QQ C2C reply to avoid proactive message permission error
QQ's bot API requires a msg_id (original inbound message ID) to send a
passive reply. Without it the request is treated as a proactive message
and fails with error 40034102 (无权限). The message_id was already stored
in InboundMessage.metadata and forwarded to OutboundMessage, but was never
read in send().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-28 09:44:28 +08:00
Re-bin
2d33371366 Merge remote-tracking branch 'origin/main' into pr-1239 2026-02-27 09:51:33 +00:00
Re-bin
969b15dbce Merge remote-tracking branch 'origin/main' into pr-1257 2026-02-27 09:31:12 +00:00
Re-bin
aa2987be3e refactor: streamline Telegram media-group buffering 2026-02-27 09:30:01 +00:00
Tanish Rajput
568a54ae3e Initialize Matrix channel in ChannelManager when enabled in config 2026-02-27 11:39:01 +05:30
Kim
a3e0543eae chore(telegram): keep media-group fix without unrelated formatting changes 2026-02-27 12:16:51 +08:00
Kim
aa774733ea fix(telegram): aggregate media-group images into a single inbound turn 2026-02-27 12:08:48 +08:00
kimkitsuragi26
6641bad337 feat(feishu): make reaction emoji configurable
Replace hardcoded THUMBSUP with configurable react_emoji field
in FeishuConfig, consistent with SlackConfig.react_emoji pattern.

Default remains THUMBSUP for backward compatibility.
2026-02-27 11:45:44 +08:00
Re-bin
988a85d8de refactor: optimize matrix channel — optional deps, trim comments, simplify methods 2026-02-26 03:04:01 +00:00
Re-bin
84f2f3c316 Merge remote-tracking branch 'origin/main' into pr-420 2026-02-26 02:48:21 +00:00
Re-bin
cdbede2fa8 refactor: simplify /stop dispatch, inline commands, trim verbose docstrings 2026-02-25 17:04:08 +00:00
Re-bin
96e1730af5 style: simplify _fixup_mrkdwn and trim docstring in SlackChannel 2026-02-24 16:20:28 +00:00
nanobot-agent
81b669b36e fix(slack): post-process slackify_markdown output to catch leftover artifacts
The slackify_markdown library (markdown-it) fails to convert **bold** when
the closing ** is immediately followed by non-space text (e.g. **Status:**OK).
This is a very common LLM output pattern that results in raw ** showing up
in Slack messages.

Add _fixup_mrkdwn() post-processor that:
- Converts leftover **bold** → *bold* (Slack mrkdwn)
- Converts leftover ## headers → *bold* (safety net)
- Fixes over-escaped &amp; in bare URLs
- Protects code fences and inline code from being mangled

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 12:44:17 +00:00
nanobot-agent
8686f060d9 fix(slack): add post-processing to fix mrkdwn conversion edge cases
The slackify_markdown library misses several patterns that LLMs commonly
produce, causing raw Markdown symbols (**bold**, ##headers) to appear
in Slack messages.

Add _fixup_mrkdwn() post-processor that:
- Converts leftover **bold** patterns (e.g. **Status:**OK where closing
  ** is adjacent to non-space chars)
- Fixes &amp; over-escaping in bare URLs
- Protects code blocks from false-positive fixups

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 12:43:21 +00:00
Re-bin
c6b933df4a Merge remote-tracking branch 'origin/main' into pr-1077 2026-02-24 11:38:38 +00:00
xzq.xu
4f8033627e feat(feishu): support images in post (rich text) messages
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-24 13:42:07 +08:00
chengyongru
91e13d91ac fix(email): allow proactive sends when autoReplyEnabled is false
Previously, `autoReplyEnabled=false` would block ALL email sends,
including proactive emails triggered from other channels (e.g., asking
nanobot on Feishu to send an email).

Now `autoReplyEnabled` only controls automatic replies to incoming
emails, not proactive sends. This allows users to disable auto-replies
while still being able to ask nanobot to send emails on demand.

Changes:
- Check if recipient is in `_last_subject_by_chat` to determine if
  it's a reply
- Only skip sending when it's a reply AND auto_reply_enabled is false
- Add test for proactive send with auto_reply_enabled=false
- Update existing test to verify reply behavior
2026-02-24 04:27:14 +08:00
Re-bin
3c2cc3a71c Merge remote-tracking branch 'origin/main' into pr-1029 2026-02-23 14:01:43 +00:00
Re-bin
2b983c708d refactor: pass session_key as explicit param instead of via metadata 2026-02-23 13:10:47 +00:00
Paul
1f7a81e5ee feat(slack): isolate session context per thread
Each Slack thread now gets its own conversation session instead of
sharing one session per channel. DM sessions are unchanged.

Added as a generic feature to also support if Feishu threads support
is added in the future.
2026-02-23 10:23:55 +00:00
Re-bin
df2c837e25 feat(channels): split send_progress into send_progress + send_tool_hints 2026-02-23 07:12:41 +00:00
Yingwen Luo-LUOYW
31a873ca59 Merge branch 'main' of https://github.com/HKUDS/nanobot 2026-02-23 09:41:56 +08:00
Yingwen Luo-LUOYW
0c412b3728 feat(channels): add send_progress option to control progress message delivery
Add a boolean config option `channels.sendProgress` (default: false) to
control whether progress messages (marked with `_progress` metadata) are
sent to chat channels. When disabled, progress messages are filtered
out in the outbound dispatcher.
2026-02-23 09:41:13 +08:00
Nikolas de Hor
4303026e0d fix: break Discord typing loop on persistent HTTP failure
The typing indicator loop catches all exceptions with bare
except/pass, so a permanent HTTP failure (client closed, auth
error, etc.) causes the loop to spin every 8 seconds doing
nothing until the channel is explicitly stopped.

Log the error and exit the loop instead, letting the task
clean up naturally.
2026-02-22 22:01:16 -03:00
Re-bin
efe89c9091 fix(feishu): pass msg_type as resource_type and clean up style 2026-02-22 18:16:45 +00:00
Re-bin
3d55c9cd03 Merge remote-tracking branch 'origin/main' into pr-986 2026-02-22 18:13:37 +00:00
Re-bin
b53c3d39ed fix(qq): remove dead _bot_task field and fix stop() to close client 2026-02-22 17:35:53 +00:00
Re-bin
9efe95970e Merge branch 'main' into pr-962 2026-02-22 17:24:34 +00:00
Re-bin
4e8c8cc227 fix(email): fix misleading comment and simplify uid eviction 2026-02-22 15:48:49 +00:00
Re-bin
d82c292c99 Merge branch 'main' into pr-959 2026-02-22 15:41:09 +00:00
Re-bin
b93b77a485 fix(slack): use logger.exception to capture full traceback 2026-02-22 15:38:19 +00:00
FloRa
0d3a2963d0 fix(feishu): replace file.get with message_resource.get to fix file download permission issue 2026-02-22 17:37:33 +08:00