Skip to content

Continue stopping remaining run processes after per-target failures #719

Open

Description

@Meta-Develop

Summary

maco agents stop --all --run-id <id> aborts at the first target failure, leaving later selected processes unattempted and omitting earlier successful results from CLI output.

Evidence and reproduction

On main fa0c79b9ae38eca2c59b2b1911becfe1a6b3c9ab, src/agent_lifecycle.rs:938-943 delegates the selected run processes to stop_records. At lines 991-998, errors from either termination (993-994) or registry removal (995) return immediately from the loop. AgentStopReport at lines 674-677 only represents successful entries. src/cli.rs:3017-3034 propagates the error before printing the report.

Use three registered fixture processes and inject a termination or registry-update error for the first or middle entry. Later entries are never attempted, and the CLI emits no structured partial result. Existing single-target tests do not exercise this case.

Acceptance criteria

  • Attempt each independently selected identity even when another target fails.
  • Preserve PID/start-time checks; uncertain or reused identities must never be signalled.
  • Report each target as confirmed stopped, already gone, or failed with a typed reason, distinguishing termination from registry-bookkeeping errors.
  • Remove registry identities only after confirmed termination/absence; retain unresolved records for safe retry.
  • Emit the complete JSON report and return nonzero when any target remains unresolved.
  • Test first/middle failure, mixed success, safe retry, stale identity and bookkeeping failure.

Scope and verification

Source inspection only; no host process or provider was interrupted. Closed #8 introduced whole-run stop, and #123/#644 handle separate identity/disappearance races. No open Issue/PR covers batch error aggregation.

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

    agent:inboxAwaiting agent triagebugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions