fix: name only tools voice offers in its instructions

The voice instructions recommended aircraft_in_area, vessels_in_area and
get_earthquakes, which voice no longer offers, and the docs said voice gets
nearly every query. The instructions now name tools voice has and send
aircraft, ship and hazard questions to analyst_query; a test keeps the
instructions to tools the voice session lists.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:36 -07:00
1 parent 33445aec73
commit 759d05db4e
3 files changed
+22 -3

No files matched your search

+16
View File
@@ -469,3 +469,19 @@ test('the debug log rotates instead of growing without bound', async (t) => {
assert.ok(live + previous < 64 * 1024 * 1024);
assert.ok(!existsSync(`${file}.2`), 'exactly one generation is retained');
});
test('the voice instructions name only tools the voice session offers', async () => {
const { coreTools } = await import('../tools/index.js');
const tools = new Set(standaloneVoiceTools().map((tool) => tool.name));
const known = new Set([
...coreTools.map((tool) => tool.name),
...GEV_REALTIME_TOOLS.map((tool) => tool.name),
]);
const named = new Set(
realtimeInstructions().match(/\b[a-z]+(?:_[a-z]+)+\b/g),
);
const missing = [...named].filter(
(name) => known.has(name) && !tools.has(name),
);
assert.deepEqual(missing, []);
});