mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-24 16:12:23 +03:00
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:
18
tests/unit/antigravity-dynamic-session-id-10443.test.ts
Normal file
18
tests/unit/antigravity-dynamic-session-id-10443.test.ts
Normal 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");
|
||||
});
|
||||
27
tests/unit/proxy-fetch-dns-retry-10443.test.ts
Normal file
27
tests/unit/proxy-fetch-dns-retry-10443.test.ts
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user