Skip to content

Add a supported reconciliation path for orphaned running records #70

Description

@samfoy

Bug description

A run can remain marked running in AutoLoop's registry after its parent process is killed or disappears. autoloop doctor detects this but does not reconcile it, and queued control requests cannot be consumed because no parent process remains.

Reproduction

  1. Start a long-running loop.
  2. Terminate the AutoLoop parent process externally (for example, process-manager kill/SIGTERM).
  3. Run:
autoloop doctor /path/to/project --json

Observed doctor warning:

1 run(s) marked running but the process is gone

autoloop loops show <id> --json can continue reporting status: running and health: active even though the PID no longer exists.

Expected behavior

There should be an explicit, safe reconciliation path that durably marks orphaned runs interrupted/failed, such as:

autoloop runs reconcile [project-dir]

Doctor/triage could either perform this only behind an explicit flag or return the exact reconciliation command. The update should append a normal terminal registry/journal event rather than hand-editing state.

The CLI/process shutdown path should also attempt this reconciliation on SIGTERM/SIGINT.

Suggested tests

  • Registry record says running, PID is absent → reconcile appends one terminal state.
  • PID exists and belongs to active run → no change.
  • Repeated reconciliation is idempotent.
  • Queued control requests on an orphaned run are closed/reported clearly.

Environment

  • AutoLoop 0.10.1
  • Node 22.23.1
  • Linux

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions