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
Summary
agentty startcurrently 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
startreturns success but the PTY is not fully ready yet. During that window, immediate follow-up commands liketextorgetcan still fail. The returnedpidcan also briefly refer to the worker process rather than the actual PTY process.Impact
startSuggested direction
text/getusage.Relevant code
src/sessionRuntime.ts#startSessionsrc/worker.ts#mainsrc/worker.ts#persistRunning