chore: remove unnecessary trimming which was breaking transcription continuity

This commit is contained in:
haritabh-z01 2026-01-15 19:21:33 +05:30
parent 4db7baf27f
commit f494afd2b0
4 changed files with 6 additions and 5 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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();
}
});

View file

@ -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", {