2918 Commits

Author SHA1 Message Date
Xubin Ren
dac4e39bcf
Merge PR #4299: feat(cron): bind scheduled automations to sessions
feat(cron): bind scheduled automations to sessions
2026-06-13 00:07:55 +08:00
Xubin Ren
1b3b322674
Merge PR #4226: feat(bridge): WhatsApp forwarded message detection, startup guard, and contact handling
feat(bridge): WhatsApp forwarded message detection, startup guard, and contact handling
2026-06-13 00:05:58 +08:00
chengyongru
d72d0102d9 style: trim orphan toolcall comments
maintainer edit: keep the invariant comments in production code but remove repeated issue background from tests.
2026-06-13 00:05:03 +08:00
chengyongru
33e6da14d8 fix: drop tool results missing call ids
maintainer edit: treat tool messages without tool_call_id as orphaned during session persistence so malformed results cannot survive into history.
2026-06-13 00:05:03 +08:00
tangtaizhong666
eb25df9b49 fix(session): never persist tool results without a declared tool call 2026-06-13 00:05:03 +08:00
tangtaizhong666
2ebf7e2eef fix(session): keep placeholder for tool results filtered to empty 2026-06-13 00:05:03 +08:00
tangtaizhong666
ac5e84d453 fix(session): anchor save boundary to prompt prefix size (#4006)
build_messages merges the current message into a same-role history tail,
shrinking the prompt prefix to 1 + history_count. The save boundary
assumed a standalone current message and skipped one message too many,
cutting the first new-turn assistant message (with its tool_calls) from
persistence while keeping its tool results - producing orphaned tool
results in session history.
2026-06-13 00:05:03 +08:00
tangtaizhong666
df832a37e9 test(session): reproduce orphaned tool results from save-boundary overshoot (#4006) 2026-06-13 00:05:03 +08:00
chengyongru
30640e9e00 docs: clarify model prefix provider resolution 2026-06-13 00:04:13 +08:00
chengyongru
c282012607 fix: resolve auto custom provider settings state
maintainer edit: use the resolved provider row when WebUI settings evaluates auto-selected providers, so named custom providers follow their apiBase-based configured state instead of the legacy has_api_key fallback.
2026-06-13 00:04:13 +08:00
chengyongru
af9f9ebfd7 fix: reject custom provider alias conflicts
maintainer edit: reject arbitrary custom provider keys that normalize to built-in provider names so runtime and WebUI settings cannot disagree about whether a provider is dynamic or built in.
2026-06-13 00:04:13 +08:00
chengyongru
b2d00a4ce0 fix: strip dynamic custom provider route prefixes
maintainer edit: preserve provider-prefix CLI routing for named custom providers by stripping only the matched dynamic route prefix before sending the model id to OpenAI-compatible endpoints. This keeps ordinary namespaced model ids intact when the provider is selected explicitly.
2026-06-13 00:04:13 +08:00
chengyongru
09d24e6c25 fix: validate named custom provider endpoints 2026-06-13 00:04:13 +08:00
chengyongru
a9308eb8e2 docs: clarify custom provider protocol support
maintainer edit: spell out that arbitrary named custom providers use the OpenAI-compatible request format only, and point Anthropic-compatible proxies to the built-in anthropic provider with apiBase.
2026-06-13 00:04:13 +08:00
chengyongru
69d66e0d6a docs: document named custom providers
maintainer edit: explain how to configure arbitrary OpenAI-compatible provider names, including multiple endpoints, model presets, and troubleshooting guidance.
2026-06-13 00:04:13 +08:00
chengyongru
57ced7930d refactor: simplify dynamic provider settings tests
maintainer edit: keep the WebUI dynamic-provider behavior unchanged while reducing repeated test setup and tightening the small dynamic-provider helper.
2026-06-13 00:04:13 +08:00
chengyongru
37ae655fa6 fix: expose dynamic custom providers in WebUI settings
maintainer edit: WebUI settings still treated non-registry custom providers as unknown, so users could not select them in model configurations or fetch their model list. Reuse dynamic provider specs for settings payloads, model-list requests, and provider updates.
2026-06-13 00:04:13 +08:00
chengyongru
68c6844c0b fix: preserve dynamic custom provider semantics
maintainer edit: treat arbitrary custom provider names as direct OpenAI-compatible providers, validate their api_type consistently, and avoid Pydantic instance-field warnings in fallback routing.
2026-06-13 00:04:13 +08:00
wangjingguang002
e9e1489cee feat: support multiple custom OpenAI-compatible providers
This change allows users to define arbitrary custom providers in config:

providers:
  my_provider:
    api_base: ...
    api_key: sk-xxx

Usage:
  nanobot /my_provider/gpt-4 hello
  nanobot --provider my_provider hello

Changes:
- ProvidersConfig: add extra=allow to accept arbitrary fields
- _match_provider: check for custom provider by prefix and by fallback
- registry: add create_dynamic_spec() for dynamic provider specs
2026-06-13 00:04:13 +08:00
chengyongru
e1ff0f37d9 fix: preserve WhatsApp forwarded metadata
maintainer edit: carry the bridge isForwarded flag into channel metadata so forwarded voice messages remain distinguishable after transcription.
2026-06-12 18:21:47 +08:00
chengyongru
32d8a1dd7b fix: hide internal cron prompts from webui 2026-06-12 18:17:28 +08:00
chengyongru
0505a4fb2a Merge origin/main into whatsapp bridge improvements 2026-06-12 18:16:24 +08:00
chengyongru
a50b3ac0f2 fix: harden cron session automation flows 2026-06-12 18:13:25 +08:00
chengyongru
b5f9d51b5b chore: drop unrelated chat apps docs change 2026-06-12 17:07:40 +08:00
chengyongru
2248527971 fix: show cron bindings before deleting sessions 2026-06-12 17:02:29 +08:00
chengyongru
8335554894 refactor: migrate legacy cron payloads to bound sessions 2026-06-12 16:51:20 +08:00
chengyongru
af8192dc38 refactor: move bound cron execution out of gateway 2026-06-12 15:50:36 +08:00
chengyongru
5ae907bc2f refactor: store cron origin delivery context 2026-06-12 15:07:25 +08:00
chengyongru
b232a52794 fix: tighten cron session deletion UX 2026-06-12 14:51:02 +08:00
chengyongru
c4b64a4caf refactor: preserve origin session routing for cron 2026-06-12 14:21:09 +08:00
chengyongru
bc18142650 chore: drop cron design note from pr 2026-06-12 14:07:55 +08:00
chengyongru
80524e9e88 refactor: bind cron jobs to origin sessions 2026-06-12 14:00:53 +08:00
chengyongru
271b3651d7 refactor: use cron turn naming internally 2026-06-12 11:57:35 +08:00
chengyongru
d9d481bc15 refactor: centralize cron session metadata keys 2026-06-12 11:43:23 +08:00
chengyongru
0e3a57b371 docs: clarify cron session ownership 2026-06-12 11:12:26 +08:00
chengyongru
0ff8cd0cb3 fix: honor unified session for webui automations 2026-06-12 10:19:12 +08:00
chengyongru
1ad9d77bc7 fix: avoid completed cron tail pending state 2026-06-12 00:54:32 +08:00
chengyongru
e46a99ced9 fix: bind webui cron jobs to visible session 2026-06-12 00:28:12 +08:00
brendanlevy
2d9260cb9f feat(slack): add groupRequireMention for allowlist channels
Slack's groupPolicy could either restrict to specific channels
("allowlist") or require an @mention ("mention"), but not both: in
allowlist mode the bot replied to every message in approved channels.

Add a groupRequireMention flag so that, when groupPolicy is "allowlist",
the bot only responds in channels listed in groupAllowFrom AND only when
@mentioned. Mirrors Signal's group.requireMention. No effect for the
"mention"/"open" policies, so existing configs are unchanged.

Extract the mention check into _is_mention and reuse it from both the
mention and allowlist branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 00:23:27 +08:00
chengyongru
29f1473940 fix: keep session automations bound-only 2026-06-12 00:15:57 +08:00
chengyongru
369237f6a8 fix: allow slower webui chat creation 2026-06-11 23:53:51 +08:00
chengyongru
8dac6b2889 fix: show websocket cron jobs in automations 2026-06-11 23:53:45 +08:00
chengyongru
3725b42e0e fix: use shared bound cron predicate
maintainer edit: make gateway execution, WebUI automation listing, and delete protection agree on the new bound cron shape. Legacy delivery payloads that carry sessionKey are excluded from the WebUI-bound automation surface.
2026-06-11 23:09:21 +08:00
chengyongru
b4b6c04657 fix: preserve legacy cron delivery payloads
maintainer edit: keep existing cron jobs with legacy delivery fields on the legacy execution path, even when they already carry a sessionKey. This preserves deliver=false behavior and channel-specific routing metadata for upgraded jobs.
2026-06-11 22:26:06 +08:00
chengyongru
f82ab9f192 fix: record cancelled cron runs
maintainer edit: treat job-level CancelledError as a failed cron run so bound automation cancellations update run history and do not break subsequent scheduling.
2026-06-11 22:01:23 +08:00
chengyongru
a326ba40f4 feat(cron): bind scheduled automations to sessions 2026-06-11 19:48:07 +08:00
chengyongru
ffae1dca6d fix: keep Telegram streamed code blocks balanced
Maintainer edit: split final streamed Telegram markdown before rendering to HTML so long fenced code blocks do not produce unbalanced <pre><code> chunks while still respecting Telegram's rendered HTML limit.
2026-06-11 13:52:19 +08:00
axelray-dev
a5a816abaf fix(telegram): move fenced-code-block splitting into Telegram-specific helper
Move the fenced-code-block-aware splitting logic out of the shared
split_message helper (used by Signal, Slack, Discord, Weixin, etc.)
and into a Telegram-specific _split_telegram_markdown function.

The shared split_message remains a plain-text chunker. The Telegram
channel now uses _split_telegram_markdown for its raw Markdown paths
that feed _markdown_to_telegram_html, preventing broken HTML rendering
when splits fall inside fenced code blocks.

Also fixes a regression where content beginning with whitespace before
a fence could emit a whitespace-only chunk.

Addresses review feedback on #4257.
2026-06-11 13:52:19 +08:00
axelray-dev
131446fa61 fix(utils): make split_message fenced-code-block-aware
When split_message splits a long message, it now checks whether the
split point falls inside a fenced code block. If so, it either moves
the split to before the opening fence or closes/reopens the fence
across chunks, preventing broken HTML rendering.

Addresses #4250
2026-06-11 13:52:19 +08:00
Xubin Ren
b8a4ceb30c test(webui): cover siliconflow transcription settings 2026-06-10 23:05:12 +08:00