Summary
agentty kill can return success before the PTY has actually exited.
Why this is a problem
killSession() waits up to a fixed timeout and then returns without verifying that the session truly transitioned to exited.
Impact
- Users can believe a session was cleaned up while the PTY is still alive.
- Active session pointers may be cleared even though the underlying process is still running.
- This can leave orphaned processes and misleading runtime state.
Suggested direction
- Treat kill timeout as a failure instead of silent success.
- Verify final process/session state before returning success.
- Add a regression test with a slow-to-exit or TERM-resistant process.
Relevant code
src/sessionRuntime.ts#waitForExited
src/sessionRuntime.ts#killSession
src/worker.ts#requestKill
Summary
agentty killcan return success before the PTY has actually exited.Why this is a problem
killSession()waits up to a fixed timeout and then returns without verifying that the session truly transitioned toexited.Impact
Suggested direction
Relevant code
src/sessionRuntime.ts#waitForExitedsrc/sessionRuntime.ts#killSessionsrc/worker.ts#requestKill