-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Summary
The phone app can send messages to inactive sessions — they get queued server-side and delivered when the session reconnects (pendingCount increments). The CLI has no equivalent. happier session run stream-start only works for active sessions (connected via socket.io) and fails with "RPC method not available" for inactive ones.
Use Case
Building a TUI session manager that lists all relay sessions and lets you message any of them. Currently:
- Active session →
stream-start/stream-readworks - Inactive session → no way to send a message from the CLI
The phone app handles this seamlessly — you can type a message to any session regardless of whether it's active. The message sits in the relay's pending queue until the session reconnects.
Proposed Solution
happier session send <session-id> <message> [--json]This would use the same relay server-side pending queue mechanism that the phone app uses. The message gets delivered when the session reconnects, or immediately if the session is active.
Response:
{
"ok": true,
"kind": "session_send",
"data": {
"sessionId": "cmm...",
"delivered": false,
"pendingCount": 3
}
}Where delivered: true means the session was active and received it immediately, delivered: false means it's queued.
Context
Related: #133 (expose continueWithReplay on HTTP API)
The relay already has the pending message infrastructure — the phone app uses it. This just needs a CLI surface.
🤖 Generated with Claude Code