fix(voice): keyless Gemini voice drops the microphone hint

The Gemini token route now answers a missing key with code API_KEY_MISSING,
the session carries it to the error state as missingKey, and the voice
control hides "Check microphone permission" for that error, as it already
does for OpenAI. The OpenAI controller sends the same flag, so the shared
control and the controller agree whichever updates last.
This commit is contained in:
Sameh Khamis committed 2026-11-10 17:06:50 -08:00
1 parent 9560a6dcd1
commit b89f81b729
8 files changed
+74 -12

No files matched your search

+18
View File
@@ -3638,3 +3638,21 @@ test('cancelling a queued globe reset also skips its dependent rotation', async
h.c.stop();
}
});
test('a missing server key reaches the error state flagged, other token failures do not', async () => {
for (const [body, missingKey] of [
[{ error: 'Add a Gemini API key in Provider Settings', code: 'API_KEY_MISSING' }, true],
[{ error: 'Gemini quota is unavailable. Try again later.' }, undefined],
]) {
const h = harness({
fetchImpl: async () => Response.json(body, { status: 503 }),
});
await h.c.start();
const error = h.events.filter(
(event) => event.type === 'state' && event.state === 'error',
).at(-1);
assert.equal(error?.detail, body.error);
assert.equal(error?.missingKey, missingKey);
assert.equal(h.sockets.length, 0);
}
});