Skip to content

Approve hangs forever when the review is open in two tabs (HTTP/1.1 connection limit exhausted by EventSource streams) #4218

Done

Description

@kevinseidler

Version: plannotator 0.29.7, macOS, Chromium-based (Electron) browser

What happens

In annotate mode with --gate, pressing Approve never completes if the same review session is open in two browser tabs. The Approve, More decisions and Close buttons stay disabled (stuck mid-submit), no error is shown, the browser's network log shows nothing, and the --result-file is never written. The server process stays alive and responsive (e.g. GET /api/plan answers instantly), so the agent waiting on the gate waits forever.

Cause

Each review tab keeps several long-lived HTTP/1.1 connections open (EventSource streams such as /api/annotate/client-lease and /api/external-annotations/stream, plus others). Chromium allows 6 concurrent HTTP/1.1 connections per origin. With two tabs on the same localhost:<port>, the pool is exhausted, so POST /api/approve (and likewise /api/feedback and /api/deny) is queued by the browser and never sent.

On the server side we saw 7 established connections from the browser to the review port. Closing the second tab released a connection, and within a few seconds the queued Approve went through, the result file was written ({"decision":"approved"}), and the process exited normally.

Repro

  1. plannotator annotate plan.md --gate --json --result-file out.json
  2. Open the session URL in two tabs of a Chromium-based browser.
  3. Press Approve in one of them: the buttons stay disabled and out.json never appears.
  4. Close the other tab: the approval completes immediately.

Suggestions

  • Multiplex the per-tab streams into a single SSE/WebSocket connection, or close the streams in tabs that don't hold the annotate client lease.
  • Give submit requests (approve, feedback, deny) a timeout and show an error with retry, instead of waiting silently.
  • Optionally serve HTTP/2, which isn't subject to the 6-connection limit.

Related, but not the same: #1142 (gates waiting after all clients disconnect) and #636 (reusing a tab instead of opening new ones).

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