mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
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:
1 parent
73cee35917
commit
6e4d26c0ce
1 file changed
+5
-2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user