Skip to content

Web: first send on inactive never-started session fails with resume_unavailable (409) #759

@heavygee

Description

@heavygee

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

  1. Create a session in a directory (cursor flavor) where the runner never spawns the agent (or archive before first turn).
  2. Open the inactive session in the web app (0 messages).
  3. 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.

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