Fix run package profile and log ingestion

This commit is contained in:
npc0-hue
2026-08-30 23:59:18 +08:00
parent 8686419fb2
commit 8194671656
5 changed files with 94 additions and 2 deletions
+5 -1
View File
@@ -150,7 +150,7 @@ func (svc *CoreService) ensureRunLogStreamForBatch(batch domain.LogBatchIngest,
expectedStreamID = runSessionLogStreamID(batch.RunEndpointID, batch.ServerInstanceID, batch.LogSessionID, batch.StreamKey)
}
if batch.LogStreamID != expectedStreamID {
if !legacyAutonomousLogStream(batch) {
if !legacySessionRunLogStream(batch) && !legacyAutonomousLogStream(batch) {
return repo.ErrNotFound
}
}
@@ -168,6 +168,10 @@ func (svc *CoreService) ensureRunLogStreamForBatch(batch domain.LogBatchIngest,
return err
}
func legacySessionRunLogStream(batch domain.LogBatchIngest) bool {
return batch.LogSessionID != "" && batch.LogStreamID == runLogStreamID(batch.RunEndpointID, batch.ServerInstanceID, batch.StreamKey)
}
func legacyAutonomousLogStream(batch domain.LogBatchIngest) bool {
jobID, ok := jobIDFromLogBatch(batch)
return ok && strings.HasPrefix(jobID, "autonomous-")