mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 20:53:06 +00:00
9e358b9817
Agent V2: when RecoveryPath loads a snapshot already at Stage=Completed/Failed, no reducer transition fires so OnDecisionTerminalStage was never invoked — the agent idled until AgentMaxLifetime (default 6h), emitting periodic perf/metrics events the whole time. Fire it explicitly at the end of Start() so the EnrollmentTerminationHandler runs (marker write + diagnostics + self-destruct). The WhiteGloveSealed archive-and-reset at step 0 already neutralises the Part-2 case; non-terminal stages take the normal recovery path. Web: gate the SignalR eventStream refetch and the 30s fallback polling on non-terminal session status. Once Succeeded/Failed, late perf/metrics arrivals no longer trigger a full-page refetch + re-render that scroll-jumps the timeline while the user is reading. Observed in session 17ef0e0e-... (2026-05-19): 4x enrollment_complete, only 1x agent_shutting_down; reboot mid-shutdown left subsequent agent instances running for hours emitting noise. Tests: 3 new in RecoveryPathTests (Completed/Failed -> Terminated, non-terminal -> no Terminated), 4 in sessionStatus.test.ts. Suites grun: Web 384/384, Agent V2.Core 1095/1095, Backend 1844/1844. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>