Summary
When a session was created (e.g. from the web or runner) but the agent never started—no user messages and no agent thread id (cursorSessionId, claudeSessionId, etc.)—the session can be archived/inactive. The web UI shows "Session is inactive. Sending will resume it automatically." but the send path calls POST /api/sessions/:id/resume, which returns 409 resume_unavailable because there is no agent session id to resume.
The user's draft is never sent (POST /messages is never reached).
Repro
- Create a session in a directory (cursor flavor) where the runner never spawns the agent (or archive before first turn).
- Open the inactive session in the web app (0 messages).
- Type a message and send.
Expected: First message starts the runner in that directory (fresh spawn) or the UI shows a clear, actionable error.
Actual: POST /resume → 409 resume_unavailable; no message POST; misleading auto-resume banner.
Environment
- HAPI web + hub
- Observed on operator session
29f35bbf-2b1e-4eee-918e-52419aea71c2 (archived, 0 messages, cursor flavor, no cursorSessionId)
Related
Suggested fix
- Hub: allow
resumeSession to fresh-spawn when path exists, no agent resume id, and no prior user messages.
- Web: do not promise auto-resume when resume is impossible; guard
resolveSessionId before calling resume.
Summary
When a session was created (e.g. from the web or runner) but the agent never started—no user messages and no agent thread id (
cursorSessionId,claudeSessionId, etc.)—the session can be archived/inactive. The web UI shows "Session is inactive. Sending will resume it automatically." but the send path callsPOST /api/sessions/:id/resume, which returns 409resume_unavailablebecause there is no agent session id to resume.The user's draft is never sent (
POST /messagesis never reached).Repro
Expected: First message starts the runner in that directory (fresh spawn) or the UI shows a clear, actionable error.
Actual:
POST /resume→ 409resume_unavailable; no message POST; misleading auto-resume banner.Environment
29f35bbf-2b1e-4eee-918e-52419aea71c2(archived, 0 messages, cursor flavor, nocursorSessionId)Related
messages-consumed) — separate UX bug--resume(different path)Suggested fix
resumeSessionto fresh-spawn when path exists, no agent resume id, and no prior user messages.resolveSessionIdbefore calling resume.