A -p session that outlives its launcher cannot be stopped except by shutdown --force #1485
jasoncarreira
started this conversation in
Bug reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
A session started with
-pkeeps running after its launcher process exits — which is the documentedprint-and-exit behaviour — but it is then unreachable by
prime-agent stopunder any identifier I could find.The only way I found to end it is
prime-agent shutdown --force, which stops every agent and the daemon.A session created through the daemon protocol (
{"type":"create"}) does not have this problem: it appears inprime-agent listandstopworks. So this looks specific to client-owned sessions whose owning launcher hasgone away, rather than to autonomous or headless runs in general.
Environment. prime-agent 0.7.2, daemon protocol 7 (
protocol-7-schema-16-1bcb9e7f1a49), build83a0f9f-dirty, Node 24.11.1, macOS 15 (darwin 25.5.0).Reproduction
The launcher exits almost immediately (expected for
-p). The session keeps working — I confirmed its transcriptunder
~/.prime/agent/sessions/<uuid>.jsonlgrowing by 8,125 bytes in 10 seconds.Then:
prime-agent listprime-agent list --alllifecycle: live,id: 01a01195-bc7c-705a-884f-600495c5df07prime-agent stop 01a01195-bc7c-705a-884f-600495c5df07Error: Unknown active session— and the transcript kept growing (+4,098 bytes)stop <transcript uuid>Error: Unknown active sessionstop prime-agent:<uuid>.jsonlError: Unknown active sessionprime-agent shutdown --forceExpected
Either
stopaccepts the identifierlist --allreports for a live session, orlist/stopexplain that thesession is client-owned and offer a way to reach it. Ending one session should not require stopping every agent.
Contrast that may localise it
The protocol has
list { includeClientOwned?: boolean },complete_owned_sessionandpromote_owned_sessioncommands, which suggests client-owned sessions are a known category that the
list/stopCLI surface may simplynot cover.
Why it matters to us
We drive an autonomous build tool from these sessions and need supervision to be able to stop a run it started.
Not being able to stop one specific session without killing the daemon is the blocker; everything else about the
autonomous surface has worked well.
Not verified
Whether
attach/sendare affected the same way, and whether this is specific to-ne(I reproduced only with-ne -ns -e, because that is the shape our use case requires).All reactions