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
This commit is contained in:
Marc-André Bombeck committed 2026-10-25 00:17:10 +02:00
1 parent 73cee35917
commit 6e4d26c0ce
1 file changed
+5 -2
+5 -2
View File
@@ -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();
}