2275 Commits

Author SHA1 Message Date
Xubin Ren
fde530de01 refactor(setup): enhance SKILL.md for upgrade process clarity 2026-05-02 07:40:29 +00:00
Xubin Ren
861fbb0dde fix(provider): correct LongCat OpenAI base URL
Use the SDK-ready /v1 base so LongCat chat completions hit the documented endpoint.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-02 01:52:04 +08:00
moranfong
051037ff08 feat(provider): add LongCat via OpenAI-compatible backend 2026-05-02 01:52:04 +08:00
yorkhellen
ee364c6ac1 fix(helpers): restore tiktoken fallback in estimate_prompt_tokens_chain 2026-05-02 00:07:45 +08:00
Xubin Ren
fd1a5a6267 test(provider): tidy Anthropic fallback imports
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-01 23:59:24 +08:00
coldxiangyu
4c54a2b153 fix(anthropic): auto-fallback to stream on long-request error
The Anthropic SDK raises a client-side ValueError when a non-streaming
`messages.create` call could exceed the 10-minute server timeout (e.g.
high `max_tokens` combined with extended thinking budget). The error
text "Streaming is required for operations that may take longer than
10 minutes" was bubbling up to the user as an opaque LLM error in
channels that use the non-stream path (e.g. wecom in #2709).

Detect this specific ValueError in `chat()` and transparently retry
through `chat_stream()` (without `on_content_delta` so behavior matches
the non-stream contract). Other ValueErrors continue to flow through
`_handle_error` unchanged.

Closes #2709

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 23:59:24 +08:00
coldxiangyu
4860a9a6c9 fix(matrix): stop sync loop on irrecoverable auth errors
When the Matrix homeserver returns M_UNKNOWN_TOKEN / M_FORBIDDEN /
M_UNAUTHORIZED (or soft_logout), the previous _sync_loop kept retrying
sync_forever every 2 seconds forever, spamming the homeserver and
filling logs (#1851). The auth state cannot recover by retrying, so
this is pure noise and a soft DoS on the homeserver.

- Extract `_is_fatal_auth_response()` helper
- In `_on_sync_error`, on fatal auth: set `_running=False` and call
  `stop_sync_forever()` so the loop exits cleanly
- Add exponential backoff (2s → 60s cap) to the generic exception path
  in `_sync_loop` so transient network blips also stop hammering

Closes #1851

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 23:59:09 +08:00
Xubin Ren
539d82eadc test(tools): accept spawn origin message context
Made-with: Cursor
2026-05-01 20:09:59 +08:00
Xubin Ren
188e6df757 fix(utils): cover complete trailing think markers
Made-with: Cursor
2026-05-01 20:09:59 +08:00
bravel
2c397ad442 fix: strip partial think tags in streaming output 2026-05-01 20:09:59 +08:00
Xubin Ren
aea5948b11 fix(tools): tighten web fetch URL cleaning
Made-with: Cursor
2026-05-01 19:58:19 +08:00
彭星杰
5dc96505e8 fix(web_fetch): sanitize URL to strip markdown backticks and quotes before validation
LLM-generated tool calls may wrap URLs in markdown backticks or quotes
(e.g. \https://example.com\), causing urlparse to produce empty scheme
and netloc, which leads to all fetch attempts failing silently.

Add URL cleaning at the top of WebFetchTool.execute to strip whitespace,
backticks, double quotes, and single quotes, plus an early rejection guard
for non-http(s) URLs after cleaning.
2026-05-01 19:58:19 +08:00
Xubin Ren
43a58335f6 fix(provider): narrow DeepSeek reasoning history cleanup
Made-with: Cursor
2026-05-01 19:52:38 +08:00
Jiajun Xie
8ca575bdeb fix: adjust DeepSeek reasoning mode check condition
- Modified _drop_deepseek_incomplete_reasoning_history to properly handle reasoning mode detection
- Fixes issue #3554
2026-05-01 19:52:38 +08:00
Xubin Ren
e16fa7c6b1
Merge PR #3561: fix: origin_message_id support and outbound deduplication
fix: origin_message_id support and outbound deduplication
2026-05-01 19:52:10 +08:00
Xubin Ren
e157392250 fix(agent): scope subagent reply dedupe to origin message
Made-with: Cursor
2026-05-01 11:47:24 +00:00
yorkhellen
08f326ec55 test: Add tests for sender_id runtime context injection 2026-05-01 19:43:38 +08:00
yorkhellen
c4170fa9ba feat: Add sender_id to LLM runtime context 2026-05-01 19:43:38 +08:00
hanyuanling
1040124ede Fix API stream lifecycle for tool-backed requests 2026-05-01 19:42:52 +08:00
liuZhou
73840b0af6 fix(matrix): remove tuple default from allow_room_mentions 2026-05-01 19:41:58 +08:00
hinotoi-agent
ad952e0da2 fix(dingtalk): block SSRF in outbound media fetches 2026-05-01 19:31:45 +08:00
copilot-swe-agent[bot]
0284174df9 fix: prevent empty Matrix messages when progress callback sends empty content
Agent-Logs-Url: https://github.com/halldorjanetzko/nanobot/sessions/df528c59-8214-41a0-9b79-9d1d41857107

Co-authored-by: halldorjanetzko <158819146+halldorjanetzko@users.noreply.github.com>
2026-05-01 19:31:04 +08:00
coldxiangyu
15007afd4a fix(matrix): skip events received before bot startup
Matrix sync replays the room timeline on each startup or `/restart`,
causing already-handled messages to be reprocessed (#3553). Even with
`store_sync_tokens=True`, the sync token isn't reliably re-injected
when restoring a session via access_token + load_store(), so the
client re-reads recent timeline entries.

Filter `event.server_timestamp` against the process start time so old
events are dropped at the `_on_message` / `_on_media_message` entry
points. Trade-off: messages received during downtime won't be
processed, which matches the issue reporter's expectation.

Closes #3553

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 19:30:33 +08:00
Jack Lu
d9800ecdd2 refactor: replace try-except blocks with contextlib.suppress for cleaner error handling across multiple files 2026-05-01 19:30:11 +08:00
Xubin Ren
1c24f10236 fix(skills): update restart instructions in upgrade process 2026-05-01 11:18:47 +00:00
Xubin Ren
39c38b593f refactor(tools): move file state lookup out of loop
Made-with: Cursor
2026-05-01 19:15:07 +08:00
Xubin Ren
fae38319ca fix(tools): scope file state by session
Made-with: Cursor
2026-05-01 19:15:07 +08:00
LZDQ
58ae2d5b7e Claude: replace module-level file read states with per-loop per-session state class. fixes #3571 2026-05-01 19:15:07 +08:00
Xubin Ren
6891a7a4d4 fix(skills): correct update setup commands
Made-with: Cursor
2026-05-01 19:02:26 +08:00
chengyongru
830730f82d feat(skills): add update-setup wizard skill 2026-05-01 19:02:26 +08:00
Xubin Ren
306958d6e6 add native Bedrock Converse provider
Made-with: Cursor
2026-05-01 18:52:03 +08:00
童天立
61a8ad27d9 fix: add origin_message_id parameter to SubagentManager.spawn() 2026-04-30 21:24:37 +08:00
童天立
4e06c00b46 fix: add origin_message_id support for spawn and message deduplication 2026-04-30 21:22:48 +08:00
hanyuanling
3c20d16117 fix subagent max iteration limit 2026-04-30 13:45:40 +08:00
Xubin Ren
f8fd9f0011 fix(feishu): keep streaming replies in existing topics
Made-with: Cursor
2026-04-30 13:42:37 +08:00
hanyuanling
d82f25e4d4 fix(feishu): respect reply_to_message for group threads 2026-04-30 13:42:37 +08:00
Xubin Ren
26e953f0b9 Revert "fix(feishu): streaming card and tool hint respect reply_to_message in…"
This reverts commit 651b6b933f2db26713b5668d0c103d1b022e858c.
2026-04-30 13:27:37 +08:00
04cb
651b6b933f fix(feishu): streaming card and tool hint respect reply_to_message in groups 2026-04-30 12:51:08 +08:00
Xubin Ren
71eff09653 fix(whatsapp): refresh bridge when source changes 2026-04-30 04:18:31 +00:00
Xubin Ren
d23bcae5a3 chore: update README with news for v0.1.5.post4 release 2026-04-29 11:12:50 +00:00
Xubin Ren
69bcf26ef4 chore: update README with news for v0.1.5.post3 release 2026-04-29 10:59:19 +00:00
Xubin Ren
0b1631f33d chore: bump version to 0.1.5.post3 and update README news
- pyproject.toml + __init__.py: 0.1.5.post2 → 0.1.5.post3
- README: add daily news entries for 2026-04-22 through 2026-04-28

Made-with: Cursor
v0.1.5.post3
2026-04-29 10:50:57 +00:00
Xubin Ren
3d7099b421 fix(memory): clean atomic write test hygiene
Made-with: Cursor
2026-04-29 16:57:50 +08:00
yorkhellen
53ca2836e7 fix(memory): also fsync directory for rename durability 2026-04-29 16:57:50 +08:00
yorkhellen
2af45945e2 fix(memory): ensure atomic write for history.jsonl
Use temp file + os.replace + fsync to prevent partial writes on crash.
Add tests for atomic write behavior and tmp file cleanup on exception.
2026-04-29 16:57:50 +08:00
chengyongru
74270bb8a8 refactor(channels): resolve progress overrides at init-time like transcription 2026-04-29 16:43:09 +08:00
hanyuanling
a0443e8f9e fix(channels): address progress override review 2026-04-29 16:43:09 +08:00
hanyuanling
0b111a0e0c fix(channels): support per-channel progress controls 2026-04-29 16:43:09 +08:00
Xubin Ren
67b4d113c9 chore: update pyproject.toml 2026-04-29 08:25:09 +00:00
Jiajun Xie
95715f5211 fix: sanitize Matrix user_id for Windows-safe store file names
- Replace ':' with '_' in store_name to avoid WinError 123
- Pass sanitized store_name via AsyncClientConfig
- Fixes issue #3506 where Matrix channel fails on Windows due to
  colon in user_id causing invalid file paths in matrix-nio's DefaultStore
2026-04-29 16:04:49 +08:00