mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-11-02 03:41:01 +00:00
Give updated and restored WebUI runtimes ten minutes to become healthy, preserving A0_SELF_UPDATE_HEALTH_TIMEOUT_SECONDS overrides. Backup and checkout still precede the health-check window. Expose the configured timeout in update information and use 600 seconds as the browser fallback, retaining its 30-second buffer. Upgrade older durable managers through the existing migration with backup protection. Validation: 55 focused tests passed in the Docker framework runtime. Three frontend simulations passed for recovery after six minutes, a 900-second override, and expiry at the default 630-second browser limit.
2.1 KiB
2.1 KiB
Startup Migration Extensions DOX
Purpose
- Own backend startup migrations.
Ownership
- Ordered Python files in this folder own idempotent migration steps that run during startup.
Local Contracts
- Migrations must be safe to run repeatedly.
- Preserve user data and create backups or reversible paths when changing durable state.
- Keep long-running work bounded and observable.
_05_framework_dependencies.pyapplies the LiteLLM/OpenAI pins and shared security floors from rootrequirements.txton Docker startup. Already-current and non-Docker environments skip installation; failures stop startup. Extend its package scope when future core dependency changes need self-update installation.- After changing framework packages, reuse
helpers.process.restart_process()before serving requests so imported SDK modules are refreshed. Keep installation within 60 seconds to leave startup time within older self-updaters' health-check window; Git rollback does not restore Python packages. _10_self_update_manager.pymay replace/exe/self_update_manager.pyfrom the repository copy when the installed runtime updater is stale; it must validate required safety markers and keep a backup before replacement.- Required updater capabilities include immutable rollback-stash identity (
get_top_stash_oid), so runtimes using moving stash selectors are upgraded on startup. - Runtime markers also require fast, timestamp-tolerant ZIP backups so existing
/exemanagers receive the backup fixes. - Runtime synchronization also upgrades updaters with the older health timeout to the 600-second default, retaining the environment override.
- After synchronizing a stale self-update manager,
_10_self_update_manager.pystarts that manager's best-effort Codex CLI refresh in the background so the update that introduces the hook does not need a second restart.
Work Guidance
- Add migrations only for durable state changes that cannot be handled lazily elsewhere.
Verification
- Smoke-test startup on a clean checkout and on representative existing user state when practical.
Child DOX Index
No child DOX files.