From 77aa4f3d07dd84cbbe4030234a7e395d579a2f31 Mon Sep 17 00:00:00 2001 From: ValueOn AG Date: Thu, 26 Feb 2026 09:22:07 +0100 Subject: [PATCH] feat: enforce aggressive hybrid mode for names-only captions Made-with: Cursor --- src/bot/orchestrator.ts | 45 +++++++++-------------------------------- 1 file changed, 10 insertions(+), 35 deletions(-) diff --git a/src/bot/orchestrator.ts b/src/bot/orchestrator.ts index f621457..fcbe9ea 100644 --- a/src/bot/orchestrator.ts +++ b/src/bot/orchestrator.ts @@ -926,14 +926,9 @@ export class BotOrchestrator { this._page, this._logger, (entry) => { - const transferMode = this._getEffectiveTransferMode(); - if (transferMode === 'audio') { - // In audio mode, captions are only used as speaker hints. - this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'speakerHint'); - } else { - this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'caption'); - this._callbacks.onTranscript(entry); - } + // Aggressive hybrid mode: captions are always speaker hints only. + // Caption text is never persisted as transcript due to language quality issues. + this._sendTranscript(entry.speaker, entry.text, entry.isFinal, 'speakerHint'); }, this._options.language ); @@ -958,11 +953,8 @@ export class BotOrchestrator { // This ensures Teams gets our controlled audio stream when it calls getUserMedia await this._audioProcedure.injectAudioOverride(); - // Inject audio capture (WebRTC interception) if transfer mode requires it - const transferMode = this._getEffectiveTransferMode(); - if (transferMode === 'audio') { - await this._audioCaptureProcedure!.injectCaptureOverride(); - } + // Aggressive hybrid mode: always capture meeting audio as transcript source. + await this._audioCaptureProcedure!.injectCaptureOverride(); // Handle page errors this._page.on('pageerror', (error) => { @@ -1108,32 +1100,15 @@ export class BotOrchestrator { } } - /** - * Subscribe to captions only as speaker hints (without enabling captions flow). - * This supports hybrid mode: audio text + caption-based speaker names. - */ - private async _enableSpeakerHintsFromCaptions(): Promise { - try { - await this._captionsProcedure!.subscribeToCaptions(); - this._logger.info('Speaker hints from captions subscribed (audio mode)'); - } catch (error) { - this._logger.warn('Could not subscribe to captions for speaker hints:', error); - } - } - /** * Enable transcript capture (captions or audio) based on transfer mode. */ private async _enableTranscriptCapture(): Promise { - const transferMode = this._getEffectiveTransferMode(); - this._logger.info(`Transfer mode: ${transferMode} (configured: ${this._options.transferMode || 'auto'})`); - - if (transferMode === 'caption') { - await this._enableCaptions(); - } else { - await this._enableAudioCapture(); - await this._enableSpeakerHintsFromCaptions(); - } + this._logger.info( + `Aggressive hybrid mode active: audio STT + background captions for speaker hints (configured transferMode: ${this._options.transferMode || 'auto'})`, + ); + await this._enableAudioCapture(); + await this._enableCaptions(); } /**