feat(webchat): add server-side dictation

This commit is contained in:
clawsweeper
2026-05-02 20:53:38 +00:00
parent 36cecbb9b0
commit db9a2468a1
2 changed files with 5 additions and 1 deletions

View File

@@ -136,6 +136,10 @@ describe("OpenClawApp dictation recorder lifecycle", () => {
await app.toggleChatDictation();
const recorder = MockMediaRecorder.instances[0];
recorder.emitData(new Blob(["audio"], { type: "audio/webm" }));
transcribeChatAudioMock.mockImplementationOnce(async () => {
expect(app.chatDictationChunks).toEqual([]);
return null;
});
await app.toggleChatDictation();

View File

@@ -1016,7 +1016,7 @@ export class OpenClawApp extends LitElement {
if (this.chatDictationRecorder !== recorder) {
return;
}
const chunks = this.chatDictationChunks;
const chunks = [...this.chatDictationChunks];
this.chatDictationChunks = [];
const canceledByRequest = this.chatDictationCancelNextStop;
this.chatDictationCancelNextStop = false;