From b1f0791f046c1e0d4c9d76cb6ad36293e0cf9c4f Mon Sep 17 00:00:00 2001 From: Jacob Schmidt Date: Sat, 28 Feb 2026 23:42:57 -0600 Subject: [PATCH] Improve sidecar client flow and S2T runtime behavior --- Journal.Core/Services/Sidecar/PythonSidecarClient.cs | 2 +- Journal.Core/Services/Sidecar/SidecarCli.cs | 2 +- Journal.Sidecar/LocalWhisperS2TService.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Journal.Core/Services/Sidecar/PythonSidecarClient.cs b/Journal.Core/Services/Sidecar/PythonSidecarClient.cs index 01284bd..d744bf8 100644 --- a/Journal.Core/Services/Sidecar/PythonSidecarClient.cs +++ b/Journal.Core/Services/Sidecar/PythonSidecarClient.cs @@ -92,7 +92,7 @@ public sealed class PythonSidecarClient(JournalConfig config) for (var i = lines.Length - 1; i >= 0; i--) { var line = lines[i].Trim(); - if (line.StartsWith("{", StringComparison.Ordinal) && line.EndsWith("}", StringComparison.Ordinal)) + if (line.StartsWith('{') && line.EndsWith('}')) return line; } diff --git a/Journal.Core/Services/Sidecar/SidecarCli.cs b/Journal.Core/Services/Sidecar/SidecarCli.cs index 517fc06..dd2f29d 100644 --- a/Journal.Core/Services/Sidecar/SidecarCli.cs +++ b/Journal.Core/Services/Sidecar/SidecarCli.cs @@ -217,7 +217,7 @@ public sealed class SidecarCli(IVaultStorageService vaultStorage, IEntrySearchSe return false; } - if (!token.StartsWith("-", StringComparison.Ordinal)) + if (!token.StartsWith('-')) { if (parsed.Query is null) { diff --git a/Journal.Sidecar/LocalWhisperS2TService.cs b/Journal.Sidecar/LocalWhisperS2TService.cs index 5b6cc57..2f6a2f2 100644 --- a/Journal.Sidecar/LocalWhisperS2TService.cs +++ b/Journal.Sidecar/LocalWhisperS2TService.cs @@ -47,7 +47,7 @@ public sealed class LocalWhisperS2TService : IS2TService, IDisposable { _factory ??= WhisperFactory.FromPath(modelPath); _segmentBuffer = new MemoryStream(); - _chunkQueue = new BlockingCollection(); + _chunkQueue = []; _cts = new CancellationTokenSource(); var waveFormat = new WaveFormat(SampleRate, Bits, Channels);