diegosouzapw/OmniRoute · error · Error

Kimi Connect stream ended without a successful EndStream…

Error message

Kimi Connect stream ended without a successful EndStream frame

What it means

Terminal-state guard in the Kimi Connect stream: the source ended without receiving a successful EndStream frame. Deltas may have been emitted, but the protocol's normal completion signal never arrived — the connection dropped or upstream aborted generation mid-response.

Solutions

  1. Close the stream with an error so clients see truncation rather than a clean end
  2. Retry the turn (fresh Kimi Web connection)
  3. Check cookie/session validity if endings recur consistently
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at open-sse/executors/kimi-web.ts:520 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/cde30c702bac8dac. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/executors/kimi-web.ts:520

                  const delta = extractDelta(frame.message);
                  if (delta) {
                    if (!emittedRole) {
                      emittedRole = true;
                      emitChunk(controller, { role: "assistant", content: "" });
                    }
                    if (delta.kind === "think") {
                      emitChunk(controller, { reasoning_content: delta.text });
                    } else {
                      emitChunk(controller, { content: delta.text });
                    }
                  }
                }
                // Compact the buffer.
                buffer = buffer.subarray(offset);
              }
            }
            throw new Error("Kimi Connect stream ended without a successful EndStream frame");
          } catch (err) {
            if (signal?.aborted) {
              try {
                controller.close();
              } catch {
                /* controller already closed */
              }
            } else {
              try {
                controller.error(err);
              } catch {
                /* controller already closed */
              }
            }
          }
        },
      });

View on GitHub (pinned to a179ffed5b)