fix: say when bike share, transit and place limits leave results out

Bike share and transit read only the three nearest systems, and place
search returns at most five matches within 50 km, while answers read as
complete. Answers now name the systems not searched and say when a place
search limit may have left places out.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 56f0d2e203
commit 302a1c1995
4 files changed
+112 -11

No files matched your search

+26
View File
@@ -248,3 +248,29 @@ test('the place and route services read the app routes and translate failures',
(error) => error.code === 'retry_later' && error.retryAfterSeconds === 5,
);
});
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),
);
const catalog = composeCatalog({
tools: coreTools,
services: {
placeSearch: placeSearch({ configured: true, places: five }),
places,
},
});
const capped = await catalog.call('search_places', {
query: 'coffee',
area: { place: 'Austin' },
limit: 100,
});
assert.equal(capped.data.may_have_more, true);
assert.match(capped.summary, /the search returns at most 5 matches\)\.$/);
const wide = await catalog.call('search_places', {
query: 'coffee',
area: { lat: 30.27, lon: -97.74, radius_km: 200 },
});
assert.equal(wide.data.searched_radius_km, 50);
assert.match(wide.summary, /searched within 50 km of the center/);
});