diff --git a/dotnet/src/Microsoft.Agents.AI.Hosting/HostedWorkflowState.cs b/dotnet/src/Microsoft.Agents.AI.Hosting/HostedWorkflowState.cs index 8c66046d231..8887cef6135 100644 --- a/dotnet/src/Microsoft.Agents.AI.Hosting/HostedWorkflowState.cs +++ b/dotnet/src/Microsoft.Agents.AI.Hosting/HostedWorkflowState.cs @@ -364,9 +364,7 @@ private void UpdateCursor(string sessionId, CheckpointInfo? checkpoint) private void WarnOnNoProgress(string sessionId) // The resumed turn drove no work: the checkpoint may be stale or the input may not match the workflow's // expected type, so the session's state may not have progressed. - => this._logger.LogWarning( - "Resuming workflow session '{SessionId}' produced no events; the checkpoint may be stale or the input may not match the workflow's expected input type. Session state may not have progressed.", - sessionId); + => this._logger.LogWorkflowResumeMadeNoProgress(sessionId); /// /// Gets the recorded head checkpoint for , if any. @@ -383,3 +381,12 @@ internal bool TryGetCheckpoint(string sessionId, out CheckpointInfo? checkpoint) return this._cursor.TryGetValue(sessionId, out checkpoint); } } + +[System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +internal static partial class HostedWorkflowStateLogMessages +{ + [LoggerMessage( + Level = LogLevel.Warning, + Message = "Resuming workflow session '{SessionId}' produced no events; the checkpoint may be stale or the input may not match the workflow's expected input type. Session state may not have progressed.")] + public static partial void LogWorkflowResumeMadeNoProgress(this ILogger logger, string sessionId); +}