78 Commits
Author SHA1 Message Date
Soulter 9f0334f6d5 refactor: make plugin locale and agent session lookups async (#11355)
* refactor: make plugin locale and agent session lookups async

* test: remove standalone locale lookup test
2026-11-24 22:10:11 +08:00
Soulter ddcab3238e feat: add system language for core and built-in replies (#11254)
* feat: add configurable system language for core replies

* feat: localize built-in replies within each plugin
2026-11-19 15:42:19 +08:00
Soulter 456217fc52 feat: background pending tools when steering arrives (#11142)
* fix: append steering input as user messages

* fix: group steering input into one user message

* feat: detach pending tools on steering and wake on completion

* fix: continue pending steering after plain replies

* test: decode prepared media file URIs on Windows

* fix: preserve whitespace in steering input

* fix: separate batched steering inputs with newlines

* docs: remove verbose steering implementation details

* fix: preserve Gemini user agents and verify background delivery

* fix: honor realtime segmented replies in QQ group chats

* revert: keep QQ streaming changes out of this PR

* test: align plugin page expectations with view metadata

* fix: preserve background tool permissions and result handling

* fix: retain wakeup ownership and initialize context before appending

* fix: combine background wakeup input into one user message

* test: remove redundant background wakeup coverage

* fix: relax background completion prompt restrictions

* fix: simplify background completion prompt
2026-11-18 11:13:21 +08:00
Soulter d890a0db11 feat(chatui): add tabbed workbench and resident plugin views (#11218)
* feat(chatui): add tabbed workbench and persistent session layouts

* feat(plugin): declare views in metadata with launcher targets
2026-11-17 21:22:12 +08:00
Soulter 3a93c9a30c feat(plugin): add interactive plugin message views (#11179)
* feat(chatui): add plugin views and shared view bridge

* fix(chatui): return fixed public messages for view errors

* feat(chatui): add tabbed workbench and resident plugin views

* fix(chatui): persist session workbenches in unified preferences

* fix: refresh workbench API docs and preserve Gemini user agent

* refactor: gate UI views on platform interaction capability

* docs: organize plugin views guides and document bridge types

* refactor: separate tabbed workbench from message views
2026-11-17 20:43:53 +08:00
一张白纸 3f46ce8f4e docs(plugin-new): change QQ Group (#11178)
* docs(plugin-new): change QQ Group

**Chit-Chat Group** change to **AstrBot Plugin & Agent interflow Group**.

* docs: update QQ group information and add community guidelines

* docs(plugin-new): remove group rules
2026-11-16 22:38:10 +08:00
Soulter 303a702a00 fix: persist assistant tool calls before execution (#11162) 2026-11-15 22:58:18 +08:00
Soulter eee9f81ca7 docs: streamline guides updated since v4.29.4 (#11154)
* docs: streamline guides updated since v4.29.4

* docs: retain original import compatibility notes

* docs: simplify structured decision guidance

* docs: clarify agent API usage scenarios

* docs: clarify agent runtime events heading

* docs: nest agent events and remove custom runtime guide

* docs: group conversation migration notes in versioned tips

* docs: remove outdated LLM introduction note

* docs: remove obsolete model API version tips

* docs: remove conversation method reference lists

* docs: remove narrow-window provider section and screenshots

* docs: split AI guide into focused topic pages

* docs: add Agent guides using an unambiguous file name

* docs: clarify legacy miscellaneous API guidance

* docs: remove outdated architecture overview

* docs: remove expired plugin reward event

* docs: explain plugin configuration with control examples and screenshots

* docs: collapse AI sidebar groups by default

* docs: refine sidebar spacing and typography

* docs: add breathing room after expanded sidebar groups

* docs: space expanded sidebar headings from child items
2026-11-15 15:40:58 +08:00
Soulter 863e675582 feat: expose prepared agent outputs and honor delivery policy (#11153)
* feat: expose prepared agent outputs and honor delivery policy

* fix: honor turn delivery policy in built-in media tools

* test: keep agent output regression coverage minimal

* docs: trim agent delivery policy explanation

* docs: simplify agent output usage guide
2026-11-15 13:02:50 +08:00
Soulter b1fd0f8e20 feat(agent): add metadata to programmatic turns (#11148) 2026-11-15 09:48:14 +08:00
Soulter c5ec2392eb refactor: migration to event log backend for conversation storage (#10077)
* stage

* refactor: linearize conversation events and reclaim plugin snapshots

* test: adapt master tests to event-context APIs after merge

- test_tool_loop_agent_runner: restore @pytest.mark.asyncio on
  test_step_notices_reach_model_once_per_threshold (lost in merge).
- test_cron_manager: give the build_main_agent / runner mocks the
  conversation_events field and an awaitable aclose, matching the
  event-writer wiring in cron/manager.py.

* style: apply ruff formatting to exclude_ids filter in sqlite.py

* test: adapt gemini/message-tools tests to event-context APIs

- test_gemini_source: fake_retry now accepts request_event_recorder,
  matching retry_provider_request's new keyword argument.
- test_message_tools: _DummyRespondEvent exposes conversation_events,
  which call_event_hook now reads when emitting the after-send hook.

* fix: merge duplicate chat history translations

* refactor: consolidate plugin conversation APIs

* refactor: bind conversation writers to agent execution context

* refactor: separate conversation migration and display projection

Remove deprecated conversation metadata methods and align architecture and plugin documentation with the current APIs.

* refactor: make conversation writer ownership explicit

Use per-run hooks instead of ambient writer and plugin identity bindings. Require explicit conversation IDs for append APIs and separate persistence from execution context mutation.

* fix: harden conversation event writes and request capture

* refactor: remove legacy checkpoints and unify conversation history

* perf: incrementally project acknowledged conversation events

* refactor: clarify agent event and persistence boundaries

* docs: remove event context design notes

* perf: reduce conversation SQL round trips and support PostgreSQL

* refactor: remove PostgreSQL support while retaining SQL optimizations

* refactor: store raw context once and filter temporary content on replay

* test: retain essential event context regression coverage

* refactor: derive conversation revisions from events

Remove persisted event head, context leaf and replay baseline pointers. Derive positions through indexed queries, migrate existing databases and preserve backup compatibility. Refresh conversation activity at turn settlement instead of every execution event.

* refactor: use compact IDs for conversation events
2026-11-14 23:46:45 +08:00
Soulter d66e3c229d feat: unify session configuration mappings and overrides (#11097)
* feat: unify session configuration mappings and overrides

* test: update persona regression mock for session overrides

* fix: preserve knowledge base IDs during session migration

* fix: scope effective configuration to each pipeline execution

* refactor: remove built-in persona command

* refactor: remove obsolete session service and plugin managers

* perf: avoid duplicate message configuration deepcopy

* refactor: keep message configuration snapshots internal

* refactor: make runtime configuration state explicit

* refactor: rename runtime configuration to AstrBotConfigSnapshot

* refactor: move config binding migration into migration package

* refactor: remove obsolete session configuration code

* fix: unify bot session mapping cleanup option

* fix: delete complete session mappings from bot editor

* test: update fixtures for effective session configuration

* refactor!: remove obsolete session status and batch APIs

* test: remove redundant retired endpoint assertions

* test: simplify session configuration regression coverage
2026-11-12 22:10:40 +08:00
Wei ChengqianandSoulter 3d4a213e31 feat(provider): add OpenAI Decisions API decision provider (#10968)
* feat(provider): add OpenAI Decisions API decision provider

Add an independent `openai_decision` provider backed by POST /v1/decisions.
It reuses DecisionService (ask/choose/yes_no) and never joins the main agent
flow.

- Map boolean/choice/score questions to predicate/choice/score with
  generated names; match answers by name, keep full distributions,
  confidence, fractional scores and the score legend.
- Send string state as text and dict/list-of-dict state as input_json;
  reject state and questions the API cannot express before sending.
- Treat refusals and contract violations as DecisionError; reuse the
  existing timeout, concurrency and retry conventions.
- Add the "OpenAI Decisions" config template, manager lazy import,
  single-string key validation, WebUI support and i18n hints.
- Document configuration and supported inputs; System One is unchanged.

* fix: clarify OpenAI Decisions model hint

* fix(provider): harden OpenAI decision request handling

* fix(provider): validate decision score consistency

* fix(provider): validate decision question input types

* fix(provider): support list state in OpenAI Decisions

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-11-10 20:51:32 +08:00
XTsatandXTsat b1d9bd8d2d feat(plugin-config): collapsible config groups with a collapsed schema flag (#11067)
* feat(dashboard): foldable plugin config groups with a declarative default state

Plugin config pages rendered every group flat, so a plugin with many fields
turned into one long page where the group you care about was hard to find.
`template_list` already solved this for its own entries, so the same folding is
now available for ordinary config groups in the plugin configuration dialog.

- `object` groups in the plugin config editor can be collapsed from their title:
  the whole title row is clickable, the hover highlight fills the card, folding
  uses `v-expand-transition`, and the header is reachable by keyboard
  (role/tabindex/Enter/Space/aria-expanded). The root plugin config object stays
  non-collapsible so dialog titles behave as before.
- Folding is opt-in through the `foldable` prop, which only the plugin config
  editor passes. Provider and platform editors share the same component and keep
  their flat rendering, so no other settings page changes.
- `collapsed: true` in the schema only decides the initial state: such a group
  starts folded, groups without it stay expanded. Folding and "starts folded"
  are therefore independent.
- Fold toggles are remembered for the current page instance only, via the
  in-memory helper `utils/configFoldState.mjs`: switching configs, reopening the
  dialog, or navigating within the page keeps the choice, while a reload follows
  the schema again instead of a stale preference. A remembered toggle always wins
  over the schema default, and a reloaded plugin schema re-seeds the groups the
  user has not touched.
- The plugin config dialog drops the previous plugin's schema before requesting
  the new one, so groups can no longer be toggled under a namespace that is still
  loading.
- The hover block is painted by a pseudo-element rather than by negative margins,
  so the header keeps its layout: its geometry comes from two custom properties
  the container publishes, `--config-group-inset` (its own padding) and
  `--config-group-radius` (its inner corner radius). Expanded and folded groups
  use the same block height; folded groups let the container clip the overshoot
  and round the corners. The whole block is only painted, never laid out, so
  titles never shift and hovering cannot cover a neighbouring group.

* docs(plugin-config): document the collapsible config groups

Describe the `collapsed` field next to the other schema keys, add a collapsible
group example, and spell out the semantics developers and users can rely on:
every `object` group can be folded, the flag only sets the initial state, the
fold state lasts for the current page, and the outermost config object cannot be
folded.

---------

Co-authored-by: XTsat <XTsat@users.noreply.github.com>
2026-11-10 20:34:20 +08:00
SoulterandGao Jinzhe 3e7da5afd9 feat: add profile-scoped subagent management (#11053)
Co-authored-by: Gao Jinzhe <2968474907@qq.com>
2026-11-09 09:48:57 +08:00
Soulter 6a782b7be6 refactor: run built-in agents through runtime sessions (#11052) 2026-11-09 09:48:25 +08:00
Helian Nuits 4df1a906b6 feat(dashboard): expose theme colors through the plugin bridge (#11046)
* feat(dashboard): expose theme colors to plugin page bridge

Include the active primary and secondary colors in plugin context updates. Resend context on color edits, resets and theme switches without changing sandbox permissions or forcing plugin styles. Cover reactive Vuetify colors and legacy bridge contexts, and document optional color handling in Chinese and English.

* docs(dashboard): simplify plugin theme bridge guidance

Remove the newly added theme bridge tests and keep the developer documentation focused on available color fields, context updates and fallback behavior.

* docs(dashboard): add concise theme color subscription example

* docs(dashboard): translate theme example comments into Chinese
2026-11-08 22:08:54 +08:00
Soulter 15e1b9996e fix: notify plugin views when SSE streams close (#10932)
* fix: notify plugin views when SSE streams close

* Delete dashboard/tests/pluginPageSSE.test.mjs
2026-11-01 18:42:57 +08:00
Soulter 734b357fe3 feat: add portable message buttons (#9809)
* fix: handle DingTalk app creation status

* feat: add portable message buttons

* test: mark command group messages as non-interactive

* feat: add button action timeouts and rename plugin filter

* feat: show bilingual notices for expired button actions

* refactor: nest button actions and styles under Button

* docs: describe current button API without draft history

* docs: list supported button platforms
2026-10-31 11:16:36 +08:00
lxfightandSoulter dad255c60f feat(provider): add decision provider with System One adapter (#10775)
* feat(provider): add decision provider service

* feat(provider): add System One decision adapter

* feat(dashboard): configure decision providers

* docs: document decision providers

* fix(provider): avoid logging decision response bodies

* fix(provider): roll back failed provider creation

* fix(provider): reject unknown decision option keys

* fix(provider): normalize invalid decision response encoding

* refactor(provider): inline decision provider lookup

* fix(dashboard): remove OpenAI-specific header hint

* fix(provider): bound decision latency

Use a two-second default timeout and treat request_max_retries as retries after the initial request, with no retries by default.

* test(provider): cover terminating an unknown provider

* fix(provider): relax decision probability validation

Make probability tolerance configurable, allow the selected option to deviate from the maximum within that tolerance, and include a bounded response summary in warnings and errors.

* fix(decision): cap state size and add yes_no default

Reject oversized decision state before dispatch and allow callers to provide a fail-open or fail-close fallback for yes/no questions.

* refactor(provider): avoid indexing missing provider IDs

Look up the provider instance once and return early for unknown IDs, removing repeated inst_map indexing from termination.

* fix(provider): enforce a total decision timeout

Cap the complete decision request, including retries and backoff, with a configurable five-second total timeout.

* fix(provider): limit concurrent decision requests

Use a per-provider semaphore with a configurable default limit of four concurrent requests.

* refactor(provider): narrow decision state type

Restrict decision state to str, list, or dict and expose the shared DecisionState alias through the plugin provider API.

* fix(provider): update decision tab order and provider logos

* fix(provider): use a single API key for System One

* fix(config): validate System One keys as strings

* chore: remove extra tests and changelog updates

* refactor(webui): group decision provider advanced settings

* refactor(decision): remove arbitrary state character limit

* refactor(decision): keep probability validation internal

* docs: remove decision provider setup section

* docs: remove English decision provider setup section

* refactor(decision): rename choice options to criteria

* feat(decision): support System One score questions

* docs: name decision convenience method arguments

* refactor(decision): use criteria in choose convenience method

* refactor(decision): split answers by question type

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-10-27 14:52:18 +08:00
Magenta QinandSoulter 866f6f420a feat: integrate SerpApi Google News API (#10773)
* refactor: migrate SerpApi requests to official Python SDK

* feat: add SerpApi Google News search

* refactor: restore direct HTTP requests for SerpApi

* Update unreleased.md

---------

Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
2026-10-27 11:38:07 +08:00
Soulter c766b43794 feat: add sender and umo source selectors for core and plugin (#10747)
* feat(dashboard): add user and session source selectors

* test(dashboard): remove selector interaction tests

* docs: remove WebUI guide changes from selector PR

* feat(dashboard): add session source refresh button

* feat(qq_official): cache group metadata before creating events

* feat(lark): cache group metadata before creating events

* fix(dashboard): order session sources and deduplicate user suggestions

* fix(lark): reuse sender name lookup for group chats

* docs(webui): add sid command hints to user and session selectors

* feat(dashboard): paginate recorded user selection

* feat(dashboard): align session source display with user rows

* fix(dashboard): keep session titles single-line with consistent fonts

* feat(dashboard): add hover copy buttons to user and session selectors

* fix(dashboard): reclaim copy button space and wrap selected session titles

* fix(dashboard): disable copy button fade transitions
2026-10-25 14:41:36 +08:00
Wei ChengqianandSoulter 1f1d3fb004 fix(dashboard): localize plugin names in sidebar (#10576)
* fix(dashboard): localize plugin names in sidebar

* test: simplify plugin sidebar i18n regression coverage

* Delete dashboard/tests/pluginSidebarItems.test.mjs

---------

Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com>
2026-10-18 18:24:32 +08:00
Soulter 8774e53ff4 feat: improve message tracing and add bounded SQLite history (#10515) (#10614)
* feat: expand message tracing and redesign trace explorer

* feat: add trace metadata chips and preserve response ownership

* feat: show full-width tracing list with optional details

* style: remove gray trace tab card

* feat: unify trace toolbar controls and use Vuetify datatable

* style: use native Vuetify trace table rows

* fix: prevent trace platform header wrapping

* feat: persist message traces in bounded SQLite storage

* fix: expose trace settings and preserve long prompt attributes

* docs: simplify trace storage setting hints

* feat: add trace history cleanup and disk usage accounting

* fix: finish event traces and fold Agent execution chains

* feat: fold long trace messages and consolidate persona metadata

* fix: hide redundant adapter event labels in traces

* refactor: remove redundant persisted span metadata

* feat: paginate trace history with Vuetify table controls

* style: reduce trace table text size

* style: increase trace table text to 13px

* style: flatten trace status chips and narrow platform column

* feat: show independent Agent and command trace types

* feat: show cumulative Agent token usage in trace details

* style: abbreviate trace token counts with k and M

* style: reduce trace table header height

* feat: show group and private chat trace types

* fix: include month and day in trace timestamps

* style: use system trace fonts and blue running status

* style: separate trace origin and sender metadata rows

* fix: trace successful proactive message tool deliveries

* feat: show model persona and tool counts on Agent headings

* style: prefix trace plugin chips with puzzle icons

* style: add icons and spacing to Agent metadata chips

* style: remove execution mode prefix from trace chips

* refactor: centralize response tracing without source attribution

* style: hide module metadata in trace details

* refactor: omit redundant module metadata from plugin traces

* refactor: remove obsolete module filtering from trace UI

* feat: expose trace recording toggle in system settings

* docs: simplify trace recording setting description

* feat: retain traces only for command responses and Agent calls

* fix: revert trace admission filtering and expand writer queue

* refactor: adopt OpenTelemetry SDK and simplify trace tests

* refactor: separate event and trace execution contexts

* fix: include OpenTelemetry SDK in runtime requirements

* refactor: dispatch session waiters in the core pipeline

Preserve access and safety checks before waiter dispatch and limit built-in group context handlers to group messages.

* test: remove trace dashboard tests

* fix: recover orphaned traces and enforce minimum storage budget

* fix: increase trace queue byte budgets and remove frame count limit
2026-10-18 17:09:08 +08:00
Soulter 3be08aca2e feat: add SerpApi search tools and provider descriptions (#10601) 2026-10-17 17:31:47 +08:00
letr ff22dacf05 feat(websearch): add DeepSeek search and page fetching (#10599)
* feat(websearch): add DeepSeek search and page fetching

Add DeepSeek Search and Fetch builtin tools with validated inputs, API key rotation, and WebChat source citations. Expose the provider in WebUI configuration and update localized metadata, documentation, and tests.

Refs #10598

* fix(websearch): validate ports in DeepSeek fetch URLs

* docs(websearch): add DeepSeek query examples and clarify fetching
2026-10-17 14:16:39 +08:00
Soulter 170eeca08b fix: disambiguate plugin view sidebar items (#10502)
* fix: disambiguate plugin view sidebar items

* docs: explain plugin view metadata

* docs: clarify plugin view metadata location
2026-10-11 18:07:46 +08:00
ankaandSoulter 8763c58a98 feat(dashboard): add model settings shortcuts and access control section (#10321)
* feat(dashboard): add model settings shortcuts and access control section

* docs: align remaining configuration paths and permission guidance

---------

Co-authored-by: Soulter <905617992@qq.com>
2026-10-10 00:23:24 +08:00
Soulter 8831d95025 feat(dashboard): scoped path-token auth for plugin views and complete the views rename (#10415)
* refactor(dashboard): complete the plugin pages to views rename

Finish the remaining Pages -> Views rename on the dashboard:

- Fix the plugin card "Open View" button crash by pointing
  openPluginWebui at the renamed PluginView route
- Rename PluginPagePage.vue to PluginViewPage.vue and update its
  internals (loadPluginView, pluginViewTitle, .plugin-view-* classes)
- Rename openPluginWebui -> openPluginView and the open-webui emit to
  open-view; pluginPageTitle/Description -> pluginViewTitle/Description;
  isPluginPageRoute -> isPluginViewRoute
- Rename i18n keys (pluginWebui -> pluginView, openWebui -> openView,
  pluginPageType -> pluginViewType, messages) across en/zh/ja/ru locales

The postMessage bridge channel name (astrbot-plugin-page) is kept
unchanged because it is part of the wire protocol shared with
plugin_page_bridge.js.

* feat(dashboard): authenticate plugin view assets with scoped path tokens

Serve plugin view assets from
/api/v1/plugins/{id}/views/{page}/_t/{token}/... so the scoped token
travels in the URL path. Relative URLs inside the view then inherit the
token through normal path resolution, which removes the need for
server-side HTML/CSS/JS URL rewriting on this route.

- Add the _t routes with a require_plugin_view_token dependency
  (v1 paths bypass the dashboard auth middleware)
- Extend the plugin page asset token to a session-length TTL (7 days,
  aligned with the dashboard session) with a page_session purpose claim,
  still scoped to a single plugin and page
- Serialize the view entry content_path as the _t URL, keeping the
  asset_token query for plugins that parse location.search
- Keep the legacy /api/plugin/page/content/...?asset_token= form working
  during the transition
- Rename the OpenAPI tag Plugin Pages -> Plugin Views, document the new
  route, regenerate the frontend API client, and update the zh/en
  plugin-pages docs

* refactor(dashboard): remove the legacy plugin page content route and URL rewriting

The path-token view route makes the compatibility surface unnecessary:

- Drop /api/plugin/page/content/... (query asset_token form)
- Drop the redundant authenticated asset routes /plugins/page/assets,
  /plugins/view/assets, and /plugins/{id}/(pages|views)/{page}/assets/...
  which had no callers outside the generated client
- Remove the HTML/CSS/JS URL rewriting helpers; view assets are always
  served raw and only HTML gets bridge SDK injection plus theme handling
- Slim PluginPageAuth down to the bridge SDK endpoint, the only
  non-v1 path still authenticating scoped query tokens
- serialize_plugin_page no longer falls back to the legacy content path
- Update the plugin-pages docs (zh/en) and the OpenAPI spec, and
  regenerate the frontend API client

* refactor(dashboard): drop legacy plugin page API aliases

Remove the page-named plugin view API aliases now that the views rename
is complete and legacy compatibility is intentionally dropped:

- DELETE /api/v1/plugins/page(s) and /plugins/{plugin_id}/pages{,/{page_name}}
  aliases; /plugins/view(s) and /plugins/{plugin_id}/views{,/{page_name}}
  are the only entry config routes
- Remove the unused /api/v1/plugins/page-bridge-sdk.js route; the live
  bridge SDK stays at /api/plugin/page/bridge-sdk.js
- Dashboard calls the view-named endpoints; regenerate the API client
  and the OpenAPI scopes docs

* refactor(dashboard): keep plugin page APIs as deprecated view aliases

Restore the page-named plugin view routes removed in the previous commit
and keep them for a transition period, with view as the canonical API:

- /plugins/page(s) and /plugins/{plugin_id}/pages{,/{page_name}} serve as
  aliases of the corresponding /views routes (same handlers)
- The OpenAPI spec marks the page operations deprecated and points new
  clients at the view routes; the v1 page-bridge-sdk.js route is restored
- The dashboard keeps calling the view endpoints by default

* refactor(dashboard): rename the plugin view path parameter to view_name

The view entry and path-token asset routes now use {view_name} instead of
{page_name} in the OpenAPI-visible path, and the service layer renames its
internal page_name variables to match. Wire-compatible surfaces stay
unchanged: the page_name JWT claim, the pageName JSON field, query
parameters, and the deprecated /pages aliases. Error messages and the
plugin view docs (zh/en) complete the Page to View rename.
2026-10-06 18:18:22 +08:00
Yufeng He 63aa363d9c test(dashboard): catch up with the plugin Pages to Views rename (#10307) (#10319)
The rename merged without updating the suites that assert the old
names, leaving the pytest matrix red on master:

- test_plugin_manager: assert StarMetadata.views; the metadata.yaml
  case now uses the views: key, plus a new test for the pages: alias
  the rename kept for compatibility
- test_dashboard: the injected bridge snippet now reads
  window.AstrBotPluginView?.__setInitialContext; the served bridge
  keeps the AstrBotPluginPage alias, so that assertion stays
- regenerate docs/public/openapi.json (and the two openapi-scopes
  tables) with docs/scripts/update_openapi_json.py so the public
  spec matches the runtime spec again after the six /plugins/view(s)
  alias routes

Fixes #10318
2026-10-02 19:14:01 +08:00
Soulter 4b049d1e57 feat(dashboard): regroup sidebar into labeled sections and rename plugin Pages to Views (#10307)
* feat(dashboard): regroup the sidebar into labeled System and Extensions sections

- Add static group headers (System / Extensions) to the sidebar, in the
  style of AI Studio's labeled sections
- System: welcome, platforms, providers, extensions, config profiles,
  data & logs, custom rules
- Extensions: knowledge base, cron, subagent orchestration, personas;
  plugin pages are flattened into this section and the collapsible
  plugin-pages group is removed
- Dissolve the collapsible More Features group; headers hide in rail mode
- Skip the legacy sidebar customization when building the menu (the
  feature is slated for removal)
- Update zh/en docs for the new locations

* feat(dashboard): place personas before knowledge base in the extensions group

* feat(dashboard): make the extensions sidebar group collapsible

Add a chevron toggle to the extensions group header; collapsing hides
the group's items and the state persists in localStorage. Rail mode is
unaffected and always shows every icon.

* feat(dashboard): pin extension sidebar items to the top of their group

Extension group items show a pin button on hover; pinned items move to
the top of the extensions group (hidden together with the group when
collapsed) and the pinned set is persisted in localStorage.

* feat(dashboard): keep the unpin icon always visible on pinned items

Pinned items now show a PinOff icon in the primary color without
requiring hover; unpinned items still reveal the Pin icon on hover.

* feat(dashboard): show a hover card with plugin details on plugin page items

Hovering a plugin-provided page in the extensions group reveals a card
with the page name, plugin ID, and author. The data comes from the
existing plugin list API (no backend change); static items and rail
mode are unaffected.

* fix(dashboard): add author and version to the PluginEntry type

* feat(dashboard): refine the plugin hover card

- Show the card immediately on hover (no open delay) and drop the
  expand animation
- Plugin row shows an icon plus 'display_name (id)' with the id muted,
  or just the id when the plugin has no display name
- Author row gets its own icon

* feat(dashboard): add a type row to the plugin hover card

Defaults to '插件可视化视图' (localized in all four locales).

* feat: rename plugin Pages to Views and group plugin views by plugin

Rename (Views preferred, Pages kept as a compatible alias everywhere):
- StarMetadata.pages -> views; metadata.yaml accepts views: (pages: alias)
- Plugin view directory views/ preferred, pages/ still accepted
- v1 API gains /plugins/view(s) alias routes alongside /plugins/page(s)
- Bridge global window.AstrBotPluginView with AstrBotPluginPage as alias
- Plugin i18n keys views.<name>.* preferred, pages.<name>.* alias
- Frontend route /plugin-view/... with /plugin-page/... redirecting
- OpenAPI spec + regenerated client; docs use Views (zh: 插件可视化视图)

Sidebar (extensions group):
- Default mode shows the view name for plugin views
- New group-by-plugin toggle on the extensions header (grid icon, off by
  default, persisted in localStorage): plugin views are grouped per plugin
  under the extensions group, each group listing all of the plugin's views
- Hover card on plugin view items shows page name, plugin display name
  (with id), author, and type; white card style reused for the toggle
  tooltip
- Pinning works for nested views too, lifting them to the group top
2026-10-01 16:26:56 +08:00
Soulter da4811ae81 feat(config): move text-to-image settings into the config profile extension group (#10306)
* feat(star): add umo and template_name params to Star.text_to_image

Plugins can now pass umo (unified_message_origin) so the t2i template is
resolved from the configuration file bound to that session, falling back
to the default configuration when unbound or omitted. An explicit
template_name always takes precedence over configuration.

* feat(config): move text-to-image settings into the config profile extension group

Consolidate all t2i settings under Config Profile -> Extension Features
(ext_group) so they are isolated per configuration file:

- Move the t2i object (output toggle, word threshold) from
  platform_group to ext_group
- Move t2i_strategy, t2i_endpoint, t2i_template and t2i_active_template
  from the system-wide settings group (Settings -> Appearance) into the
  same ext_group t2i object
- Remove the Text-to-Image card from the Settings appearance section
- Relocate the matching i18n entries in all four locales and update the
  zh/en docs with the new location

* fix(dashboard): hide trailing divider after invisible config items

getVisibleItemEntries did not filter invisible items, so an invisible
last item (e.g. t2i_active_template) left a dangling divider below the
last visible row.

* feat(dashboard): rename the sidebar Settings entry to System Settings

The Settings page now only holds global/system-wide options after
behavior configs (such as text-to-image) moved into config profiles.
Rename the sidebar entry in all four locales and update the zh/en docs
to reference the new name.

* feat(config): hide dependent t2i options when text-to-image output is off

Add a t2i=true condition to the word threshold, strategy, endpoint and
custom template items so they only appear when the output toggle is on.
The endpoint/template items keep their t2i_strategy=remote condition.

* fix(star): fall back to the default template when get_config returns None

text_to_image called .get() directly on the result of
context.get_config(umo), which can be None for context implementations
without a default configuration. Guard the lookup so the renderer
receives None instead, restoring the behavior covered by
test_text_to_image_without_config.

* feat(star): hold html_renderer on Context and resolve t2i endpoint per config

- Context now exposes the shared html_renderer, injected by the core
  lifecycle, so plugins can call self.context.html_renderer directly
- Star.text_to_image/html_render resolve the t2i template and render
  endpoint from the configuration file bound to the given umo and pass
  them through per call (no renderer cache, no restart needed)
- The render chain (HtmlRenderer/NetworkRenderStrategy) accepts an
  optional per-call endpoint
- The pipeline's automatic t2i conversion passes the endpoint from its
  own per-profile configuration

* refactor(init): remove unnecessary comments and add deprecation notice for HtmlRenderer usage
2026-10-01 15:18:06 +08:00
Waterwzyandsourcery-ai[bot] ac515d984d docs: add slider key to plugin dev docs (#10289)
* docs: add slider key to plugin dev docs

* Update docs/en/dev/star/guides/plugin-config.md

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

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2026-09-30 18:40:25 +08:00
卷卷andsourcery-ai[bot] 96d9504b6c docs: explain HTTP proxy address when AstrBot runs in Docker (#10162)
* docs: explain HTTP proxy address when AstrBot runs in Docker

* Apply suggestion from @sourcery-ai[bot]

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

---------

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2026-09-21 12:40:26 +08:00
Soulter b62d9a9612 feat: extend shell session waits and raise default agent step limit (#10131) 2026-09-19 10:53:07 +08:00
Ruochen Pan f99c76ec10 fix(dashboard): bound upload memory and add resumable chunked uploads (#10123)
* refactor(dashboard): consolidate upload saves into streaming helper

Five copies of the same upload-save logic existed: three file wrappers
(UploadFileAdapter, RequestUploadFile, PluginUploadFile) plus one
_save_upload() in each of BackupService and SkillsService. The backup
variant fell back to a full-body read() for raw FastAPI UploadFile,
buffering entire uploads in memory.

Introduce save_upload_stream() as the single streaming implementation
(1 MiB blocks, optional max_bytes with in-loop abort and partial-file
cleanup). The wrappers keep their public signatures and delegate to it;
skills/chat/config save paths call save() directly with max_bytes,
replacing their post-save size checks.

* fix(dashboard): bound backup upload size and harden chunked flow

Backup routes passed raw FastAPI UploadFile into the service layer,
hitting the full-body read() fallback: a single authenticated request
with an oversized chunk or whole-file upload could OOM-kill the
process (verified with a 512 MiB memory-limited container, exit 137).

- Wrap uploads in UploadFileAdapter so all saves stream to disk
- Enforce CHUNK_SIZE (1 MiB) per chunk and 128 MiB for whole-file
  uploads, aborting mid-stream with partial-file cleanup
- Cap chunked backup totals at 8 GiB and point larger backups at
  manual restore via the data directory
- Verify the merged backup size against the declared total

* fix(dashboard): enforce MAX_CONTENT_LENGTH with per-route overrides

The 128 MiB MAX_CONTENT_LENGTH value was written into the compat-layer
config dict but nothing read it, so the FastAPI/hypercorn path had no
request body limit at all.

Add a middleware that rejects oversized bodies with 413 before auth or
body parsing, using MAX_CONTENT_LENGTH as the default with per-route
overrides for legitimate large uploads (attachments 512 MiB, plugin
config files 500 MiB, knowledge bases 512 MiB) and a tight 2 MiB cap
on the backup chunk endpoint. Requests without a Content-Length header
pass through and remain bounded by per-endpoint max_bytes at save time.

* refactor(dashboard): extract generic chunked upload session service

Pull the chunk session machinery out of BackupService into a reusable
ChunkedUploadService owning session lifecycle, chunk storage, streaming
assembly and expiry cleanup, in preparation for webchat attachment
chunked uploads.

Sessions are now bound to an owner (the authenticated username) and a
purpose; chunk/complete/abort calls from another owner fail with the
same "not found or expired" error as unknown sessions, so upload IDs
cannot be probed or consumed cross-user. BackupService keeps business
concerns (zip validation, size caps, manifest marking) and delegates
the rest; API shapes and frontend flows are unchanged.

* feat(dashboard): add resumable upload status endpoint

Expose per-session progress (received chunk indexes, totals, expiry)
so clients can resume an interrupted chunked upload by sending only
the missing chunks instead of starting over.

Abuse considerations baked in: the lookup inherits owner binding and
answers "not found or expired" for both unknown sessions and sessions
owned by someone else (no probing), the response carries no filename
(minimal disclosure), and the query is strictly read-only — it never
touches last_activity, so polling it cannot anchor a session and its
on-disk chunks alive past expiry.

* fix(dashboard): bound file signature memory with chunked hashing

getFileSignature() read the entire file into browser memory via
arrayBuffer() before computing SHA-256, spiking renderer memory by the
full attachment size (up to the 512 MiB upload cap).

The signature is only used for in-session staging dedup and never
leaves the browser, so it does not need to be the canonical whole-file
SHA-256. Hash 8 MiB blocks individually and digest the concatenated
block digests instead; the prefix changes to sha256m: to mark the
algorithm change (old signatures vanish with the page session, so no
compatibility concern).

* feat(dashboard): resumable chunked upload UI for backup import

Extract the chunk scheduling logic from BackupDialog into a reusable
useChunkedUpload composable (5-way concurrency, per-chunk silent
retries, progress accounting) and add resume support on top of the
new upload status endpoint: a failed upload now offers a "Resume
Upload" action that queries received chunk indexes and sends only the
missing ones. Expired sessions transparently re-initialize and start
over; a failed complete() drops the poisoned session by design.

Wires the new /backups/upload/status endpoint through the OpenAPI
spec and regenerated client, and adds the resumeUpload label to all
four locales.

* feat(dashboard): chunked upload endpoints for webchat attachments

Mirror the backup chunked-upload flow for chat attachments so large
files (>128 MiB request-body default, up to the 512 MiB attachment
cap) can be uploaded in slices: POST /api/v1/files/upload/{init,
chunk,complete,abort,status}, owner-bound sessions, and a per-route
body limit on the chunk endpoint.

ChatService reuses the generic ChunkedUploadService with a new meta
passthrough carrying the client content_type through the session;
completion merges outside the chunk dir and feeds the result through
save_uploaded_file() unchanged via a move-based LocalUploadFile
adapter, keeping MIME sniffing, type classification and attachment
insertion in exactly one place.

Also repairs two pre-existing test stubs that predated the
max_bytes-aware save() contract and were already failing on this
branch.

* feat(dashboard): chunked upload with resume for webchat attachments

Route staged files >= 32 MiB through the new chunked upload endpoints
via useChunkedUpload; smaller files keep the single POST path so paste
and quick picks stay low-latency. The content_type travels through the
init payload so server-side attachment classification is unchanged.

A failed chunked upload is kept as an error chip in the input area
with a retry action that resumes from the last received chunk (and
transparently restarts when the session expired) plus a discard action
that aborts the session. Failed entries hold their uploader in a
shallowRef so Vue's deep ref unwrapping cannot strip the composable's
internal refs, and their signatures stay reserved to block duplicate
staging while a failed entry exists.

* docs: regenerate openapi artifacts for file upload endpoints

* fix(dashboard): harden chunk save and request body limits

Address review findings on the upload-hardening branch:

- save_chunk() now writes to a uniquely named temp file, verifies the
  save() byte count against the expected chunk length, and publishes
  via atomic rename. A failed or concurrent same-index retry can no
  longer truncate and delete an already-received chunk (previously
  left received_chunks claiming data that assemble() then failed to
  find), and short writes are rejected instead of published.
- Requests with multipart bodies but no Content-Length are rejected
  with 411: form parsing spools large bodies to disk before any
  per-file size check can run. This is a documented stopgap — other
  lengthless bodies still pass and are bounded only at save time;
  closing that fully requires counting bytes as they arrive.
- Whole-file upload overrides gain 1 MiB of multipart framing slack
  so a file exactly at the size cap is no longer rejected with 413.

The body-limit decision is extracted into a pure function for direct
unit tests; the assemble-time size recheck is now covered by an
out-of-band corruption test since chunk-level verification rejects
short writes earlier.

* fix(dashboard): drain upload pool and pin session on resume

A failed chunk made runPool() reject immediately while the remaining
in-flight requests kept writing; a resume could then race them on the
same chunk, stale retries read the mutable uploadId (potentially
writing into a re-initialized session), and late completions kept
counting progress (150% after resume).

The pool now stops scheduling on first failure but drains issued
requests via allSettled before surfacing the error, each request pins
the uploadId captured at run start, and a run-generation counter
(bumped on start/resume/cancel) blocks stale completions from the
progress accounting.

* fix(dashboard): close 411 bypass and temp-file residue on publish

Address the second round of review findings:

- The 411 media-type check used a raw startswith(), but the form
  parser strips surrounding whitespace, so a leading-space
  Content-Type was let through without a Content-Length while
  Starlette still parsed the body as multipart. Detection now uses
  the same parse_options_header the parser uses.
- A failing os.replace() during chunk publish left the uniquely
  named temp file behind; it is now covered by the same cleanup
  discipline as the save path.

Backup direct-upload routes deliberately get no framing slack: they
are legacy paths with no remaining callers, and the pre-existing
exact-limit 413 edge is answered by chunked upload.

* fix(dashboard): abort sessions created after a cancel

Cancelling while initUpload was still in flight cleared local state
before an upload id existed; when the delayed init returned, the run
flipped from idle to error and the freshly created server session was
never aborted. handleFailure now lets cancel win over any late
resolution and aborts the session id captured at that point.

* fix(dashboard): check cancel flag after completeUpload resolves

Cancelling while completeUpload was in flight let the late success
response flip the uploader from idle to done and hand the result to
the caller, which proceeded to the precheck. completeSession() now
re-checks the cancel flag after the response arrives and routes the
late success through the cancelled path instead.

* fix(dashboard): gate the 411 rule to body-capable methods

The 411 stopgap rejected GET /api/v1/logs/live: the SSE log client
sends a bogus "Content-Type: multipart/form-data" header on a GET
(copy-paste relic), and a GET with no Content-Length matched the
multipart-without-length rule. Body-less methods never trigger form
parsing, so no disk-spool risk exists for them — the 411 now applies
only to POST/PUT/PATCH. The junk header on the SSE client is removed
as well; the other two SSE consumers never had it.

* feat(dashboard): show in-progress chips for chunked attachments

Chunked uploads gave no feedback while in flight: the staged chip
only appeared after completion, leaving multi-minute uploads silent.
Track in-flight uploads alongside the failed ones and render progress
chips (filename, percent, thin progress bar) with a cancel action in
the input area; on success the chip hands off to the staged
attachment, on failure to the resumable error chip.

* fix(dashboard): type active upload chips upfront and align progress bar

The in-progress chip used a generic cloud icon even though the file
type is known locally before the upload starts; it now derives
icon/color/label from the filename via attachmentPresentation, same
as the staged chip. The progress bar's left edge is aligned with the
filename text instead of the card padding.

* fix(dashboard): keep active-chip progress bar inside the card

v-progress-linear ships width:100%, which wins over the right offset
in absolute positioning; the bar ran 52px past the card's right edge
and was clipped by overflow:hidden. Give it width:auto so the left/
right offsets determine the width.

* fix(dashboard): rework active-chip progress track and cancel button

Positioning a Vuetify component root directly proved fragile — the
progress bar drifted to the card's top edge. Wrap it in a plain track
div that owns the absolute positioning and let the component fill it.
Replace the corner tonal badge cancel with an inline text-variant
icon button after the percent label, and drop the padding reserved
for the badge.

* fix(dashboard): enforce session expiry and atomic save semantics

Address the third review round (sourcery-ai findings):

- get_session() now actually enforces the idle expiry it advertises
  in its "not found or expired" error; expired sessions stay
  abortable for cleanup, and backup upload_init starts the janitor
  just like chat's does, so chunk dirs cannot linger indefinitely.
- cleanup_session() only unregisters a session after rmtree()
  succeeds, letting the janitor retry on transient filesystem errors
  instead of permanently leaking the chunk directory.
- save_upload_stream() writes to a uniquely named temp sibling and
  atomically renames on success, so a failed or cancelled overwrite
  can no longer delete a pre-existing destination (e.g. re-uploading
  over an existing attachment), and all callers inherit the behavior.

The write()-return-value finding is a non-issue: BufferedWriter
writes fully or raises, and the chunk path already verifies byte
counts.

* fix(dashboard): guard failed-upload retry against double clicks

retryFailedUpload() ran resume() without any in-flight marker, so a
second click started a concurrent resume on the same session; the
loser hit "not found or expired" and left a failed chip next to the
successfully staged attachment. The entry now moves to activeUploads
while resuming, which blocks the second click and shows live
progress, and returns to failedUploads only if the resume errors.
2026-09-18 17:55:30 +08:00
Soulter 553096b0c1 docs: sync guides with current WebUI navigation (#10093) 2026-09-15 22:10:21 +08:00
w31rd c264e1d92a feat: unify /new and /reset behavior (#10004)
* feat: unify new and reset conversation behavior

* fix(i18n): align conversation isolation labels

* fix(i18n): clarify group conversation permission hints

* feat: centralize conversation command permissions

* fix(i18n): clarify administrator-only command permissions

* docs: correct conversation command permission instructions

* test: isolate conversation restart command registration

* feat: follow conversation isolation for restart permissions
2026-09-12 14:19:58 +08:00
WangPan59and王磐 f845a8d654 feat(websearch): add AnySearch as a web search provider (#9767)
Co-authored-by: 王磐 <wangpan.com>
2026-08-31 09:30: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
Soulter e183dd285f feat(dashboard): support masked secret config fields (#9824)
* feat(dashboard): support masked secret config fields

* docs: document secret plugin configuration fields
2026-08-26 20:41:29 +08:00
Soulter 0fceeb3b6b docs: add plugin attribution guidelines 2026-08-15 01:29:23 +08:00
Soulter cfe6424742 fix: harden API key scope boundaries (#9503) 2026-08-02 13:19:38 +08:00
Soulter e80e01c776 feat: implement group message history persistence and retrieval features (#9465)
* feat: implement group message history persistence and retrieval features

* feat: update group message history configuration and documentation
2026-07-30 18:58:24 +08:00
XTsat 9c9d6095b8 docs: update plugin publish (#9415)
* docs: update plugin publish

* docs: update plugin publish example

* docs: update plugin publish
2026-07-28 10:16:02 +08:00
Weilong Liao 0ef790d289 fix: track plugin install source for updates (#9037)
* fix: track plugin install source for updates

* feat: refine plugin source management flow

* test: align plugin update expectation
2026-06-27 15:02:04 +08:00
NayukiChiba 0a0c677404 docs: 文档更新 - 指令、FAQ、网页搜索、插件发布等 (#8912)
* docs(community): 更新 QQ 群组信息
- 移除了旧的 QQ 群组信息并添加了新的群组。
- 确保所有群组信息的准确性和完整性。
- 提升文档的可读性和用户体验。

* docs(webui): 为忘记密码章节添加 FAQ 引用链接

- 在英文和中文文档的"忘记密码"章节末尾添加 TIP 提示框
- 提示框链接至对应 FAQ 条目,提供更详细的操作说明
- 增强文档之间的关联性,提升用户查阅体验

* docs(command): 新增 /stats 和 /provider 指令文档,更新 FAQ 管理员指令列表

- 在英文和中文的命令文档中添加 /stats 和 /provider 指令的详细使用说明
- 更新中英文 FAQ 页面的管理员指令列表,与最新的默认指令保持一致
- 确保中英文文档内容同步,提升文档准确性和用户查阅体验

* docs(websearch): 新增 Firecrawl 网页搜索提供商文档支持

- 在开发版配置文档中补充 websearch_provider 选项,加入 firecrawl 及对应密钥配置项
- 更新中英文网页搜索使用指南,将支持搜索源数量同步为五种并提供 Firecrawl 注册指引
- 确保中英文文档内容一致,提升配置说明的完整性和用户查阅体验

* docs(plugin-publish): 更新插件提交方式至新仓库

- 废弃通过 AstrBot 主仓库 Issue 提交插件的方式
- 新增警告框提示正确提交入口为 AstrBot_Plugins_Collection
- 同步更新中英文版插件发布文档
2026-06-20 16:43:58 +08:00
Weilong Liao 49b86320cb docs: clarify OpenAPI chat username identity (#8880) 2026-06-18 23:17:50 +08:00
Weilong Liao 264e7eaaa3 fix: restore OpenAPI file uploads
Expose /api/v1/file in OpenAPI, enable file-scoped API keys, and regenerate docs/client artifacts.
2026-06-18 12:37:38 +08:00
Weilong Liao 5566bd621c feat: reorganize settings system configuration (#8777)
* feat: reorganize settings system configuration

* fix: float system config restart notice

* fix: blur system config restart notice

* fix: tint restart notice blur background

* fix: allow totp setup without body

* fix: filter public openapi docs

* fix: handle settings autosave cleanup

* chore: ui
2026-06-16 11:03:42 +08:00