Commit Graph
3152 Commits
Author SHA1 Message Date
Heng Wei BinandXubin Ren de4009efbd fix: exclude archived keys in heartbeat & fallback missing session timestamps 2026-06-24 15:45:49 +08:00
hyoukadevandXubin Ren 9c6eaf0bed test: deduplicate proxy value and construct tool via constructor
- Use a local variable for the proxy URL instead of hardcoding it twice
- Pass proxy through the WebSearchTool constructor instead of mutating
  after instantiation (matches real usage path)
- Add assertion that timeout is still forwarded correctly
- Use generic mock data instead of test-specific strings
2026-06-24 15:45:44 +08:00
hyoukadevandXubin Ren c66a0217d2 fix(web): pass proxy to DDGS client
The DuckDuckGo search provider instantiated DDGS(timeout=10) without
passing the configured proxy, making web_search unusable in environments
that require a proxy (e.g. behind GFW). DDGS supports a proxy parameter
and the proxy value is already available as self.proxy — it was simply
not forwarded.

Add a test verifying the proxy kwarg is forwarded to DDGS.
2026-06-24 15:45:44 +08:00
yorkhellenandXubin Ren 319791cd10 fix(config): preserve dream cron when saving config 2026-06-24 15:45:39 +08:00
chengyongruandXubin Ren a584ffe92d refactor: trim thinking tag helper setup
maintainer edit: remove unused self-closing tag derivation and duplicate reasoning partial cleanup after ponytail review.
2026-06-24 15:45:34 +08:00
chengyongruandXubin Ren 1e22932313 refactor: centralize thinking tag patterns
maintainer edit: derive thinking tag regexes and streaming partial prefixes from one tag list so future aliases only need one entry while preserving legacy self-closing think/thought behavior.
2026-06-24 15:45:34 +08:00
chengyongruandXubin Ren 98dd883ce8 fix: buffer split reasoning wrapper deltas
maintainer edit: native reasoning streams can split <thinking> wrapper tags across chunks. Buffer the stream and emit only cleaned incremental reasoning so raw partial tags do not reach WebUI.
2026-06-24 15:45:34 +08:00
ZhouandXubin Ren 35bd1be109 fix: ignore non-string reasoning wrappers 2026-06-24 15:45:34 +08:00
ZhouandXubin Ren 596bf5398c test: cover empty thinking marker streaming 2026-06-24 15:45:34 +08:00
ZhouandXubin Ren 523bb928bf fix: normalize thinking tags in reasoning output 2026-06-24 15:45:34 +08:00
Xubin Ren f9afc9389b fix(providers): apply Kimi Coding default headers 2026-06-24 10:43:16 +08:00
chengyongruandXubin Ren 9d6c606cc9 docs: document kimi coding provider
Maintainer edit: add the provider reference row and a pasteable cookbook recipe so users know to select kimi_coding and set the required User-Agent header.
2026-06-24 10:43:16 +08:00
NanoBotandXubin Ren 44817b75c6 feat(provider): add kimi_coding provider for Kimi Coding Plan
Add a dedicated provider entry for the Kimi Coding Plan endpoint
(api.kimi.com/coding) using the Anthropic Messages API transport.

- Register kimi_coding with backend=anthropic
- Use KIMI_CODING_API_KEY env key to avoid clashing with MOONSHOT_API_KEY
- Default api_base set to https://api.kimi.com/coding/v1 so that
  AnthropicProvider._normalize_base_url() + the SDK produce the correct
  /coding/v1/messages request path
- Keywords include kimi-coding, kimi_coding and kimi-for-coding

Closes HKUDS/nanobot#4463
2026-06-24 10:43:16 +08:00
chengyongruandXubin Ren c55f7ec5bb style: trim pairing sender-id comments
maintainer edit: remove redundant explanatory comments from the focused sender-id normalization tests and store change without changing behavior.
2026-06-24 10:29:58 +08:00
w.antarandXubin Ren d7f868b832 fix(pairing): also coerce sender_id in approve_code() 2026-06-24 10:29:58 +08:00
w.antarandXubin Ren d481d5fb1a fix(pairing): normalize sender IDs to str in the pairing store 2026-06-24 10:29:58 +08:00
chengyongruandXubin Ren bc1df49201 fix(gateway): handle lifecycle edge cases 2026-06-24 10:29:08 +08:00
chengyongruandXubin Ren 7826f8f89c docs: document runtime environment variables 2026-06-24 10:28:15 +08:00
chengyongruandXubin Ren b14f82f408 fix(webui): prevent iOS Safari composer zoom 2026-06-24 10:26:14 +08:00
chengyongruandXubin Ren 6d989de336 docs: document OpenCode provider setup
Maintainer edit: document OpenCode Zen and Go configuration, keep their registry entries with gateway providers, and add focused provider registration tests.
2026-06-24 10:25:12 +08:00
zpljd258andXubin Ren ddad6c5a7c feat(providers): add OpenCode Zen and OpenCode Go providers 2026-06-24 10:25:12 +08:00
David JimenezandXubin Ren 4b1decdb95 chore: bump to node 24 2026-06-24 10:23:07 +08:00
chengyongruandXubin Ren 23dc253f89 refactor: simplify Anthropic tool id remapping
maintainer edit: remove duplicate counter state and use the seen id set directly when choosing duplicate suffixes.
2026-06-24 10:21:48 +08:00
chengyongruandXubin Ren 0e9861558a fix: keep duplicate id repair in Anthropic provider
maintainer edit: move duplicate tool_use history repair out of AgentRunner and into Anthropic message conversion, reusing the OpenAI-compatible queue-mapping approach locally without broadening the shared runner path.
2026-06-24 10:21:48 +08:00
chengyongruandXubin Ren 853aecdb97 fix: preserve duplicate-id tool calls
maintainer edit: remap duplicate tool_use/tool_call ids instead of dropping later calls, so Anthropic-compatible providers that reuse ids for distinct parallel tool calls keep all requested work while still sending unique ids.
2026-06-24 10:21:48 +08:00
Teddy YanandXubin Ren 6b8e832ba5 fix: address PR review comments - rename _dedup to _dedupe and fix ID storage consistency 2026-06-24 10:21:48 +08:00
6689e2d377 fix(providers): dedupe tool_use ids to prevent Anthropic 400s
Anthropic rejects any request where two tool_use blocks share an id
("messages.N.content.M: tool_use ids must be unique"). A mis-assembled
stream could surface the same tool_use block twice in one assistant turn;
the runner persisted it verbatim, so the malformed message was re-sent on
every subsequent turn and permanently bricked the session — the agent
silently stopped replying.

