3127 Commits

Author SHA1 Message Date
Teddy Yan
6b8e832ba5 fix: address PR review comments - rename _dedup to _dedupe and fix ID storage consistency 2026-06-24 10:21:48 +08:00
Teddy Yan
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-dev
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 v0.2.2 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
chengyongru
0db9fbe250 chore: default context window to 200k 2026-06-22 18:33:49 +08:00
chengyongru
991422a328 refactor: simplify CLI Apps route await 2026-06-22 17:14:13 +08:00
chengyongru
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
chengyongru
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
chengyongru
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
chengyongru
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
chengyongru
b8abe5542c Avoid blocking settings on CLI Apps catalog refresh 2026-06-22 17:14:13 +08:00
chengyongru
7b153c5aa9 Avoid refreshing Codex token in settings 2026-06-22 17:14:13 +08:00
Xubin Ren
e3c9aff41e feat(gateway): add background and service controls 2026-06-22 14:48:49 +08:00
Xubin Ren
351aabd512 fix: polish onboard wizard keyboard navigation 2026-06-22 13:04:05 +08:00
chengyongru
9b52202f4a fix: make quick start rollback on websocket failure
maintainer edit: stage Quick Start edits on a draft config so declining WebSocket/password setup cannot leave saveable provider defaults behind. Align beginner WebUI docs with the password-protected setup.
2026-06-22 13:04:05 +08:00
chengyongru
9713fe2a3b fix: avoid initial webui password error 2026-06-22 13:04:05 +08:00
chengyongru
fca1f2ad02 fix: secure quick start webui setup
Add Quick Start endpoint choices for subscription plan providers, require explicit WebSocket confirmation, and require a WebUI password when enabling the WebSocket channel. Update docs to route Quick Start users through the WebUI instead of agent -m.
2026-06-22 13:04:05 +08:00
chengyongru
e5294002ed fix: broaden quick start provider setup
Drive Quick Start provider choices from the provider registry instead of a short allowlist. Clean up parenthetical wizard labels and keep the beginner docs in sync.
2026-06-22 13:04:05 +08:00
chengyongru
eb14720381 fix: ask for quick start model id
Remove automatic Quick Start model discovery. Users now explicitly enter the model ID after choosing the provider and API key, and incomplete Quick Start input does not leave partial provider config behind.
2026-06-22 13:04:05 +08:00
chengyongru
d14b692368 refactor: simplify quick start onboarding
Cleanup-only simplification: remove a one-entry dispatch table, avoid unused provider tuple unpacking, and strip the selected model once before storing it.
2026-06-22 13:04:05 +08:00
chengyongru
8e9f09f829 fix: keep onboard cli defaults unchanged
Remove the PR changes that made nanobot onboard default to the wizard, added --defaults, added non-TTY fallback behavior, and changed the Docker smoke command. Keep Quick Start available through nanobot onboard --wizard.
2026-06-22 13:04:05 +08:00
chengyongru
da225fc24e fix: fetch openai quick start models
Use OpenAI's SDK default base URL for Quick Start model discovery without writing that default into the saved provider config.
2026-06-22 13:04:05 +08:00
chengyongru
71631f9ab0 fix: ask provider in quick start
Maintainer edit: replace Quick Start key/base detection with an explicit provider-first flow. Users choose the provider that issued the API key, paste the key, and only custom OpenAI-compatible setups ask for a base URL.
2026-06-22 13:04:05 +08:00
chengyongru
2319b660e6 fix: make quick start provider neutral
Maintainer edit: restart the Quick Start flow around an API-key-first path without recommending OpenRouter or DeepSeek. Detect unique key prefixes locally, fall back to a user-provided base URL, and only fetch models from that approved URL.
2026-06-22 13:04:05 +08:00
chengyongru
ed3a8f64d8 fix: use deepseek for quick start onboarding
Maintainer edit: restart the Quick Start default around a mainland-friendly provider instead of making OpenRouter the first-run dependency. Update wizard copy, default preset, focused tests, and beginner docs to use DeepSeek with the current deepseek-v4-flash model.
2026-06-22 13:04:05 +08:00
chengyongru
0e9b136315 fix: streamline quick start onboarding flow
Maintainer edit: continue the wizard simplification pass by making Quick Start save after the API key path, hiding save/summary actions until they are needed, removing failed-key side effects, and aligning beginner docs with the local WebUI path.
2026-06-22 13:04:05 +08:00
chengyongru
fa5f7f5b88 fix: make onboarding api-key first
Maintainer edit: collapse the first-run wizard to an API-key-only Quick Start and move lower-frequency provider, model, channel, gateway, and tool settings behind Advanced Settings.
2026-06-22 13:04:05 +08:00
chengyongru
1dbec3da50 fix: simplify beginner quick start
Maintainer edit: reduce the default onboarding path to a recommended local WebUI setup that only asks for an OpenRouter key, while keeping the detailed provider/channel flow available for advanced setup.
2026-06-22 13:04:05 +08:00
chengyongru
84143d31b2 refactor: reuse onboard config refresh path
Simplify pass: share the existing-config refresh flow between non-interactive defaults and declined overwrite prompts without changing behavior.
2026-06-22 13:04:05 +08:00
chengyongru
3d773d9054 fix: preserve config during non-interactive defaults onboarding
Maintainer edit: make explicit --defaults refresh existing configs without prompting when no TTY is available, preserving user values for CI and Docker runs.
2026-06-22 13:04:05 +08:00
chengyongru
9c7d1c9507 Use channel login in onboarding wizard 2026-06-22 13:04:05 +08:00
chengyongru
db68fc1c09 Use provider registry in quick start 2026-06-22 13:04:05 +08:00
chengyongru
f9f5a19910 Route WebUI quick start through channel config 2026-06-22 13:04:05 +08:00
chengyongru
0097488eed Keep quick start channels opt-in 2026-06-22 13:04:05 +08:00
chengyongru
fc7971b3b6 Improve onboard wizard setup flow 2026-06-22 13:04:05 +08:00
Xubin Ren
9db3dc5e32 docs(readme): update news through 2026-06-20 2026-06-21 17:14:53 +08:00
Xubin Ren
dbf3c4b245 feat(sdk): expand Python runtime controls 2026-06-21 16:55:23 +08:00