Reuse Athena router key for OpenClaw dictation

This commit is contained in:
Mikei386
2026-09-16 15:28:10 +02:00
parent ba68d4e8fb
commit 8df3e1ad43
6 changed files with 50 additions and 9 deletions
@@ -57,3 +57,25 @@ test("dictation registers separately and sends G.711 audio to Athena Whisper", a
await new Promise((resolve) => server.close(resolve));
}
});
test("dictation reuses only a TTS key for the same Athena origin", () => {
let transcription;
plugin.register({
registerRealtimeTranscriptionProvider: (value) => { transcription = value; },
registerRealtimeVoiceProvider: () => {},
registerHttpRoute: () => {},
});
const base = {
talk: { realtime: { providers: { "athena-talk": { modelProvider: "llama-cpp" } } } },
models: { providers: { "llama-cpp": { baseUrl: "http://athena:8081/v1" } } },
};
const withTts = (baseUrl) => ({ ...base, tts: { providers: { openai: {
baseUrl, apiKey: "shared-key",
} } } });
assert.equal(transcription.resolveConfig({
cfg: withTts("http://athena:8081/v1"), rawConfig: {},
}).apiKey, "shared-key");
assert.equal(transcription.resolveConfig({
cfg: withTts("http://other:8081/v1"), rawConfig: {},
}).apiKey, "");
});