Skip to content

chore: sync master into dev - #9679

Merged
LIghtJUNction merged 17 commits into
devfrom
sync/master-into-dev-20260813
Aug 14, 2026
Merged

chore: sync master into dev#9679
LIghtJUNction merged 17 commits into
devfrom
sync/master-into-dev-20260813

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Merge the 16 commits currently on master but missing from dev.
  • Resolve 14 conflicts while preserving dev-specific behavior.
  • Keep master unchanged; this PR targets dev only.

Conflict-resolution highlights

  • Integrate SharedPreferences initialization/cleanup and the deadlock fix.
  • Add PowerShell 7 shell resolution.
  • Integrate QQ official chunked upload and failure propagation.
  • Integrate SSYCloud provider support and related dashboard/localization updates.

Validation

  • Python conflict-resolution files compile successfully.
  • Ruff passes for all conflict-resolved Python files.
  • Russian locale JSON files parse successfully.
  • Dashboard production build passes.
  • Targeted Python suite: 166 passed; 2 environment-specific psutil.NoSuchProcess failures reproduced independently in the sandbox.
  • No conflict markers; git diff --check passes.

This supersedes #9677, whose head/base direction could not carry the conflict-resolution commit safely.

Summary by Sourcery

Synchronize dev with recent master changes, including async shared preferences, provider/tool APIs, Windows shell improvements, QQ Official chunked uploads, SSYCloud provider integration, and dashboard/docs updates.

New Features:

  • Add SSYCloud (胜算云) chat completion provider with dashboard integration and documentation.
  • Support PowerShell 7 shell resolution for local and managed Windows commands.
  • Introduce chunked upload support for large QQ Official media files in C2C and group chats.

Bug Fixes:

  • Ensure QQ Official media upload failures propagate as errors instead of silent None results.
  • Fix audio format conversion when AMR bytes are misnamed as WAV and avoid unnecessary transcoding.
  • Return platform send errors from SendMessageToUserTool so agents receive explicit tool failures.
  • Resolve knowledge base emptiness checks to distinguish missing KBs from empty ones and log misconfiguration warnings.
  • Stabilize video attachment path handling and managed shell output formatting in tests.

Enhancements:

  • Refactor shared preferences into an async, cached store with non-blocking sync APIs and lifecycle-managed initialization/cleanup.
  • Add async variants for provider selection and LLM tool activation/deactivation across context, manager, and StarTools APIs.
  • Improve group chat context handling by recording JSON cards and summarizing shared card content.
  • Enhance dashboard UI theming, provider config hints, sponsor sections, and deployment documentation across multiple locales.
  • Aggregate platform statistics directly from PlatformStat records and compute hourly message time series in StatService.
  • Allow knowledge base lookup by both name and UUID and warn when configured knowledge bases are missing.
  • Update README and docs to highlight RainYun deployment, clarify supported platforms/providers, and reorganize deployment options.

Build:

  • Bump AstrBot project version from 4.27.2 to 4.27.3 in packaging metadata.

Documentation:

  • Update multilingual READMEs and provider docs to describe new deployment options, sponsors, supported platforms, and ShengSuanYun integration.
  • Add changelog entry for version 4.27.3 capturing performance, reliability, and provider improvements.

Tests:

  • Add unit and integration tests for shared preferences caching and async write ordering.
  • Add tests for QQ Official chunked uploads, error propagation, and Windows shell selection behavior.
  • Extend media, group chat context, provider selection, StatService, KB lookup, and tool manager tests to cover new async paths and edge cases.

Soulter and others added 17 commits August 12, 2026 19:20
* 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>
* feat: 插件市场支持按下载量排序

为插件市场现有的前端本地排序补充下载量选项,复用已规范化的 download_count,不改变默认推荐顺序、后端接口和 OpenAPI。

新增稳定且不修改输入的下载量排序工具:支持升降序、未知值双向置底、非法值兜底及相同值原始顺序保留;接入市场排序控件并补齐中、英、俄三语文案。

新增 9 项专项单元测试,覆盖正常排序、零值、缺失与非法值、负数、数字字符串、小数、稳定性和输入不可变。验证通过 45 项 Dashboard Node 测试、额外性质检查、三语 JSON 校验、Vue 类型检查和生产构建。

* Delete dashboard/tests/marketPluginSort.test.mjs

* refactor: 内联插件市场下载量排序

删除独立的市场下载量排序工具,将下载量比较逻辑直接放在现有市场排序分支。

缺失下载量使用默认值 0,保持前端本地排序与现有排序行为一致。

验证:vue-tsc --noEmit;pnpm run build;node --test dashboard/tests/*.test.mjs;git diff --check。

---------

Co-authored-by: C₂₂H₂₅NO₆ <Sisyphbaous-DT-Project@users.noreply.github.com>
Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
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>
…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
* 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
* chore: bump version to 4.27.3

* Update changelog for version 4.27.3

Updated changelog for version 4.27.3 with new features, maintenance updates, and bug fixes.
* 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.
* fix: include JSON cards in group context

* fix: allow JSON cards to trigger active replies
* feat: log effective Windows local runtime shell

* chore: remove Windows shell logging tests

---------

Co-authored-by: Soulter <905617992@qq.com>
Copilot AI lite review requested due to automatic review settings August 14, 2026 05:48
@dosubot dosubot Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Aug 14, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @LIghtJUNction, your pull request is larger than the review limit of 150000 diff characters

@dosubot dosubot Bot added area:core The bug / feature is about astrbot's core, backend area:platform The bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on. area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. labels Aug 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@LIghtJUNction
LIghtJUNction merged commit e262833 into dev Aug 14, 2026
2 of 4 checks passed
@LIghtJUNction
LIghtJUNction deleted the sync/master-into-dev-20260813 branch August 14, 2026 05:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94af10b87f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +111 to 113
visibility, visible_user_ids = resolve_message_visibility(
raw_message,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass the raw Misskey message by keyword

When MisskeyPlatformEvent is used with a fallback client that lacks send_by_session, replies enter this branch, but resolve_message_visibility accepts user_id as its first positional parameter and raw_message only as its fourth. Passing the dictionary positionally therefore leaves raw_message unset and returns the default public visibility, potentially making replies to followers-only or specified notes public. Call it with raw_message=raw_message, as the deprecated wrapper previously did.

Useful? React with 👍 / 👎.

Comment on lines +168 to +169
if completion is not None and not completion.done():
completion.set_exception(exc)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Revert optimistic cache entries when persistence fails

When a database mutation fails—for example because SQLite is locked or the disk is full—the completion future is failed here, but _submit_write has already applied the put, remove, or clear operation to _cache, and the failed operation is permanently removed from the queue. Subsequent sync and async reads therefore return a value that was never persisted, while the caller received an exception and the value reverts after restart; the failure path should restore the previous cache state or retain the operation for a safe retry.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core The bug / feature is about astrbot's core, backend area:platform The bug / feature is about IM platform adapter, such as QQ, Lark, Telegram, WebChat and so on. area:provider The bug / feature is about AI Provider, Models, LLM Agent, LLM Agent Runner. size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.