mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
1.7 KiB
1.7 KiB
Changelog
Unreleased
Plugin Environment Grouping
v4 runtime now manages plugin Python environments as shared groups instead of
always creating one .venv per plugin.
Behavior changes:
- Plugins are planned together before startup.
- Plugins are grouped by
runtime.pythonfirst, then by dependency compatibility. - Compatible plugins share one interpreter environment under
.astrbot/envs/<group_id>. - Incompatible plugins are split into separate groups automatically.
- Each plugin still runs in its own worker process. Only the Python environment is shared.
Environment planning details:
- Group planning writes artifacts to
.astrbot/groups/,.astrbot/locks/, and.astrbot/envs/. - Lockfiles are generated from grouped
requirements.txtinputs. - Exact pinned requirements such as
package==1.2.3use a fast compatibility check before falling back touv pip compile. - If a plugin cannot produce a valid lockfile even when isolated, that plugin is skipped without blocking other plugins.
Compatibility notes:
- Existing plugin manifest structure is unchanged.
- Existing
PluginEnvironmentManager.prepare_environment(plugin)call sites remain valid. - Shared environments still use
--system-site-packagesin this phase to reduce regressions for plugins that implicitly rely on host packages. - Legacy plugin-local
.venvdirectories and.astrbot-worker-state.jsonfiles are no longer part of the active v4 environment path, but they are not deleted automatically.
Operational notes:
- Startup now performs a planning step before worker launch.
- Shared environment state is tracked with
.group-venv-state.jsoninside each grouped environment. - Stale
.astrbotgroup artifacts are cleaned up on replanning.