Repository navigation
feat: unify session configuration mappings and overrides - #11097
Merged
Merged
Conversation
Contributor
|
Sorry @Soulter, your pull request is larger than the review limit of 150,000 diff characters |
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Custom Rules and configuration routing previously stored overlapping session settings with different priority rules. This change resolves each session from one base profile plus explicit field overrides, and manages both from Config → Manage session mappings. Model commands and the WebUI update the same model overrides.
Modifications
config_bindingrecords. Keep binding migration inastrbot/core/db/migration/migra_config_bindings.py, separate from the shared storage-key definition. Preserve route order and allow sessions to select a profile or follow routing; field overrides apply afterward without modifying shared profiles.AstrBotConfigSnapshot, constructing values directly from the base profile and overrides with one full copy. Its save methods reject profile writes; explicit override paths live onMessageConfig. Keep public configuration getter signatures unchanged and avoid dynamic markers, copied persistence state, or object-identity checks.PipelineContext.astrbot_configproperty, without adding configuration fields to events. Session configuration readers share an isolated snapshot; changes apply to subsequent messages, and exceptions/cancellation restore the previous scope. Select the pipeline using the final UMO after member isolation. Read third-party runner settings from the effective configuration.SessionServiceManagerandSessionPluginManagerclasses and obsolete test mocks. Service and plugin checks now use effective configuration.GET /api/v1/sessions,PATCH /api/v1/sessions/provider, andPATCH /api/v1/sessions/service, their three legacy/api/sessionaliases, and dedicated service methods/request schemas. Regenerate the OpenAPI client and public API docs. Document replacements using active UMOs, mapping reads, and per-UMO override writes./personacommand. Manage session personas and restore inheritance through Config → Manage session mappings → Overrides → Persona.The navigation change accompanies the storage unification so profile selection and overrides are managed together. The legacy
/session-managemententry redirects to the mappings dialog.This intentionally changes session-setting semantics: explicit session values take precedence over the profile, model commands and the editor share one value, and unused Rerank settings are removed. The retired session-status and batch-setting APIs no longer accept requests; external callers must migrate to the documented mapping APIs. Startup migrates the legacy preference records automatically; existing aliases and unrelated session data are retained.
Screenshots or Test Results
Manual checks used an isolated local API fixture rather than production configuration: single and batch selection, mixed sessions/groups, inherited and explicit values, saving and restoring wake prefixes, per-session blacklist updates, mapping visibility on the Bots page, opening the shared dialog, and retaining an unsaved mapping draft while refreshing override counts. Chinese and English screenshots are included under
docs/{zh,en}/use/images/.Validation:
Event loop is closed).caplogassertions in decision-provider tests; they also reproduce individually and with the pre-cleanupProviderManagerloaded from commita8d7b1ea1. Dashboard build/type checking and Ruff checks passed.uv run ruff format .,uv run ruff check ., andgit diff --check: passed.cd dashboard && pnpm generate:api && pnpm build: passed, including Vue type checking.cd docs && pnpm run docs:build: passed.Builds report non-blocking asset/icon and bundle-size warnings; Python tests report deprecation warnings.
Checklist