Headless -p run can remain non-terminal with zero tokens until externally terminated #1670
Alan5168
started this conversation in
Bug reports
Replies: 1 comment
|
Confirming this reproduces on 0.8.1 (the report above is 0.8.0), on WSL2 Ubuntu with Node v23.11.0, and adding controls that narrow it. Every invocation that creates a session hangs and is killed at the deadline with zero stdout and zero stderr: Every command that does not create a session works: What that rules out here:
So on this machine the hang is reachable with a healthy daemon, working auth, a reachable provider and uv present, which seems to narrow it further than the provider-429 path in #1436. |
0 replies
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.
Headless
-pcan remain non-terminal with zero tokens until externally terminatedThis is not a daemon-crash / worker-crash report.
We initially treated stderr
Daemon worker client closedas evidence that the session worker died first. Timestamped supervisor + worker + session logs showed the opposite: the process was non-terminal with zero model tokens, our external wrapper hit a deadline, sent SIGTERM, the worker accepted a shutdown command, the in-flight turn was aborted, and only then didprompt_and_waitfail withDaemon worker client closed.That log line is autopsy residue, not the cause of death.
This resembles #1436 at the headless lifecycle level (
prime-agent -p→ zero output + never exits → external kill → daemon log ends inprompt_and_wait failed: Daemon worker client closed). Our reproduction does not establish the same provider-429 / long-reset cause.Causal timeline (proved)
Minimal teardown reproduction (no private workload): isolated Prime 0.8.0,
prime-agent -p --no-context-fileswith a one-word "reply pong" prompt, wrappercommunicate(timeout=20s)thenkillpg(SIGTERM):shutdown command received over socket; 1 active session(s) will be closed(+11ms)shutting down (exit 0)Daemon worker client closedSo SIGTERM precedes the shutdown command by 11ms;
Daemon worker client closedis later still.Long hang we actually care about (not yet reduced off our harness): one headless
-prun stayed non-terminal for ~988s with usage all zeros and empty stdout, until the same wrapper deadline (900s autonomous timeout + 90s communicate slack ≈ 990s). Worker log for that run is the same shutdown-command pattern, not a crash:Timed out draining daemon mutations for idle eviction) whileprompt_and_waitwas still in flightshutdown command received over socketstopReason=aborted/errorMessage=Request was aborted/usage.totalTokens=0prompt_and_wait failed: Daemon worker client closedHonesty bound: teardown causality is established on a public one-word prompt. The ~988s zero-token hang still used our research harness as the prompt. A 45s follow-up on the same one-word
-pprompt also produced 0 tokens / empty stdout until SIGTERM — that is a step toward reducing the hang, not a 988s independent fixture.Explicitly not
Duplicate snapshot … did not match cached bytesin the hang window.Unknown active sessionfor this session.Daemon worker client closedis post-SIGTERM teardown consequence (DaemonWorkerClient.close()rejecting in-flightprompt_and_wait), not a prior transport fault that caused the stall.Environment
prime-agent -p/ print / headless, no--resume--provider/--model(not claiming 429; we did not capture a provider cooldown in this evidence)Question for maintainers
When a provider/model turn emits no tokens for a prolonged period, what layer is expected to bound or terminate
prompt_and_wait/ print mode?Is there an intended stall deadline, or a terminal provider error, that is not propagating to the headless client so it can exit non-zero without an external wrapper SIGTERM?
We are not attaching a patch or PR. Prime’s contribution process is Discussion-first. If this is in-scope as a stall / missing terminal-boundary issue, we can follow with a small behavioral regression once invited.
All reactions