Summary
agentty attach writes the requested session id as the active pointer without validating that the session exists or is currently running.
Why this is a problem
The command can succeed even when the target session is missing or already exited. The actual failure only appears later on get, text, key, or kill.
Impact
- Misleading CLI UX: attach appears successful when it is not.
- Broken active-session pointers that need later cleanup.
- More confusing failure mode for both humans and agents.
Suggested direction
- Validate that the target session exists and is
running during attach.
- Consider applying the same validation policy to explicit
--session resolution paths.
- Add tests for attaching nonexistent and exited sessions.
Relevant code
src/resolveSession.ts#attachSession
src/resolveSession.ts#resolveTargetSessionId
src/index.ts#attach
Summary
agentty attachwrites the requested session id as the active pointer without validating that the session exists or is currently running.Why this is a problem
The command can succeed even when the target session is missing or already exited. The actual failure only appears later on
get,text,key, orkill.Impact
Suggested direction
runningduringattach.--sessionresolution paths.Relevant code
src/resolveSession.ts#attachSessionsrc/resolveSession.ts#resolveTargetSessionIdsrc/index.ts#attach