Surface an operator-visible marker when script log output is truncated
Summary
- When a single script's output exceeded the in-memory retention buffer,
HalibutScriptObserverdropped the oldest entries with only a Serilog/Seq warning — the operator's task log silently jumped, with no indication anything was lost. - Insert an operator-visible gap marker at the head of the retained log on truncation, and stream it via the output sink so it persists even in streaming mode (where the bulk persist is skipped) — landing exactly once in either mode. Anchored to the oldest-retained entry's timestamp (stays at the head under
Occurred-ordering);StdOutso it reads as an informational notice, not a false error. -
TruncateIfExceededis marker-aware: a marker already at the head doesn't count toward the cap, so re-truncating an unchanged buffer never emits a duplicate marker.
Scope decisions (the rest of #5 (closed)/#6, after investigation)
-
SuccessWithWarningrollup — deliberately NOT added.ServerTask.Stateis a string; a new terminal value would force everyState-consuming caller (incl. the frontend) to change (semi-breaking) for no concrete need. TheWarninglog category already surfaces warnings. -
#6 publish-success assertion — already implemented.
success = completeResponse.ExitCode == 0is a positive assertion from the agent'sCompleteScriptRPC (same model as Octopus/Calamari), not an inference. No change needed.
Non-breaking
Private signature change only (TruncateIfExceeded void → returns the marker). No public API, schema, or response-shape change. Consumers of LogLines see at most one extra informational line on truncation (rare — only above the 100k-entry default buffer).
Test plan
-
HalibutScriptObserverStreamingTests: marker at head + oldest dropped (bulk path); marker streamed as informational (not stderr/Error); no marker when under cap -
Updated HalibutScriptObserverTests.ObserveAndCompleteAsync_VerboseOutput_TruncatesOldestLogsto assert the marker is present + the cap holds within +1 -
Full unit suite: 5844/5844 green -
Full solution build: 0 errors