Skip to content

bug(start): report readiness only after PTY startup and stable session metadata #7

@pinion05

Description

@pinion05

Summary

agentty start currently treats socket creation as the success signal, even though PTY startup and final session metadata are completed later.

Why this is a problem

There is a window where start returns success but the PTY is not fully ready yet. During that window, immediate follow-up commands like text or get can still fail. The returned pid can also briefly refer to the worker process rather than the actual PTY process.

Impact

  • Flaky command chaining right after start
  • Confusing PID semantics for monitoring or cleanup
  • Start success that does not yet imply an interactive session is usable

Suggested direction

  • Define readiness as PTY spawn + session metadata persistence, not just socket presence.
  • Tighten the contract around which PID is returned/stored.
  • Add regression coverage for immediate post-start text/get usage.

Relevant code

  • src/sessionRuntime.ts#startSession
  • src/worker.ts#main
  • src/worker.ts#persistRunning

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