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>
* 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.
* 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>
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.
* 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
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.
* 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.
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
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>
* 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>
* 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
* 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.
* 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>