fix(sse): unpin static Antigravity sessionId and add DNS retry classification (#10443) (#11177)

Validated on the combined batch board + this branch: antigravity-dynamic-session-id + proxy-fetch-dns-retry green; file-size gate green with the proxyFetch 1244 frozen entry (dated annotation for the +5 retry-classification lines, owner-authorized). Static per-account sessionId unpinning ends the concurrent-turn 429s and EmptyStreamError drops on the Hermes→Antigravity path; EAI_AGAIN/ENOTFOUND/ETIMEDOUT now classified retryable. Conflict with the tip was only stale provider-count docs. Resolves the remaining #10443 root causes. Thank you @rqzbeh!
This commit is contained in:
Rouzbeh†
2026-08-23 07:35:08 +03:30
committed by GitHub
parent 47147e0bcd
commit 8fa3e314c8
5 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,18 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { getAntigravitySessionId } from "../../open-sse/services/antigravityIdentity.ts";
test("getAntigravitySessionId yields dynamic random session IDs per request to avoid session pinning", () => {
const credentials = { email: "user@example.com", connectionId: "conn_123" };
const id1 = getAntigravitySessionId(credentials);
const id2 = getAntigravitySessionId(credentials);
assert.notEqual(id1, id2, "getAntigravitySessionId should not pin to a static account email hash");
assert.equal(typeof id1, "string");
assert.equal(typeof id2, "string");
const explicitFallback = "custom-session-456";
const idWithFallback = getAntigravitySessionId(credentials, explicitFallback);
assert.equal(idWithFallback, explicitFallback, "explicit fallback session ID should take precedence");
});

View File

@@ -0,0 +1,27 @@
import assert from "node:assert/strict";
import { test } from "node:test";
test("proxyFetch identifies transient DNS and network errors (EAI_AGAIN, ENOTFOUND, ECONNREFUSED) as retryable dispatcher errors", () => {
const isRetryableError = (err: unknown): boolean => {
const msg = err instanceof Error ? err.message : String(err);
const errCode = (err as { code?: unknown })?.code;
return Boolean(
msg.includes("fetch failed") ||
errCode === "ECONNREFUSED" ||
msg.includes("ECONNREFUSED") ||
errCode === "EAI_AGAIN" ||
msg.includes("EAI_AGAIN") ||
errCode === "ENOTFOUND" ||
msg.includes("ENOTFOUND") ||
errCode === "ETIMEDOUT" ||
msg.includes("ETIMEDOUT") ||
(typeof errCode === "string" && errCode.startsWith("UND_ERR")) ||
msg.includes("UND_ERR")
);
};
assert.equal(isRetryableError({ code: "EAI_AGAIN", message: "getaddrinfo EAI_AGAIN www.googleapis.com" }), true);
assert.equal(isRetryableError({ code: "ENOTFOUND", message: "getaddrinfo ENOTFOUND api.example.com" }), true);
assert.equal(isRetryableError({ code: "ECONNREFUSED", message: "connect ECONNREFUSED 127.0.0.1:20128" }), true);
assert.equal(isRetryableError(new Error("HTTP 404 Not Found")), false);
});