Skip to content

Phase 2: SSE chat_completion times out client-side on response delivery #10

Description

@Alajmah

Summary

chat_completion over the MCP/SSE transport times out client-side (~120s) even though the request reaches Chrome successfully and the reply is generated. This blocks Phase 2's goal of making SSE the recommended ZCode transport.

Tracked in docs/ROADMAP.md under Phase 2 — Known follow-up (discovered during Phase 0 verification, 2026-06-25).

Reproduction

Transport config (client side):

{ "chatgpt-web2api-sse": { "type": "sse", "url": "http://localhost:8090/sse" } }

Observed sequence (2026-06-25):

  • initialize → OK
  • tools/list → OK (9 tools)
  • list_models → OK (1034 bytes returned)
  • chat_completiontimes out client-side at 120s

Server-side, the send did reach Chrome: the reply appeared in the account (conversation titled with the requested marker string). The equivalent REST chat path returns the same kind of generation in ~2s.

Expected behavior

chat_completion over SSE returns the generation within the same order of magnitude as the REST path (seconds, not a timeout).

Scope

This is a Phase 2 transport bug, not a regression from PR #9 (composer redesign / Phase-2 non-text / tab isolation, merged as 9ebb236). Short SSE tools work; only the long-running chat_completion response delivery fails.

Debug hypotheses to check

Ordered roughly cheapest-to-rule-out first:

  • Progress notifications blocking the response stream
  • Async generator never completing (completion detection not firing over SSE path)
  • MCP response never posted to /messages
  • uvicorn/starlette SSE flush / backpressure (buffered chunks not flushed)
  • Long-running tool timeout mismatch (client vs server deadline)

Acceptance criteria

  • chat_completion over SSE returns the generation client-side
  • Integration test added per ROADMAP Phase 2 (initialize → tools/list → list_models → one chat call → repeated fresh connections)
  • No tab/process growth across repeated fresh SSE connections

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsize/XL

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions