letsbe-sysadmin/app/clients
Matt 2d27775a2c
Build and Push Docker Image / build (push) Successful in 1m56s Details
fix: Persist credentials across container and orchestrator restarts
Previously, the agent would clear credentials on ANY heartbeat failure,
causing infinite re-registration loops when:
- Agent container was updated while orchestrator was running
- Orchestrator was restarted while agent was running

Changes:
- Add HeartbeatStatus enum and HeartbeatResult dataclass
- Modify heartbeat() to return status info instead of just bool
- Only clear credentials on 401/403 (AUTH_FAILED)
- Keep credentials on transient errors (NETWORK_ERROR, SERVER_ERROR)
- Handle AUTH_FAILED in heartbeat_loop() for mid-session invalidation

Scenarios now handled:
- Agent restart: keeps creds, retries until orchestrator responds
- Orchestrator restart: keeps creds, retries with backoff
- Admin deletes agent: clears creds, breaks out for re-registration

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-09 15:25:44 +01:00
..
__init__.py Initial commit: SysAdmin Agent with executors 2025-12-03 11:05:54 +01:00
orchestrator_client.py fix: Persist credentials across container and orchestrator restarts 2025-12-09 15:25:44 +01:00