2824 Commits

Author SHA1 Message Date
Flávio Veloso Soares
ec5460d23e feat(email): add configurable post-action handling 2026-06-09 14:50:59 +08:00
Flávio Veloso Soares
85ab55aeee refactor(email): extract IMAP session helper 2026-06-09 14:50:59 +08:00
chengyongru
5bd4a83e85 fix(webui): render TeX math delimiters 2026-06-09 14:50:49 +08:00
chengyongru
0a396aa6e2
Improve tool call validation strictness (#4190)
* Improve tool call validation strictness

Reject near-miss tool names without executing suggested tools. Require object-shaped tool parameters while preserving only lossless JSON wire-shape normalization.

* Tighten tool call argument validation

* Simplify tool argument validation tests

* Improve tool name suggestions

* Simplify tool suggestion helpers

* Limit tool suggestions to canonical matches

* Allow repair only for tool history replay

* Clarify non-object tool argument errors

* Inline replay tool argument normalization

* Track only successful tool executions

* Reject JSON null tool arguments
2026-06-09 14:50:40 +08:00
comadreja
f3eb2aa08b feat(transcription): add AssemblyAI as transcription provider
Add AssemblyAI as a third transcription provider option alongside
OpenAI and Groq. AssemblyAI offers better accuracy for certain
audio types (distant voices, noisy environments) and serves as a
reliable fallback when other providers struggle.

Changes:
- Add AssemblyAITranscriptionProvider class in providers/transcription.py
- Add 'assemblyai' option in base channel's transcribe_audio()
- Per-channel configuration via transcriptionProvider in config

Usage:
  Set transcriptionProvider: 'assemblyai' and provide an AssemblyAI
  API key via transcriptionApiKey in the channel config.
2026-06-09 05:33:18 +08:00
Xubin Ren
f183b37542 test(webui): cover Xiaomi MIMO provider alias 2026-06-09 04:29:09 +08:00
NanoBot
c20ecc52d7 feat(transcription): add Xiaomi MiMo ASR provider (mimo-v2.5-asr)
Add support for Xiaomi MiMo ASR as a third transcription backend alongside
Groq and OpenAI Whisper. Xiaomi ASR uses the /v1/chat/completions endpoint
with base64-encoded audio input, rather than the standard Whisper multipart
upload format.

Co-Authored-By:连 <lian@tangping.homes>
2026-06-09 04:29:09 +08:00
Xubin Ren
552ec18a3c test(webui): cover OpenRouter provider brand 2026-06-09 04:01:37 +08:00
Ilia Breitburg
0eb3010e40 feat(transcription): configurable STT model + OpenRouter provider
Add a `transcriptionModel` channel setting and an OpenRouter transcription
backend so voice messages can be transcribed through OpenRouter's
speech-to-text endpoint (e.g. nvidia/parakeet-tdt-0.6b-v3, openai/whisper-1),
alongside the existing Groq/OpenAI Whisper providers.

- schema: add channels.transcriptionModel (None = provider default)
- providers/transcription: extract a shared POST/retry skeleton; add a
  JSON+base64 OpenRouterTranscriptionProvider; make the STT model a
  constructor param on all providers instead of hardcoding it
- channels: route transcriptionProvider="openrouter" and thread the model
  through the manager to each channel
- docs + tests

Only dedicated STT models work on OpenRouter's transcription endpoint;
chat LLMs (e.g. google/gemini-3.5-flash) are rejected there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 04:01:37 +08:00
axelray-dev
28f3a20d64 feat(providers): add extra_query config for OpenAI-compatible providers
Adds ProviderConfig.extra_query, threaded into AsyncOpenAI(default_query)
so that Azure-style gateways requiring query params like api-version can
be configured without URL hacks.

Also updates provider_signature to track extra_query changes so per-turn
refresh rebuilds the provider when the value changes.

Addresses the extra_query portion of #4204. The max_completion_tokens
model-awareness enhancement is intentionally left separate.
2026-06-09 03:18:14 +08:00
Xubin Ren
9c81280300
feat(transcription): add shared voice input support (#4232)
* feat(webui): add voice transcription input

* feat(webui): render ANSI output in code blocks

* refactor(webui): isolate voice recorder logic

* refactor(transcription): keep websocket ingress thin

* refactor(transcription): resolve channel audio settings on demand

* style(webui): neutralize voice waveform color

* feat(webui): add voice input tooltip

* feat(webui): add voice input keyboard shortcut

* fix(webui): distinguish voice shortcut platforms

* fix(webui): place voice button after model selector

* refactor(webui): share voice hold recording helpers

* fix(desktop): allow microphone voice input

* fix(webui): stabilize token usage month labels

* feat(webui): show voice input on settings overview

* fix(webui): label voice capability as recognition

* fix(webui): align capability overview status

* refactor(webui): isolate transcription socket handling

* fix(webui): soften silent voice waveform

* refactor(audio): clarify transcription service location

* docs(transcription): clarify audio and provider boundaries

* fix(exec): reduce session output polling flake
2026-06-09 01:08:49 +08:00
chengyongru
06d454a225 test: cover MCP redirect guard wiring
Maintainer edit: make the unsafe redirect regression go through connect_mcp_servers so both SSE and streamable HTTP prove that the request hook is attached to the MCP clients before redirects are followed.
2026-06-08 16:03:57 +08:00
chengyongru
a73924f77e docs: document MCP SSRF allowlist behavior
Maintainer edit: explain that HTTP/SSE MCP now uses the shared SSRF guard before connecting and before following redirects, so local or private HTTP MCP endpoints require an explicit tools.ssrfWhitelist entry.
2026-06-08 16:03:57 +08:00
Stellar鱼
ed0aeb1ea9 fix(mcp): reject unsafe HTTP URLs before probe 2026-06-08 16:03:57 +08:00
chengyongru
6e6470daa0 docs: remove nightly branch guidance 2026-06-08 16:03:24 +08:00
chengyongru
8fe0149c65 refactor(webui): simplify token usage heatmap 2026-06-08 16:02:12 +08:00
chengyongru
7510918610 fix(webui): align token usage heatmap 2026-06-08 16:02:12 +08:00
chengyongru
631fdb4a46 test: cover empty reasoning_content history preservation
maintainer edit: add SDK-object and tool-call history regressions so the empty-string reasoning_content fix is covered across both parse branches and the sanitized request path.
2026-06-08 01:08:27 +08:00
michaelxer
05de864f5b fix: preserve empty-string reasoning_content instead of coercing to None
Custom providers (e.g. DeepSeek) may return reasoning_content as an
empty string "" to explicitly indicate no reasoning occurred. The
previous truthiness checks (, ) treated "" as falsy
and converted it to None, which caused the field to be dropped from
the message history entirely. Providers that require reasoning_content
on all assistant messages then rejected subsequent requests.

Replace truthiness checks with identity checks () so that
empty-string reasoning_content is preserved as-is. The streaming path
is unchanged since an empty join genuinely means no chunks received.

Fixes #4105
2026-06-08 01:08:27 +08:00
dvp
4f5f965f09
fix(whatsapp): handle LID group mentions (#2663)
Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
2026-06-07 18:02:39 +08:00
Xubin Ren
ab9f49970d
feat(desktop): polish desktop shell and shared WebUI surfaces (#4195)
* feat(desktop): add native host scaffold

* feat(webui): track turns and usage in gateway

* feat(webui): polish desktop chat experience

* feat(apps): add ArcGIS and Joplin logos

* feat(desktop): polish shell and shared surfaces

* fix(webui): avoid preview chips for glob references

* test: align CI expectations for token fallback

* feat(webui): preview prompt rail entries

* feat(webui): add prompt navigator drawer

* style(webui): refine prompt navigator placement

* style(webui): align prompt navigator with header actions

* style(webui): simplify prompt navigator header

* refactor(webui): clean thread resource refresh

* feat(desktop): add native reply notifications

* fix(webui): preserve desktop restart and replay state

* fix(desktop): harden gateway proxy startup

* fix(web): fall back when readability is unavailable

* fix(desktop): hide window instead of closing on macos

* fix(webui): unify desktop header actions

* fix(webui): simplify prompt history rows

* fix(desktop): log notification delivery failures

* chore(desktop): clean source package artifacts

* fix(cron): support one-time relative reminders

* fix(webui): reveal scroll button in place

* Revert "fix(cron): support one-time relative reminders"

This reverts commit 4c4661da120a3c7283e0768412bae48604e7390b.

* refactor(webui): extract token usage heatmap

* docs(desktop): clarify contributor guides

---------

Co-authored-by: chengyongru <2755839590@qq.com>
2026-06-06 19:49:33 +08:00
Xubin Ren
a1b9577224 test(image): cover dropping null OpenAI image params 2026-06-06 19:35:46 +08:00
04cb
a4cf0f9514 fix(providers): allow dropping default OpenAI image params via null extraBody (#4167) 2026-06-06 19:35:46 +08:00
Xubin Ren
73353785a0 docs(sdk): document Nanobot teardown 2026-06-06 15:35:28 +08:00
axelray-dev
57fa37dcfe fix(sdk): close MCP connections from Nanobot facade
The SDK opened MCP connections through AgentLoop.process_direct but
never called close_mcp, leaving stdio MCP generators to be finalized
during asyncio shutdown from a different task, producing a RuntimeError
about exiting a cancel scope in a different task.

Add aclose() that delegates to AgentLoop.close_mcp (which already
drains background tasks and closes MCP stacks), plus __aenter__ and
__aexit__ so the SDK works as an async context manager.

Fixes #4211
2026-06-06 15:35:28 +08:00
Xubin Ren
6a0368b32f fix(telegram): route /skill command 2026-06-05 18:48:51 +08:00
Xubin Ren
935a37182d docs(command): document /skill command 2026-06-05 18:48:51 +08:00
EndeavourYuan
6b6be20f32 feat(command): add /skill slash command to list enabled skills
- Register /skill in BUILTIN_COMMAND_SPECS with wrench icon
- Add cmd_skill handler that lists skill names and descriptions
- Disabled skills are excluded from the output
- Add 6 tests covering empty list, names/descriptions, disabled
  filtering, fallback description, markdown output, and router
  registration
2026-06-05 18:48:51 +08:00
chengyongru
710d00a179 fix(webui): persist user messages for refresh 2026-06-05 16:13:51 +08:00
chengyongru
3da68ac7fe Fix pairing for Weixin and Telegram DMs 2026-06-05 16:13:31 +08:00
chengyongru
d435cb0b21 fix: harden custom image provider compatibility
Maintainer edit: preserve provider-specific size hints for custom image generation endpoints while keeping the default 1K mapping compatible. Clarify the custom provider contract in docs and cover response_format/size overrides in tests.
2026-06-05 15:56:03 +08:00
chengyongru
ae17a79bdf fix: harden custom image generation config
Maintainer edit: require providers.custom.apiBase before making custom image requests and allow unauthenticated local endpoints by omitting Authorization when no apiKey is configured.
2026-06-05 15:56:03 +08:00
axelray-dev
748b28da01 feat(image): support custom image generation provider
Addresses #4132.

Add CustomImageGenerationClient for any OpenAI-compatible image generation
API (POST {apiBase}/images/generations). Uses the existing providers.custom
config slot. No schema changes required.

Tests: 54 passed, ruff clean.
Signed-off-by: axelray-dev <110029405+axelray-dev@users.noreply.github.com>
2026-06-05 15:56:03 +08:00
chengyongru
c574b028c1 fix(feishu): allow punctuation after mention placeholders
maintainer edit: Keep the shared-prefix guard for Feishu numbered mention keys while still resolving placeholders followed by punctuation, matching the previous user-visible mention behavior.
2026-06-05 15:55:53 +08:00
Xubin Ren
894811db8b fix(feishu): strip leading bot mention before commands 2026-06-05 15:55:53 +08:00
Kunal Karmakar
fa423dffbc Remove check from the test 2026-06-05 01:17:34 +08:00
Kunal Karmakar
9fdc6f892a Fix test 2026-06-05 01:17:34 +08:00
Kunal Karmakar
c849ff6eec Address PR review comments 2026-06-05 01:17:34 +08:00
Kunal Karmakar
ba3fa38e97 Add support for Azure AAD based Auth 2026-06-05 01:17:34 +08:00
chengyongru
39454534d4 fix: isolate run-level hook snapshots 2026-06-05 01:09:45 +08:00
chengyongru
8933da1ec5 fix: harden run-level hook lifecycle
maintainer edit: keep cancellation out of on_error so shutdown paths do not look like run failures, and let the SDK capture hook use the authoritative after_run snapshot.
2026-06-05 01:09:45 +08:00
chengyongru
2ea226055e feat: add run-level agent hook lifecycle 2026-06-05 01:09:45 +08:00
chengyongru
c77ca16d91 fix: preserve uv pip update reinstall semantics
Maintainer edit: the uv fallback for CLI app updates now keeps the force-reinstall behavior from the python -m pip path by using uv pip install --reinstall, with unit coverage for the generated argv.
2026-06-04 19:41:51 +08:00
axelray-dev
c2e9064b35 fix: remove unsupported -y flag from uv pip uninstall fallback
uv pip uninstall does not support the -y (assume-yes) flag. Remove it
from the uv fallback argv while keeping it for the python -m pip
uninstall path.

Reported-by: chengyongru
2026-06-04 19:41:51 +08:00
axelray-dev
6d827efb0e test: explicitly stub _pip_available in pip-path tests
CI's uv-managed Python does not have pip importable, so the runtime
falls back to uv pip. Four tests that verify the python -m pip path
were failing because _pip_available() returned False in CI.

Monkeypatch _pip_available to True in tests that intentionally verify
the pip code path, so they pass regardless of the CI Python
environment.
2026-06-04 19:41:51 +08:00
axelray-dev
a37e58a29e fix(cli): fall back to uv pip when pip is unavailable
When nanobot is installed via uv tool install, sys.executable points to
a Python that does not have pip available as a module. _pip_install_argv
and _pip_uninstall_argv always used [sys.executable, -m, pip, ...]
which fails in that environment.

Add _pip_available() helper that checks importlib.util.find_spec('pip').
When pip is not available and uv is on PATH, fall back to:
  uv pip install --python <sys.executable> ...
  uv pip uninstall --python <sys.executable> -y ...
If neither pip nor uv is available, raise CliAppError.

Fixes #4158
2026-06-04 19:41:51 +08:00
chengyongru
24e56fcf07 test: improve deterministic unit test coverage 2026-06-04 19:41:32 +08:00
Xubin Ren
87bd56468c fix(webui): show platform-specific new chat shortcut 2026-06-04 14:01:21 +08:00
chengyongru
54d8d3010b fix: close search when starting new chats
maintainer edit: Close the session search dialog when the global new-chat shortcut navigates to the blank chat route, and expose the new shortcut through the sidebar button title so the shortcut is discoverable.
2026-06-04 14:01:21 +08:00
axelray-dev
4275678b43 feat(webui): add new chat keyboard shortcut
Add Cmd/Ctrl+Shift+O shortcut to start a new chat, matching the
convention used by ChatGPT, Claude.ai, and Gemini.

Addresses #4178

Signed-off-by: axelray-dev <110029405+axelray-dev@users.noreply.github.com>
2026-06-04 14:01:21 +08:00