From 6e4d26c0ce2e5200f8a729994ca306f9a87aef30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 25 Oct 2026 00:17:10 +0200 Subject: [PATCH] test(ai): find the wire clients that dial through the request budget The call-timeout guard found its wire clients by a direct safeFetch call. The Local and the OpenAI-compatible gateway clients now send through the call's request budget (hops.fetch), so the guard looked at two clients and failed its floor. It finds both spellings again. Refs #1279 --- src/__tests__/ai-call-timeout-guard.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/__tests__/ai-call-timeout-guard.test.ts b/src/__tests__/ai-call-timeout-guard.test.ts index 452926bcd..6e205ce40 100644 --- a/src/__tests__/ai-call-timeout-guard.test.ts +++ b/src/__tests__/ai-call-timeout-guard.test.ts @@ -56,12 +56,15 @@ function code(rel: string): string { return stripComments(readFileSync(join(SRC, rel), "utf8")); } -/** The wire clients: every `*-client.ts` that dials through `safeFetch`. */ +/** + * The wire clients: every `*-client.ts` that dials through `safeFetch`, or + * through the call's request budget (`hops.fetch`, `request-hops.ts`). + */ function wireClients(): string[] { return readdirSync(AI_DIR) .filter((f) => f.endsWith("-client.ts")) .map((f) => `lib/ai/${f}`) - .filter((rel) => /\bsafeFetch\s*\(/.test(code(rel))) + .filter((rel) => /\b(?:safeFetch|hops\.fetch)\s*\(/.test(code(rel))) .sort(); }