fix: drain legacy process log batches

This commit is contained in:
npc0-hue
2026-08-21 23:27:52 +08:00
parent 0a605495af
commit 0cde7cdc66
3 changed files with 31 additions and 2 deletions
+3 -1
View File
@@ -1651,7 +1651,9 @@ func ValidateLogStream(stream domain.LogStream) error {
}
hasSessionID := strings.TrimSpace(stream.LogSessionID) != ""
hasSessionStart := !stream.SessionStartedAt.IsZero()
if hasSessionID != hasSessionStart {
// Keep legacy process streams with only a persisted start time valid while
// requiring the complete pair for new generation-scoped streams.
if hasSessionID && !hasSessionStart {
violations = append(violations, "logSessionId and sessionStartedAt must be provided together")
}
if (hasSessionID || hasSessionStart) && stream.Source != domain.LogStreamSourceProcess {