[PR #12749] fix(web): use prompt_async endpoint to avoid timeout over VPN/tunnel #14353

Closed
opened 2026-02-16 18:19:09 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12749

State: closed
Merged: Yes


What does this PR do?

The web UI sends prompts via POST /session/{id}/message, which holds the HTTP connection open until the agent finishes. Over Tailscale/VPN, aggressive network stacks kill the idle connection before completion, showing "Failed to send prompt" even though the server received and processed it.

The fix switches to the existing POST /session/{id}/prompt_async endpoint which returns 204 immediately. Response data already arrives through the SSE event stream. One-word change in submit.ts: .prompt().promptAsync(). Parameters are identical and the return value was unused.

Includes an e2e regression test that blocks the sync endpoint and verifies the prompt still succeeds.

Closes #12453
Closes #12748

How did you verify your code works?

  • Reverted the fix, ran the new e2e test — it fails (sync endpoint blocked → "Failed to send prompt" toast)
  • Applied the fix, ran the test — it passes (prompt succeeds, agent responds via SSE)
  • Ran existing prompt.spec.ts — still passes, no regression
  • Typecheck passes
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12749 **State:** closed **Merged:** Yes --- ### What does this PR do? The web UI sends prompts via `POST /session/{id}/message`, which holds the HTTP connection open until the agent finishes. Over Tailscale/VPN, aggressive network stacks kill the idle connection before completion, showing "Failed to send prompt" even though the server received and processed it. The fix switches to the existing `POST /session/{id}/prompt_async` endpoint which returns 204 immediately. Response data already arrives through the SSE event stream. One-word change in `submit.ts`: `.prompt()` → `.promptAsync()`. Parameters are identical and the return value was unused. Includes an e2e regression test that blocks the sync endpoint and verifies the prompt still succeeds. Closes #12453 Closes #12748 ### How did you verify your code works? - Reverted the fix, ran the new e2e test — it fails (sync endpoint blocked → "Failed to send prompt" toast) - Applied the fix, ran the test — it passes (prompt succeeds, agent responds via SSE) - Ran existing `prompt.spec.ts` — still passes, no regression - Typecheck passes
yindo added the pull-request label 2026-02-16 18:19:09 -05:00
yindo closed this issue 2026-02-16 18:19:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14353