Commit Graph
2268 Commits
Author SHA1 Message Date
Xubin RenandXubin Ren 539d82eadc test(tools): accept spawn origin message context
Made-with: Cursor
2026-05-01 20:09:59 +08:00
Xubin RenandXubin Ren 188e6df757 fix(utils): cover complete trailing think markers
Made-with: Cursor
2026-05-01 20:09:59 +08:00
bravelandXubin Ren 2c397ad442 fix: strip partial think tags in streaming output 2026-05-01 20:09:59 +08:00
Xubin RenandXubin Ren aea5948b11 fix(tools): tighten web fetch URL cleaning
Made-with: Cursor
2026-05-01 19:58:19 +08:00
彭星杰andXubin Ren 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 RenandXubin Ren 43a58335f6 fix(provider): narrow DeepSeek reasoning history cleanup
Made-with: Cursor
2026-05-01 19:52:38 +08:00
Jiajun XieandXubin Ren 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 RenandGitHub 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
yorkhellenandXubin Ren 08f326ec55 test: Add tests for sender_id runtime context injection 2026-05-01 19:43:38 +08:00
yorkhellenandXubin Ren c4170fa9ba feat: Add sender_id to LLM runtime context 2026-05-01 19:43:38 +08:00
hanyuanlingandXubin Ren 1040124ede Fix API stream lifecycle for tool-backed requests 2026-05-01 19:42:52 +08:00
liuZhouandXubin Ren 73840b0af6 fix(matrix): remove tuple default from allow_room_mentions 2026-05-01 19:41:58 +08:00
hinotoi-agentandXubin Ren ad952e0da2 fix(dingtalk): block SSRF in outbound media fetches 2026-05-01 19:31:45 +08:00
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
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 LuandXubin Ren 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 RenandXubin Ren 39c38b593f refactor(tools): move file state lookup out of loop
Made-with: Cursor
2026-05-01 19:15:07 +08:00
Xubin RenandXubin Ren fae38319ca fix(tools): scope file state by session
Made-with: Cursor
2026-05-01 19:15:07 +08:00
LZDQandXubin Ren 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 RenandXubin Ren 6891a7a4d4 fix(skills): correct update setup commands
Made-with: Cursor
2026-05-01 19:02:26 +08:00
chengyongruandXubin Ren 830730f82d feat(skills): add update-setup wizard skill 2026-05-01 19:02:26 +08:00
Xubin RenandXubin 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
hanyuanlingandXubin Ren 3c20d16117 fix subagent max iteration limit 2026-04-30 13:45:40 +08:00
Xubin RenandXubin Ren f8fd9f0011 fix(feishu): keep streaming replies in existing topics
Made-with: Cursor
2026-04-30 13:42:37 +08:00
hanyuanlingandXubin Ren 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 651b6b933f.
2026-04-30 13:27:37 +08:00
04cbandXubin Ren 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
2026-04-29 10:50:57 +00:00
Xubin RenandXubin Ren 3d7099b421 fix(memory): clean atomic write test hygiene
Made-with: Cursor
2026-04-29 16:57:50 +08:00
yorkhellenandXubin Ren 53ca2836e7 fix(memory): also fsync directory for rename durability 2026-04-29 16:57:50 +08:00
yorkhellenandXubin Ren 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
chengyongruandXubin Ren 74270bb8a8 refactor(channels): resolve progress overrides at init-time like transcription 2026-04-29 16:43:09 +08:00
hanyuanlingandXubin Ren a0443e8f9e fix(channels): address progress override review 2026-04-29 16:43:09 +08:00
hanyuanlingandXubin Ren 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 XieandXubin Ren 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
masterlyjandXubin Ren 2b9b41f9c3 test(providers): cover reasoning_effort="none" and gemma auto-routing
- Anthropic: "none" must not enable extended thinking
- Azure: "none" must not suppress temperature or inject reasoning body
- DeepSeek/DashScope/Kimi: "none" sends thinking disabled, skips reasoning_effort field
- Gemini: gemma keyword enables auto-routing for gemma models
2026-04-29 15:41:11 +08:00
masterlyjandXubin Ren b94bc18e59 fix: treat reasoning_effort="none" as thinking disabled and route gemma to Gemini provider
- Do not send reasoning_effort="none" to APIs (prevents 400 on gemma/Gemini)
- Treat "none" as thinking disabled in thinking_style, Kimi, and reasoning_content backfill paths
- Fix Anthropic extended thinking not respecting "none"
- Fix Azure OpenAI temperature suppression and reasoning body for "none"
- Fix Codex reasoning body for "none"
- Add "gemma" keyword to Gemini ProviderSpec for correct auto routing
2026-04-29 15:41:11 +08:00
28f9bbff31 feat(web_search): add olostep provider
Adds Olostep (https://www.olostep.com) as an optional web_search backend
using the official olostep Python SDK (client.answers.create()).

Changes:
- pyproject.toml: adds olostep>=0.1.0 optional dependency
- schema.py: adds olostep to provider comment in WebSearchConfig
- web.py: adds _search_olostep() with lazy import and provider branching
- docs/configuration.md: documents Olostep setup under web search config
- tests: unit tests for the new provider

Backward compatible: existing users see no behavior change unless they
opt into provider: "olostep". No hard dependency at runtime path.

Co-authored-by: umerkay <umerkk164@gmail.com>
2026-04-28 19:09:38 +08:00
甘全andXubin Ren 0053e68423 fix(feishu): skip reaction transition on resuming stream end
Stream-end events are emitted at the end of every assistant turn. When
the agent has more tool-call rounds queued, the runner sets
`_resuming=True` on the metadata. Without a guard, every intermediate
stream end removed the OnIt reaction (the first one wins, since
`_reaction_ids.pop` empties the slot) and re-added `done_emoji`,
producing a DONE reaction after every tool call instead of only at
final completion.

Wrap the OnIt removal and `done_emoji` add in a `not _resuming` guard
so the OnIt indicator persists across tool-call rounds and DONE fires
exactly once when the agent's final response lands.

`_resuming` already flows through outbound metadata
(`nanobot/agent/loop.py:747`) and survives `_coalesce_stream_deltas`
because pure `_stream_end` messages without `_stream_delta` skip the
merge branch.

Tests:
- test_no_removal_when_resuming
- test_done_emoji_only_on_final_stream_end
2026-04-28 17:29:12 +08:00
Xubin RenandXubin Ren 278ef22776 docs(config): document provider extra body
Show how to configure OpenAI-compatible request body extensions such as sampling and chat template parameters.

Made-with: Cursor
2026-04-28 15:56:13 +08:00
hussein1362andXubin Ren 415e617398 feat(providers): add extra_body config for OpenAI-compatible endpoints
Add an `extra_body` field to `ProviderConfig` that merges arbitrary
key-value pairs into every OpenAI-compatible request body. This is the
escape hatch for provider-specific features that nanobot does not have
first-class fields for.

Real-world use cases this unblocks via config alone (no code changes):
- vLLM/TGI `chat_template_kwargs` (e.g. `enable_thinking: false`)
- vLLM guided decoding (`guided_json`, `guided_regex`)
- Local model sampling params (`repetition_penalty`, `top_k`, `min_p`)
- Any future provider-specific param without a new PR each time

The config extra_body is applied last via recursive deep-merge, so it
can extend or override provider-specific defaults (e.g. thinking
params) without clobbering sibling keys set by internal logic.

Changes:
- Add `extra_body: dict[str, Any] | None` to `ProviderConfig`
- Pass it through `factory.py` to `OpenAICompatProvider.__init__`
- Deep-merge into `_build_kwargs` after all internal extra_body entries
- Add `_deep_merge` helper (recursive dict merge, does not mutate inputs)
- 21 tests: deep-merge semantics, provider init, _build_kwargs
  integration, thinking coexistence, real-world patterns (guided_json,
  repetition_penalty), and schema validation
2026-04-28 15:56:13 +08:00
Xubin RenandGitHub 58f8c04bd5 Merge PR #3382: feat(web-tools): Improve to allow bypassing Cloudflare captchas
feat(web-tools): Improve to allow bypassing Cloudflare captchas
2026-04-28 15:27:47 +08:00