Skip to content

fix(llc): auto-pause overwrites a stop status; unfiled recovery logs a second failure (#21055 follow-up) #21190

Open

Description

@mrveiss

Follow-ups from unresolved review threads on merge train PR #21184, member PR #21055 (issue #20202). Not blocking.

  • autobot-backend/llc/scheduler/auth_failure.py pause_after_auth_failure calls ControlsService.pause_agent (autobot-backend/llc/services/controls_service.py), whose UPDATE is unconditional and stores the current status as pre_pause_status. If a board member paused or terminated the agent while a run was in flight, the later auth failure overwrites that status, and a second pause makes pre_pause_status equal paused, so resume leaves it paused. The defect lives in pause_agent (the quota-exhaustion auto-pause shares it); make the transition conditional and atomic there, once.
  • autobot-backend/llc/scheduler/liveness_monitor.py _log_unfiled_recovery: writes a second heartbeat.failed activity entry for the same run when recovery Bug creation fails, so dashboards and filtered counts show two failures. Use a distinct action, keeping the recovery_unfiled details.
  • autobot-backend/llc/tests/test_work_item_hierarchy_18978.py:490: the mocked audit raises before any write, so the test passes without begin_nested(). Add a test with a real activity flush failure that checks the earlier recovery changes persist and the unfiled row does not.

Acceptance criteria

  • pause_agent does not overwrite a paused/terminated status or its pre_pause_status
  • Unfiled recovery uses a distinct activity action
  • A real-flush savepoint test exists

Activity

  1. mrveiss commented on Nov 8, 2026

    @mrveiss
    OwnerAuthor

    The pause_agent overwrite race named here (an unconditional UPDATE overwriting pre_pause_status; a system pause over a terminated or operator-paused agent) is the root defect already filed as #21056, which predates #21055. #21055 adds a further trigger (the auth-failure auto-pause), not the defect itself. Fix the root once in #21056; track only the remaining #21055-specific minors here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions