Skip to content

Hosts keep sandboxes of deleted sessions and retry their uplinks #12

Closed

Description

@fctl-sh

When a project is deleted, the control plane now purges its sessions' event logs (SessionObject storage). Hosts are not told:

  • A stopped session keeps its sandbox on the host so it can resume. After its project is deleted, the sandbox (repository checkout, Claude's local transcript) stays on the machine until someone removes it by hand.
  • If the session's uplink was still open, the purge closes it with code 4404 and the host reconnects forever: every attempt gets HTTP 404, with backoff capped at 15 s, until the host restarts.

What should happen:

  1. The uplink treats close code 4404 and an HTTP 404 on connect as final: it stops reconnecting and asks the session task to destroy the sandbox.
  2. On (re)connect, a host reports the sessions it keeps sandboxes for; the fleet answers with the ones that no longer exist, and the host destroys those (this covers hosts that were offline during the deletion).

Needs a host release; hosts may run one version behind, so the fleet message must be optional.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PQMz6M4XFEb1wkZKjtJgEK

Activity

  1. fctl-sh commented on Oct 17, 2026

    @fctl-sh
    ContributorAuthor

    Related: keep_stopped_hours (default 72) is in the host config and docs/cli.md says it keeps a stopped session's sandbox that long, but nothing in fctl-host reads it, so stopped sandboxes are never removed at all. Implementing that expiry would also clean up sandboxes of deleted sessions within 72 hours, even before the fleet message above exists.

    https://claude.ai/code/session_01PQMz6M4XFEb1wkZKjtJgEK

  2. fctl-sh commented on Oct 17, 2026

    @fctl-sh
    ContributorAuthor

    Fixed in 39c5de9, shipping in 0.1.2: hosts now remove stopped sandboxes after keep_stopped_hours (72 by default; 0 keeps them), at startup and hourly, which covers the sandboxes of deleted sessions too. Resuming a session whose sandbox expired starts a fresh one on its branch with a new Claude conversation, and its events now reach the transcript (first_agent_seq).

    The uplink retries turned out to last only until the session task ends, a few seconds after a stop, so they needed no change.

    https://claude.ai/code/session_01PQMz6M4XFEb1wkZKjtJgEK

  3. added a commit that references this issue on Oct 28, 2026
    04b2abe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions