test(assistant): the attachments e2e provider answers the model list a saved connection asks for

Saving the custom connection lists the server's models first, and the fake
provider answered that with a 404, so the setup got 502. It answers /api/tags
the way the other assistant suites' fake provider does.
This commit is contained in:
Maurice
2026-10-24 21:57:56 +02:00
parent 2d1da19152
commit b333910533
@@ -92,6 +92,12 @@ async function readBody(req: IncomingMessage): Promise<string> {
}
async function answer(req: IncomingMessage, res: ServerResponse): Promise<void> {
// Saving the connection lists the server's models first, the way an Ollama-style server answers.
if (req.method === 'GET' && req.url?.startsWith('/api/tags')) {
res.writeHead(200, { 'content-type': 'application/json' });
res.end(JSON.stringify({ models: [{ name: 'fake-model', size: 1 }] }));
return;
}
if (req.method !== 'POST' || req.url !== '/v1/chat/completions') {
res.writeHead(404).end();
return;