SSE client drops every ~16s on stable 1.92.1 — reconnect backoff runaways to 120s (no keepalive, no 429 handling)
@owenshen0907 がすでに取り組んでいます。
2026年7月22日 から。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, nodejs
- 領域
- api, backend, networking
調査の方向性
Start with src/gep/a2aProtocol.js and compare its SSE behavior with test/heartbeatResilienceRound3.test.js and test/issue600EventSourceFallback.test.js, which mention the newer 2.0.0 line. Check the /a2a/events/stream endpoint behavior, including idle output and 429 responses. Done means stable reconnect behavior after successful connections and coordinated handling of idle streams and rate limits, with the applicable tests passing.
索引モデルが issue の本文から書いたものです。
説明
SSE client drops every ~16s on stable @evomap/[email protected] — reconnect backoff runaways to 120s (no keepalive, no 429 handling)
Summary
On the current stable @evomap/[email protected] (published 2026-07-16), the daemon's SSE connection to the hub drops roughly every 16 seconds, and the client's reconnect backoff then runs away exponentially (5s → 10s → … → 120s) and never recovers — so the event stream is effectively dead until something external resets it.
I reproduced and root-caused this locally. This is filed as an Issue (not a PR) because src/gep/a2aProtocol.js in this repo appears to be the obfuscated/minified release artifact (the file I fetched decodes to _0x… obfuscated code, not source), so I can't open a clean PR diff against it. See "Repo state note" below.
Environment
- Package:
@evomap/[email protected](latestdist-tag, 2026-07-16) - SSE transport:
eventsourcepackage (v4.x) viarequire('eventsource')insidesrc/gep/a2aProtocol.js→hubOpenEventStream()/startEventStream() - Hub:
https://evomap.ai/a2a/events/stream?node_id=…&duration_ms=… - OS: win32 (Node 22)
Symptoms
[SSE] Event stream connectedappears, then ~16s later the socket is killed (intermediate proxy/firewall drops idle long-lived streams).onerrorfires; reconnect is scheduled via_sseReconnectMswhich doubles each error and is never reset on a successful (re)connect.- Over a few minutes the reconnect gap climbs to the 120s cap and stays there → SSE is "fake-dead".
- Hub rate-limits SSE connections hard (reproduced frequent HTTP 429), which the client does not honor (no
Retry-Afterhandling, no jitter) → tight retry storm makes the 429s worse.
Root causes (all reproduced locally)
- No client-side keepalive / idle probe. When the hub is idle it sends zero bytes, so the proxy kills the idle socket at ~16s. A client ping/heartbeat on the SSE socket is impossible because SSE is server→client only — the fix must come from the hub sending periodic
: keepalivecomment frames. _sseReconnectMsonly grows, never resets. The backoff starts at 5000ms and doubles on every error, but_sseReconnectMsis not reset to base on a successfulonopen, so it saturates at 120000ms and stays there.- No 429 /
Retry-Afterhandling, no jitter. Rapid reconnects trigger hub 429s; the client ignores them and retries immediately, creating a reconnect storm across nodes.
Proposed fixes
Client (a2aProtocol.js, once source is available):
- Reset
_sseReconnectMsto a base (_sseReconnectBaseMs, e.g. 5000) insideonopenon every successful (re)connect — this is the core runaway fix. - In
onerror, honor HTTP 429 /Retry-After, apply ±30% jitter, and cap at_sseMaxReconnectMsto avoid synchronized storms.
Server (hub, /a2a/events/stream) — required for 100% uptime:
- Send a
: keepalive\n\ncomment frame every ~10s (comment frames don't triggeronmessagebut keep the TCP socket non-idle, dodging the 16s proxy kill). - Add
X-Accel-Buffering: no+Cache-Control: no-transformso nginx/CDN don't buffer the stream. - Return
Retry-Afteron 429 to coordinate with the client backoff.
Note: the existing
POST /a2a/heartbeatis a separate TCP connection (node registration) and does not keep the SSE socket alive — it's a different path.
Local diagnostics
curl -Nagainst/a2a/events/streamreturned HTTP 429 in ~1.6s with no keepalive bytes in 22s → confirms hub sends nothing when idle and rate-limits aggressively.- Observed pre-patch reconnect gaps: 7s → 5s → 12s → 48s → 118s (runaway to the 120s cap). Post local client-side patch (bounded backoff + onopen reset): stable 2–4s, no 429 storm, no crash.
Repo state note (why Issue, not PR)
When I fetched src/gep/a2aProtocol.js from main it decodes to obfuscated code (const _0x1f36f7=_0x447a;…), so there is no readable source to diff against for a PR. Meanwhile, test files in this repo (test/heartbeatResilienceRound3.test.js, test/issue600EventSourceFallback.test.js) suggest the SSE client has been reworked on a 2.0.0 line (fetch-based stream + a round-3 audit that reset backoff on wake).
Questions for maintainers:
- Is the fix already shipping in the
2.0.0-betaseries (latest2.0.0-beta.5, 2026-07-21)? If so, can stable1.92.1get a backport, or should users move to beta? - Can the hub emit
: keepaliveframes so idle SSE survives proxies?
Local workaround (for others hitting this now)
A non-invasive preload that wraps the eventsource EventSource with a bounded-backoff reconnect facade, keeping the daemon stable on 1.92.1 until an official fix lands. Applied via NODE_OPTIONS="--require sse-idle-watchdog.js". Effectively bounds reconnect to 2–4s with no 429 storm.
- 主要言語
- JavaScript
- スター
- 9.1k
- フォーク
- 848
- 平均マージ
- 14時間 39分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
EvoMap/evolver のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[Windows] fdatasyncSync on read-only fd throws EPERM, blocks node credential snapshot (canonicalIdentityLock.js)対応中かも @scui73414-bot が 64 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
似ている issue
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10対応中かも @goranai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
NL-BioImaging/OMERO.biomero#92 ·
メンテナーはふだん 1 日以内に返信
-
bug: juros do parcelamento travados em 1x no gateway Rede Débito e Crédito 3DS (woo-rede 5.6.0)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
LinkNacional/woo-rede#367 ·
-
Docs: 1 broken linkオープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug Next.js
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
getsentry/sentry-wizard#1397 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信