Restore was writing the freshly-spawned runtime handle to the top-level metadata `runtimeHandle` key, but the canonical lifecycle parser prefers `statePayload.runtime.handle` and falls back to the top-level only when statePayload is missing. The next lifecycle tick read the stale handle from statePayload and rewrote both keys from it, silently undoing the restore's update. Symptom: a session restored after AO restart kept the old PID in metadata. Lifecycle probe found that PID dead (it was from a previous boot) and the dashboard rendered the orchestrator as exited/killed even though a new process was actually running. Fix: rebuild the canonical lifecycle with the new handle via buildUpdatedLifecycle() and persist via lifecycleMetadataUpdates() so statePayload and runtimeHandle stay in sync. Mirrors the pattern used in kill/spawn paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| ao | ||
| cli | ||
| core | ||
| integration-tests | ||
| plugins | ||
| web | ||