393 Commits

Author SHA1 Message Date
Soulter fe3d77568b refactor: embed agent runner configuration in profiles (#9821)
* refactor: embed agent runner configuration in profiles

* fix: limit personas to local agent runner

* style(dashboard): refine unsaved config notice

* refactor: refine embedded local runner configuration

* refactor: centralize agent runner migrations
2026-08-29 22:40:46 +08:00
Soulter 69030851d4 feat: consolidate data dashboard and redesign conversations (#9846)
* feat: consolidate data dashboard

* feat: redesign conversation workspace

* docs: sync conversation OpenAPI artifacts

* docs: update data workspace navigation

* feat: group conversations by session

* fix: optimize mobile conversation workspace

* feat: refine log workspace

* fix: honor console auto-scroll setting

* feat: refine trace workspace
2026-08-27 18:53:02 +08:00
AnegasakiNene 8ea8ce613a fix(provider): preserve current user turn in Gemini history (#9738)
* fix: preserve current user turn in Gemini history

* test(provider): cover Gemini assistant-ending history
2026-08-27 00:57:35 +08:00
Ruihan Li c61fa088b7 fix: keep proactive agent history in contexts (#9818)
Preserve structured conversation history for cron and background-task wakeups so normal context truncation can process it.

Refs #9763

Co-authored-by: liruihan <liruihan@example.com>
2026-08-27 00:40:33 +08:00
mrlonely a436456d42 fix: stop empty LLM requests before provider dispatch (#9815) 2026-08-26 20:50:07 +08:00
Soulter 4f5941eb05 fix: hide internal personal WeChat settings (#9827) 2026-08-26 20:49:52 +08:00
Ruihan Li 690abefa5e fix: isolate rate limits by unified message origin (#9814)
* fix: isolate rate limits by unified message origin

* refactor: clarify rate-limit UMO key

---------

Co-authored-by: liruihan <liruihan@example.com>
2026-08-26 20:43:08 +08:00
Yoshy 09a56127ad fix: apply max_agent_step config to cron and background task agents (#9801)
* fix: apply max_agent_step config to cron and background task agents

The cron (scheduled task) and background task wake-up paths hardcoded
step_until_done(30) since the "extract main agent" refactor (0c5308a),
ignoring provider_settings.max_agent_step.

Read the value via coerce_int_config so invalid values fall back to the
default with a warning instead of crashing or silently degrading.

Fixes #9800

* test: cover max_agent_step propagation in cron and background wake-ups

Add parametrized tests asserting step_until_done receives the configured
max_agent_step on both the cron and background task agent paths, with
fallback coverage for missing, boolean-polluted, and numeric-string
config values.

* fix: clamp max_agent_step to a minimum of 1 in cron and background wake-ups

Non-positive provider_settings.max_agent_step values previously reached
step_until_done as-is: the local runner skipped all steps and forced a
final response, while the DeerFlow runner raised ValueError. Pass
min_value=1 to coerce_int_config so zero/negative values are clamped to
a usable minimum, and cover the zero case in both unit test suites.
2026-08-26 10:11:00 +08:00
Soulter 07013445f9 feat: improve default and local t2i rendering (#9803)
* feat: redesign default t2i template

* feat: improve local t2i rendering and migrate defaults

* fix: install CJK fonts in Docker image

* fix: preserve soft breaks and fit display math
2026-08-26 10:06:50 +08:00
Soulter 4d877c9919 fix: handle DingTalk app creation status (#9808) 2026-08-26 00:53:48 +08:00
LIghtJUNction d547fc491d fix: keep WeCom callback receive loop responsive (#9759)
* fix: keep WeCom callback receive loop responsive

* fix: support Anthropic httpx2 clients

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-08-25 17:34:40 +08:00
牧濑红莉栖(BOT) 9200e40d68 fix: stabilize OpenAI tool schema order (#9798) 2026-08-25 16:30:05 +08:00
楚风礼赞 68d0a99db4 fix: gray out commands of disabled plugins in behavior manager (#9664)
* fix: gray out commands of disabled plugins in behavior manager

Show inactive-plugin commands as 未启用, dim the whole row with
theme on-surface colors, and disable row actions.

Fixes #9562

* fix: address review comments on disabled-plugin commands

Keep the stored command enabled flag unchanged and expose plugin
activation separately. Allow viewing details, keep hover tooltips,
and cover serialized plugin_activated in unit tests.

* fix: preserve tooltips for disabled command actions

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-08-25 16:19:57 +08:00
Soulter 828412d537 fix: align Anthropic API base URL logic with OpenAI API (#9802) 2026-08-25 16:05:53 +08:00
Ruochen Pan c87b7733a5 fix(provider): adapt anthropic source to httpx2 rename in anthropic 1.0.0 (#9791)
anthropic 1.0.0 renamed the bundled ``_base_client.httpx`` module to
``_base_client.httpx2``. The previous ``getattr(_base_client, "httpx",
httpx)`` fallback silently reverted to the global httpx import, which can
break the SDK's isinstance validation when a proxy client is used. Resolve
the SDK's own module in version-agnostic order (httpx → httpx2 → global)
and update the corresponding unit test to assert against the same
resolution.
2026-08-24 10:33:29 +08:00
Soulter b8cd04e4da fix: stop preloading entire preferences table into memory (#9747)
* fix: stop preloading entire preferences table into memory

PR #9649 fixed an event-loop deadlock by preloading every row of the
preferences table into an in-memory mirror at startup. The table can
hold gigabytes of plugin KV data, so this can OOM the process.

- initialize() no longer performs an unfiltered get_preferences();
  the in-memory cache becomes a write overlay for read-after-write
  visibility only
- get_async() falls back to an async point query on overlay miss and
  never backfills the overlay
- deprecated sync get() falls back to a point query through a
  dedicated synchronous SQLite connection (the new
  SQLiteDatabase.get_preference_sync), so it never blocks on or
  deadlocks against the async pool; failures warn and return the
  default instead of raising
- sync range_get() now only covers values written by this process
  (no internal callers remain); full scans stay available via
  range_get_async()
- FIFO write queue semantics are unchanged

* fix: preserve synchronous preference range reads
2026-08-20 00:21:15 +08:00
Trainingcqy 9c895838d3 fix: convert telegram audio files into a Record component (#9702) 2026-08-19 12:46:18 +08:00
Soulter b9e565f3ba fix: remove knowledge base upload file limit (#9701) 2026-08-15 17:19:50 +08:00
Soulter fe22f758e9 fix: separate reasoning metadata from provider config (#9699)
Keep model reasoning capability metadata out of provider request configuration, sanitize legacy source-backed records, preserve standalone provider fields, and add a reasoning_effort request-body preset.
2026-08-15 16:33:16 +08:00
Wei Chengqian 62b254b3c4 fix(config): don't rotate dashboard password on password_change_required (#9665)
* fix(config): don't rotate dashboard password on password_change_required

* style: format test_config.py with ruff
2026-08-15 15:57:49 +08:00
xiaoxuan010 3bb5660219 fix: detect audio format from file content (#9612) 2026-08-14 00:51:01 +08:00
PeiPei233 de33730454 fix: include JSON cards in group context (#9655)
* fix: include JSON cards in group context

* fix: allow JSON cards to trigger active replies
2026-08-14 00:33:48 +08:00
xxshu26 27689db58c feat(provider): add SSYCloud chat completion provider (#9659) 2026-08-14 00:30:08 +08:00
Ruochen Pan 604392d9a8 Refactor: stat service deprecated stats (#9658)
* refactor(dashboard): migrate get_stat off deprecated stats methods

Rewrite StatService.get_stat to query PlatformStat directly via
db_helper.get_db(), following the existing get_provider_token_stats
pattern in the same file, instead of the deprecated
get_base_stats/get_grouped_base_stats/get_total_message_count.

- Windowed rows are fetched once with an explicit ORDER BY timestamp
  (the old get_base_stats relied on insertion order)
- Per-platform sums and hourly time-series buckets are aggregated in
  Python; total message count uses func.coalesce(func.sum(...), 0)
- Response shape is unchanged: platform entries keep the
  {name, count, timestamp} keys, now built as plain dicts so no
  deprecated po.Platform/Stats classes are instantiated
- Verified semantically identical against the old methods with an A/B
  comparison over a seeded database (time series, per-platform sums,
  total count, and empty-window case all match)

* test(dashboard): cover StatService.get_stat aggregation semantics

The existing test_get_stat route test only asserts the HTTP status and
the presence of the platform key, so an aggregation regression would
pass unnoticed. Add focused unit tests that seed PlatformStat rows and
assert the windowed per-platform sums, the global message total, the
hourly time-series bucket shape, the response key set, and the
empty-window behavior.
2026-08-13 15:10:03 +08:00
Soulter e9ae69f93a fix: prevent SharedPreferences deadlocks (#9649)
* fix: avoid blocking shared preference access

* docs: clarify shared preference cache roles

* docs: explain shared preference cache purpose

* docs: link cache rationale to pull request
2026-08-13 00:44:42 +08:00
lxfight 95181b6c27 fix(kb): support UUID fallback in get_kb_by_name and warn on missing KBs (#9636)
Fixes #9529.

When kb_names contains UUIDs instead of names, get_kb_by_name() would
return None and check_all_kb() would silently skip retrieval with only
a DEBUG-level log.

Modifications:
- get_kb_by_name() now falls back to UUID lookup when name match fails
- check_all_kb() distinguishes None (not found) from empty KBs and logs
  a WARNING with the count of missing KBs
- Add regression tests covering UUID lookup, name preference, and logging
2026-08-13 00:43:05 +08:00
Soulter dd9da23965 feat(qqofficial): add chunked file uploads (#9646)
Add a dedicated chunked uploader for large local QQ Official media. Keep C2C and group endpoints explicit, support server-provided part index bases, and retry transient upload operations.

Co-authored-by: Fuyan Yuan <33221728+TheRainstorm@users.noreply.github.com>
2026-08-12 23:25:24 +08:00
Soulter a9a1000e59 fix: propagate QQ media upload failures (#9644) 2026-08-12 23:11:21 +08:00
Wei Chengqian 123439d098 feat: support PowerShell 7 for Windows local shell (#9622)
* feat(config): add Windows PowerShell version option

* feat(computer): honor Windows PowerShell version in local runtime

* fix(computer): correct stale shell comment for configurable PowerShell

* refactor(computer): inline windows shell resolution per AGENTS.md

* test(computer): assert windows_shell in exec_managed call

* test: make shell tests cross-platform

Co-authored-by: Donoym <prober13c14@gmail.com>

* refactor(computer): auto-detect Windows shell instead of config

* fix(computer): drop stale cmd.exe references after shell auto-detect

* style: apply ruff format and import order

* Update astrbot/core/astr_main_agent.py

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: Donoym <prober13c14@gmail.com>
Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2026-08-12 21:01:42 +08:00
Soulter a9bb8a64ca fix: stabilize OpenAI HTTP client test 2026-08-12 10:42:17 +08:00
Zeyu Zhang 889feb908b fix: fix: restore missing WebChat sessions (#9607) 2026-08-12 10:33:50 +08:00
Trainingcqy 91ee487131 fix: convert Telegram video notes into a Video component (#9627) 2026-08-12 10:27:03 +08:00
Trainingcqy 939bdce0df fix(telegram): use static thumbnail for animated stickers (#9610) 2026-08-10 21:24:46 +08:00
lxfight aeccd857e1 fix(kb): restore complete knowledge base retrieval results (#9618)
* fix(kb): calibrate dense scores across knowledge bases

* fix(kb): retain distinct chunks from source documents
2026-08-10 21:21:36 +08:00
Soulter 30e20318cb fix: cancel stopped agent runs immediately (#9602)
* fix: cancel stopped agent runs immediately

* refactor: simplify stopped run history
2026-08-08 17:10:04 +08:00
Soulter 2418c6a0c7 fix: sync plugin skill state across the dashboard (#9596)
* fix: hide skills from disabled plugins

* fix: show disabled plugin skills in personas

* fix: align skill list query types

* fix: show disabled plugin skills in skills page

* style: dim inactive skills

* docs: regenerate public OpenAPI spec

* refactor: always include plugin skills
2026-08-08 12:05:14 +08:00
KazusaUwU 516c22ede9 fix: warn when an explicitly configured WebUI dist is stale (#9518)
* fix: warn when an explicitly configured WebUI dist is stale

resolve_dashboard_dist() returns an explicitly configured --webui-dir
immediately, without checking the version it declares. Every other branch in
the same function verifies compatibility and warns on a mismatch, so this is
the one way to end up serving assets that do not match the running core with
no diagnostic at all.

That is the case a packaged distribution hits: when the launcher updates the
backend but keeps its bundled WebUI directory, the dashboard silently stays on
the previous release. Features added by the new core are simply missing from
the UI and nothing explains why.

Behaviour is unchanged -- the directory is still served, since refusing to
serve it would be worse than serving an old one. It is just no longer silent.

* refactor: tidy the explicit WebUI dist resolution

Build the Path once instead of twice, and hold the version read for the
warning in a local so the log call only carries values.
2026-08-08 09:28:07 +08:00
Wei Chengqian f534c4fd5f fix: sanitize MCP tool names for LLM API (#9534) 2026-08-08 09:25:50 +08:00
Soulter ba2064455c feat: support passwordless desktop sessions (#9585) 2026-08-07 17:15:51 +08:00
Ruochen Pan 6da067c3bd refactor: migrate config preferences to async (#9584)
* refactor: migrate config preferences to async

* refactor: centralize config mapping persistence
2026-08-07 17:12:07 +08:00
Ruochen Pan 9fa0a198a4 refactor: remove sync shared preferences (#9582)
* refactor: migrate async session preference calls

* refactor: migrate internal preference calls to async

* perf: reuse tool permissions when listing tools
2026-08-07 12:20:18 +08:00
Ruochen Pan 78214cac5a feat: show effective AstrBot time in settings (#9581) 2026-08-07 11:25:51 +08:00
Ruochen Pan 5259c4b9c5 fix: inherit configured timezone for cron jobs (#9579) 2026-08-07 10:28:05 +08:00
Ruochen Pan 6e63474c13 test: isolate API key admin configuration (#9539) 2026-08-04 09:51:04 +08:00
Ruochen Pan 573367b7f3 fix: accept bearer token for backup downloads (#9525)
* fix: accept bearer token for backup downloads

* fix: parse backup bearer scheme case-insensitively
2026-08-03 15:12:45 +08:00
Soulter ba7b315749 chore: bump version to 4.27.1 (#9520)
* test: support latest OpenAI usage schema

* chore: bump version to 4.27.1
2026-08-03 00:01:00 +08:00
Soulter 6c19f34bd4 feat: add built-in skill creator and document skills (#9517)
* feat: add builtin skill creator

* feat: add builtin PDF skill

* feat: add builtin office skills

* fix: align closed capability status labels
2026-08-02 23:38:46 +08:00
Soulter 20c294fcaf feat: add stateless Responses API provider (#9515)
* feat: add stateless Responses API provider

* Potential fix for pull request finding 'CodeQL / Incomplete URL substring sanitization'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix: use versioned DeepSeek Responses API base URL

* style: format Responses API provider

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2026-08-02 23:15:50 +08:00
Soulter c68a2ea83b feat: add yes option to init command (#9514) 2026-08-02 22:52:15 +08:00
lxfight 6f9e22b0f5 perf: improve knowledge base retrieval quality (#9455)
* perf: improve knowledge base score fusion

* perf: diversify knowledge base source documents
2026-08-02 17:28:03 +08:00