[Grid agent] Supervise login, disconnect recovery, and graceful shutdown #121
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Objective
Implement a supervised grid-session state machine that logs in, detects loss of session, reconnects responsibly after maintenance or kicks, and shuts down without orphaned tasks or duplicate subscriptions.
Required behavior
NetworkManagerlogin/disconnect lifecycle. Classify authentication/configuration failures as operator-actionable and do not loop; classify transient transport, simulator, maintenance, and server failures for retry.Acceptance criteria
Dependencies
Depends on the architecture issue. It may use the observability/control event interfaces once available but must remain testable without a TUI or real LLM.
Implemented and pushed in commit
3553c83ffa.Implementation:
Verification:
Review found and corrected several edge cases before commit: work arriving during connection no longer cancels login; jitter cannot undercut a server retry hint; readiness, not mere transport connection, controls stable reset; duplicate work is fenced across reconnects; cleanup and audit flushing share the shutdown deadline; native Debug output is opaque; and generation overflow shuts down safely.
The focused acceptance tests use fake grid sessions, so no credentials from .env were read or committed. A local live-grid feature check was attempted several ways, but this environment compiler was SIGKILLed for memory while checking the pre-existing monolithic libremetaverse crate, before reaching grid-agent and without a Rust diagnostic. The pushed workflow remains the authoritative all-features check.