Fix at two layers:
- AnthropicProvider._parse_response: drop duplicate tool_use ids (keep
  first) as the response enters nanobot, so corruption is never persisted.
- AgentRunner._dedup_tool_calls: a new context-governance pass that dedupes
  assistant tool_calls and tool results by id before each send, healing any
  history that was already corrupted.

Add regression tests covering both the dedup and the no-op fast path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 10:21:48 +08:00
axelray-devandXubin Ren 160cec2396 fix: skip sendRichMessage when streaming preview exists (#4470)
When _stream_end fires and a streaming preview already exists, the
sendRichMessage path deletes the preview and sends a fresh message.
This causes line break loss and visible flickering. Gate the rich
path on not buf.message_id so existing previews use the legacy
edit_message_text path instead.
2026-06-24 10:19:14 +08:00
Xubin Ren d2da6df14e docs: align release news dates 2026-06-23 09:50:44 +08:00
Xubin Ren 701ae5563d docs: add v0.2.2 release news 2026-06-23 09:47:23 +08:00
Xubin Ren e2e75c913f docs: add June 20 news entry 2026-06-22 23:55:10 +08:00
Xubin Ren 87f3e08ff7 docs: remove unreleased 0.2.2 news entry 2026-06-22 23:43:15 +08:00
Xubin Ren 951fd73c8e fix(webui): keep new chat heading on one line 2026-06-22 23:30:29 +08:00
Xubin Ren 90703002c9 fix(gateway): restore tty signal mode for ctrl-c 2026-06-22 23:20:45 +08:00
Xubin Ren e624943bac fix(gateway): tolerate cancelled channel tasks during shutdown 2026-06-22 23:20:45 +08:00
Xubin Ren f80a78d5a8 fix(webui): preserve fork replies during history refresh 2026-06-22 22:00:07 +08:00
Xubin Ren 747104c9cc fix(gateway): make foreground shutdown responsive 2026-06-22 22:00:07 +08:00
Xubin Ren a9d1fdcee8 fix(webui): follow active turn output after send 2026-06-22 21:12:34 +08:00
Xubin Ren 83c29292d3 chore(release): prepare v0.2.2 2026-06-22 20:53:28 +08:00
Xubin Ren 7170761e47 fix(webui): anchor sent prompts during active turns 2026-06-22 20:43:27 +08:00
Xubin Ren fbaa85117b fix: close MCP stdio transports from agent task 2026-06-22 18:59:50 +08:00
Xubin Ren 6efef2700a docs: align my tool context window examples 2026-06-22 18:33:49 +08:00
chengyongruandXubin Ren 0db9fbe250 chore: default context window to 200k 2026-06-22 18:33:49 +08:00
chengyongruandXubin Ren 991422a328 refactor: simplify CLI Apps route await 2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren a67285e6a2 fix: use async CLI Apps catalog refresh
Replace the manual thread-based catalog refresh with an asyncio task and async HTTP catalog fetches so the Settings route stays within the async WebUI model.
2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren dd2cb4ca91 fix: refresh optional CLI Apps catalogs
maintainer edit: CLI Apps settings now treats optional catalog caches as refresh candidates without blocking the initial payload, and pending polling stops when refresh is throttled instead of running indefinitely.
2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren 2216405821 fix: avoid stuck Apps loading during catalog refresh
maintainer edit: Empty cache-only CLI Apps payloads should still update the UI while the background catalog refresh is pending, otherwise cold catalog failures leave Settings stuck on the spinner.
2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren 1cd5a0e029 fix: keep refreshable Codex OAuth configured
maintainer edit: Settings reads local Codex token storage to avoid refresh work, so expired access tokens with refresh credentials still need to count as configured until real provider use refreshes them.
2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren b8abe5542c Avoid blocking settings on CLI Apps catalog refresh 2026-06-22 17:14:13 +08:00
chengyongruandXubin Ren 7b153c5aa9 Avoid refreshing Codex token in settings 2026-06-22 17:14:13 +08:00