Skip to content

bug(kill): do not report success before the session has actually exited #8

@pinion05

Description

@pinion05

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions