Generalize settings and logs assistant
PR and Push Build/Test / build-and-test (push) Successful in 16m43s

This commit is contained in:
2026-05-30 12:57:51 +02:00
parent 740f93f185
commit 250d3b7a1e
32 changed files with 2219 additions and 539 deletions
@@ -203,6 +203,7 @@ public sealed class MeetingRecordingCoordinator
pipeline,
pipelineOptions,
runOptions,
startedAt,
launchProfile.Name,
runOptions.SpeakerIdentification.LiveSampleBufferDuration,
runOptions.SpeakerIdentification.MaxSnippetsPerSpeaker);
@@ -232,6 +233,7 @@ public sealed class MeetingRecordingCoordinator
public async Task<RecordingStatus> StopAsync(CancellationToken cancellationToken)
{
RecordingRun run;
var abortAsTooShort = false;
await gate.WaitAsync(cancellationToken);
try
@@ -241,14 +243,29 @@ public sealed class MeetingRecordingCoordinator
return CurrentStatus;
}
currentRun.StopCapture();
run = currentRun;
abortAsTooShort = ShouldAbortRunOnStop(run, DateTimeOffset.Now);
if (abortAsTooShort)
{
run.Abort();
}
else
{
run.StopCapture();
}
}
finally
{
gate.Release();
}
if (abortAsTooShort)
{
await CompleteAbortedRunAsync(run, cancellationToken);
logger.LogInformation("Meeting recording was shorter than the configured minimum and was aborted");
return CurrentStatus;
}
try
{
await run.Task.WaitAsync(run.Options.Recording.StopProcessingTimeout, cancellationToken);
@@ -271,7 +288,6 @@ public sealed class MeetingRecordingCoordinator
public async Task<RecordingStatus> AbortAsync(CancellationToken cancellationToken)
{
RecordingRun run;
MeetingSessionArtifacts artifacts;
await gate.WaitAsync(cancellationToken);
try
@@ -282,7 +298,6 @@ public sealed class MeetingRecordingCoordinator
}
run = currentRun;
artifacts = run.Artifacts;
run.Abort();
}
finally
@@ -290,6 +305,13 @@ public sealed class MeetingRecordingCoordinator
gate.Release();
}
await CompleteAbortedRunAsync(run, cancellationToken);
logger.LogInformation("Meeting recording aborted and artifacts deleted");
return CurrentStatus;
}
private async Task CompleteAbortedRunAsync(RecordingRun run, CancellationToken cancellationToken)
{
try
{
await run.Task.WaitAsync(run.Options.Recording.StopProcessingTimeout, cancellationToken);
@@ -302,12 +324,10 @@ public sealed class MeetingRecordingCoordinator
}
await screenshotService.CancelPendingOcrAsync(
artifacts,
run.Artifacts,
run.Options.Screenshots.Ocr.GetEffectiveTimeout(),
cancellationToken);
await artifactCleaner.DeleteRunArtifactsAsync(artifacts, run.Options, cancellationToken);
logger.LogInformation("Meeting recording aborted and artifacts deleted");
return CurrentStatus;
await artifactCleaner.DeleteRunArtifactsAsync(run.Artifacts, run.Options, cancellationToken);
}
public Task<MeetingScreenshotCaptureResult> CaptureScreenshotAsync(CancellationToken cancellationToken)
@@ -1265,7 +1285,13 @@ public sealed class MeetingRecordingCoordinator
string artifactName)
{
var folder = VaultPath.Resolve(vault, configuredFolder);
return Path.Combine(folder, $"{startedAt:yyyyMMdd-HHmmss-fffffff}-{artifactName}.md");
return Path.Combine(folder, $"{startedAt:yyyyMMdd-HHmm}-{artifactName}.md");
}
private static bool ShouldAbortRunOnStop(RecordingRun run, DateTimeOffset stoppedAt)
{
var minimumDuration = run.Options.Recording.MinimumCompletedMeetingDuration;
return minimumDuration > TimeSpan.Zero && stoppedAt - run.StartedAt < minimumDuration;
}
private async Task CompleteRunAsync(RecordingRun run)
@@ -1318,6 +1344,7 @@ public sealed class MeetingRecordingCoordinator
ISpeechRecognitionPipeline pipeline,
SpeechRecognitionPipelineOptions pipelineOptions,
MeetingAssistantOptions options,
DateTimeOffset startedAt,
string launchProfileName,
TimeSpan liveSampleBufferDuration,
int maxSpeakerSamples)
@@ -1332,6 +1359,7 @@ public sealed class MeetingRecordingCoordinator
Pipeline = pipeline;
PipelineOptions = pipelineOptions;
Options = options;
StartedAt = startedAt;
LaunchProfileName = launchProfileName;
pipelines.Add(pipeline);
speakerSampleCollector = new SpeakerAudioSampleCollector(
@@ -1363,6 +1391,8 @@ public sealed class MeetingRecordingCoordinator
public MeetingAssistantOptions Options { get; private set; }
public DateTimeOffset StartedAt { get; }
public string LaunchProfileName { get; private set; }
public CancellationToken CaptureCancellation => CaptureCancellationSource.Token;