chore: remove unnecessary trimming which was breaking transcription continuity
This commit is contained in:
parent
4db7baf27f
commit
f494afd2b0
4 changed files with 6 additions and 5 deletions
|
|
@ -57,7 +57,7 @@ export class OllamaFormatter implements FormattingProvider {
|
|||
const match = aiResponse.match(
|
||||
/<formatted_text>([\s\S]*?)<\/formatted_text>/,
|
||||
);
|
||||
const formattedText = match ? match[1].trim() : aiResponse.trim();
|
||||
const formattedText = match ? match[1] : aiResponse;
|
||||
|
||||
logger.pipeline.debug("Formatting completed", {
|
||||
original: text,
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export class OpenRouterProvider implements FormattingProvider {
|
|||
const match = aiResponse.match(
|
||||
/<formatted_text>([\s\S]*?)<\/formatted_text>/,
|
||||
);
|
||||
const formattedText = match ? match[1].trim() : aiResponse.trim();
|
||||
const formattedText = match ? match[1] : aiResponse;
|
||||
|
||||
logger.pipeline.debug("Formatting completed", {
|
||||
original: text,
|
||||
|
|
|
|||
|
|
@ -200,8 +200,9 @@ export class NativeBridge extends EventEmitter {
|
|||
this.proc.on("close", (code, signal) => {
|
||||
const helperName = getNativeHelperName();
|
||||
const isNormalExit = code === 0 && signal === null;
|
||||
const isIntentionalKill = signal === "SIGTERM";
|
||||
|
||||
if (isNormalExit) {
|
||||
if (isNormalExit || isIntentionalKill) {
|
||||
this.logger.info(`${helperName} process exited normally`);
|
||||
} else {
|
||||
this.logger.error(`${helperName} process crashed`, { code, signal });
|
||||
|
|
@ -212,7 +213,7 @@ export class NativeBridge extends EventEmitter {
|
|||
this.proc = null;
|
||||
|
||||
// Auto-restart on crash
|
||||
if (!isNormalExit) {
|
||||
if (!isNormalExit && !isIntentionalKill) {
|
||||
this.attemptRestart();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -421,7 +421,7 @@ export class TranscriptionService {
|
|||
this.transcriptionMutex.release();
|
||||
}
|
||||
|
||||
let completeTranscription = session.transcriptionResults.join(" ").trim();
|
||||
let completeTranscription = session.transcriptionResults.join(" ");
|
||||
let formattingDuration: number | undefined;
|
||||
|
||||
logger.transcription.info("Finalizing streaming session", {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue