Skip to content

stop fails with 'Session not found' for a session that list/status report as running #192

Description

@c-h-

Summary

agentctl stop <short-id> fails with Session not found for a running session that agentctl list -a and agentctl status <short-id> both successfully resolve and report as running with a live PID. This forces a manual kill of the underlying process to actually stop the work — a ghost-session inconsistency between the read path and the stop path.

Repro (observed)

Session short id: 5b0abf14 (claude-code, model claude-fable-5), running QA in a worktree.

$ agentctl list -a
5b0abf14  running  claude-code  claude-fable-5  ~/code/mono-auto-ENG-10853  53208  11m ago  EXECUTE THIS PROCEDURE...

$ agentctl status 5b0abf14
ID         5b0abf14
Status     running
PID        53208
...

$ agentctl stop 5b0abf14
Session not found: 5b0abf14-3cf5-4eef-949a-741ca0001e1e

$ agentctl status 5b0abf14
Status     running          # still running; process 53208 alive

The process was still alive after stop; only a direct kill -TERM/-KILL 53208 (plus killing the child PID) actually stopped it.

Expected

stop <short-id> should resolve and terminate the same session that list/status resolve from the same short id. If the id resolves for the read commands, it must resolve for stop.

Notes

  • The stop path expands the short id to 5b0abf14-3cf5-4eef-949a-741ca0001e1e and then reports it as not found, while the read path (list/status) resolves the short id fine — suggests a lookup/registry mismatch between the read and mutation code paths (or a stale/duplicate session record).
  • Workaround: manual kill of the PID from agentctl status, then kill child PIDs (pkill -P <pid>).
  • Environment: macOS (Darwin arm64), agentctl launching claude-code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions