mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-11 22:02:21 +00:00
test(routes): cover HTML 502 outage in MCP plan_route (#1509)
Preserve quanticsoul4772's routing-outage fix and add a focused voice-facing regression for a non-JSON gateway response.
This commit is contained in:
1 parent
94ff78be3b
commit
ca58e113c0
1 file changed
+32
@@ -303,6 +303,38 @@ test('a routing outage is reported as unavailable, not as invalid arguments', as
|
||||
);
|
||||
});
|
||||
|
||||
test('an HTML 502 gateway response tells voice the route service is unavailable', async () => {
|
||||
const catalog = composeCatalog({
|
||||
tools: coreTools,
|
||||
services: {
|
||||
routing: createRouteService({
|
||||
fetchImpl: async () =>
|
||||
new Response('<html>Bad Gateway</html>', {
|
||||
status: 502,
|
||||
headers: { 'content-type': 'text/html' },
|
||||
}),
|
||||
}),
|
||||
places,
|
||||
},
|
||||
});
|
||||
const server = createMcpServer({ catalog, name: 'test', version: '1.0.0' });
|
||||
const { result } = await server.handle({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
method: 'tools/call',
|
||||
params: {
|
||||
name: 'plan_route',
|
||||
arguments: { from: { place: 'Austin' }, to: { place: 'Dallas' } },
|
||||
},
|
||||
});
|
||||
assert.equal(result.isError, true);
|
||||
assert.equal(result.structuredContent.error, 'unavailable');
|
||||
assert.equal(
|
||||
result.content[0].text,
|
||||
'Routing service unavailable (HTTP 502)',
|
||||
);
|
||||
});
|
||||
|
||||
test('place answers say when the search limits may have left places out', async () => {
|
||||
const five = Array.from({ length: 5 }, (_, index) =>
|
||||
place(`p${index}`, 30.27, -97.74),
|
||||
|
||||
Reference in new issue
Block a user