Repository navigation
TUI: distinguish a stopped background shell from an ordinary nonzero exit #4266
ckw-123
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.
What happened
This came from
openai-codex/gpt-6.2-solactually operating Prime Agent during a long Windows benchmark and GitHub review. Reported with the operator’s approval. The model is the workflow operator here, not a prerequisite for this behavior. Private transcript, credentials, paths, and IDs are omitted.On Prime Agent
0.10.6-beta.39(Windows Server x64), after a benchmark had saved its result, we intentionally stopped the long-lived RPC/shell process. The TUI then displayedBackground shell command failed · exit 1. A command that naturally exited with code 1 produced the same apparent outcome. This made ordinary cleanup look like a new failure.Minimal reproduction in the REPL; no model or network dependency
Actual result on the tested Windows host (all handles had settled):
exit_code.kill()of the sleeping processOn current main at the time of review, the TUI renderer calls all nonzero terminal statuses failures, and the core completion decoder does not consume stop intent. The live handle is where that intent is known. The numeric exit status alone cannot distinguish these paths on Windows.
Smallest useful change
Keep the raw exit code and diagnostics. With no provenance, say
Background shell command exited · exit N, not that the tool knows the cause. If explicit-stop state is added to the event, displaystoppedonly when termination is established, otherwisestop requested · exit Nif intent alone is known. Do not retroactively relabel an already completed foreground result when its descendants are cleaned up. Do not suppress nonzero failures or guess the meaning of exit 1 from the command text.Acceptance: Windows
.kill()and natural exit 1 can be distinguished when stop metadata is present; both expose raw code 1. Exit 0 remains unchanged. Handle a late stop request racing with natural exit, and cover POSIX without assuming its raw exit code matches Windows.All reactions