feat(management): Flow Debugger inbound row carries exception detail; LogsTruncated on the run result

FlowDebugRunner.RunMethodAsync now passes InboundScriptResult.ErrorDetail through to the
synthesized inbound audit row's errorDetail, so a SCRIPT_ERROR run's exception ToString() lands
on AuditDetails.ErrorDetail for the Flow Debugger's inbound node to read (never surfaced to the
HTTP caller). FlowDebugRunResult grows an additive LogsTruncated (default false, last positional
member) reporting the inline FlowTraceCollector's low-priority (ScriptLog) truncation separately
from Truncated (step-row fidelity); RunMethodAsync/RunScriptAsync thread collector.LogsTruncated
through on their two collector-backed results.
This commit is contained in:
Joseph Doherty
2026-09-09 12:23:38 -04:00
parent 8ba1a0e2f8
commit ba7f8ee7a9
3 changed files with 72 additions and 3 deletions
@@ -61,6 +61,11 @@ public record FlowDebugReplayCommand(Guid ExecutionId);
/// <param name="Truncated">True when the inline event list was capped (the audit rows remain complete).</param>
/// <param name="StartedAtUtc">When the run started.</param>
/// <param name="FinishedAtUtc">When the run finished (or the replay was served).</param>
/// <param name="LogsTruncated">
/// Step-logs (D7, 2026-09-09): true when the inline <c>FlowTraceCollector</c> dropped one
/// or more low-priority <c>ScriptLog</c> rows to protect room for step rows — the run's log lines
/// are incomplete inline, but Replay (which reads the audit store, never truncated) is complete.
/// </param>
public record FlowDebugRunResult(
Guid RootExecutionId,
bool Completed,
@@ -69,4 +74,5 @@ public record FlowDebugRunResult(
IReadOnlyList<AuditEvent> Events,
bool Truncated,
DateTimeOffset StartedAtUtc,
DateTimeOffset FinishedAtUtc);
DateTimeOffset FinishedAtUtc,
bool LogsTruncated = false);
@@ -188,6 +188,7 @@ public sealed class FlowDebugRunner
executionId: root,
durationMs: (int)Math.Min(sw.ElapsedMilliseconds, int.MaxValue),
errorMessage: result.ErrorMessage,
errorDetail: result.ErrorDetail,
requestSummary: requestJson,
responseSummary: result.ResultJson,
extra: new ScriptTraceExtra { Source = SourceTag }.ToJson());
@@ -212,7 +213,7 @@ public sealed class FlowDebugRunner
return new FlowDebugRunResult(
root, result.Success, result.ErrorMessage, result.Success ? null : result.ErrorCode,
ordered, Truncated: collector.Truncated, startedAt, finishedAt);
ordered, Truncated: collector.Truncated, startedAt, finishedAt, LogsTruncated: collector.LogsTruncated);
}
/// <summary>
@@ -397,7 +398,8 @@ public sealed class FlowDebugRunner
return new FlowDebugRunResult(
root, response.Success, response.ErrorMessage,
response.Success ? null : faultCode ?? CallFailedCode,
ordered, Truncated: collector.Truncated, startedAt, DateTimeOffset.UtcNow);
ordered, Truncated: collector.Truncated, startedAt, DateTimeOffset.UtcNow,
LogsTruncated: collector.LogsTruncated);
}
/// <summary>