chore(lint): reduce warning debt across core adapters and model clients

This commit is contained in:
William Valentin
2026-02-15 23:03:42 -08:00
parent 92da407e22
commit 49b752e8b0
17 changed files with 239 additions and 117 deletions
+8 -4
View File
@@ -12,7 +12,7 @@ vi.mock('../auth/openai.js', () => ({
})),
}));
function makeSse(events: Array<{ event: string; data: any }>): string {
function makeSse(events: Array<{ event: string; data: unknown }>): string {
return events
.map((e) => `event: ${e.event}\ndata: ${JSON.stringify(e.data)}\n\n`)
.join('');
@@ -39,8 +39,12 @@ describe('OpenAIClient OAuth (Codex)', () => {
{ event: 'response.completed', data: { type: 'response.completed', response: { usage: { input_tokens: 2, output_tokens: 2 } } } },
]);
globalThis.fetch = vi.fn(async (_url: any, init?: any) => {
const parsed = JSON.parse(init.body);
globalThis.fetch = vi.fn(async (_url: string | URL | Request, init?: RequestInit) => {
const body = typeof init?.body === 'string' ? init.body : '';
if (!body) {
throw new Error('Expected JSON body');
}
const parsed = JSON.parse(body) as Record<string, unknown>;
expect(parsed.store).toBe(false);
expect(parsed.stream).toBe(true);
expect(typeof parsed.instructions).toBe('string');
@@ -54,7 +58,7 @@ describe('OpenAIClient OAuth (Codex)', () => {
});
return new Response(stream, { status: 200 });
}) as any;
}) as typeof fetch;
const client = new OpenAIClient({ model: 'gpt-5.3-codex', useOAuth: true });
const resp = await client.chat({