Skip to content

conversation transport: abort active turn on client disconnect #7

Closed

Description

@thatswiftdev

Is your feature request related to a problem?

When a client closes the tab / disconnects mid-turn, the conversation transport keeps the turn running to its full wall budget. POST /api/agent/sessions/:id/abort exists and works cleanly (ABORTED outcome + persisted partial transcript), but nothing wires client disconnect to it — request.raw.on('close') is never hooked to the per-turn AbortController in activeTurns.

Describe the solution you'd like

In the transport's message handler, when the request socket closes before the turn completes, call ac.abort() for that session's active turn (the same clean ABORTED path the explicit route uses). Should be gated by a deps flag (e.g. abortOnDisconnect?: boolean) so hosts can opt out — some deployments proxy long-polls where socket close is routine.

Context

Lionidas consumed this via plan 20261019T224955Z (agent-harness arc, PR #91) — everything else in that arc was host-side; this is the one seam that needs to live inside butler's transport.

Activity

  1. thatswiftdev commented on Oct 20, 2026

    @thatswiftdev
    ContributorAuthor

    Fix up in #10 (opt-in abortOnDisconnect, default off).

  2. added a commit that references this issue on Oct 20, 2026
  3. thatswiftdev commented on Oct 20, 2026

    @thatswiftdev
    ContributorAuthor

    Shipped in #10 (merged 685090e) — opt-in abortOnDisconnect, response-stream seam. Lionidas enables it on its side in its pin-bump PR.

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