@ddtcorex/dsh-maestro-review 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -644,7 +644,30 @@ function assertSafeId(value: number, label: string): void {
644
644
  export function auditorOutputFromSession(session: unknown) {
645
645
  const events = readSessionEvents(session)
646
646
  if (events.length === 0) return []
647
- return finalAssistantOutput(events as Parameters<typeof finalAssistantOutput>[0]) ?? []
647
+ return finalAssistantOutput(normalizeAssistantEventStreams(events) as Parameters<typeof finalAssistantOutput>[0]) ?? []
648
+ }
649
+
650
+ /**
651
+ * `finalAssistantOutput` iterates `event.data.stream` for every
652
+ * assistant/message and assistant/attempt event unconditionally (dsh-subagent
653
+ * 0.1.5+) — an event missing it (a legacy or degraded session snapshot)
654
+ * throws `TypeError: stream is not iterable` instead of the documented
655
+ * never-throws behavior. Default it to `[]` so folding a legacy event still
656
+ * falls back to the message's own `content`, which `AssistantOutputFold`
657
+ * prefers regardless of stream.
658
+ */
659
+ function normalizeAssistantEventStreams(events: unknown[]): unknown[] {
660
+ return events.map((event) => {
661
+ const e = event as { type?: string; data?: Record<string, unknown> }
662
+ if (
663
+ (e.type === 'assistant/message' || e.type === 'assistant/attempt') &&
664
+ e.data &&
665
+ e.data.stream === undefined
666
+ ) {
667
+ return { ...e, data: { ...e.data, stream: [] } }
668
+ }
669
+ return event
670
+ })
648
671
  }
649
672
 
650
673
  /** Full review + performance audit; resolves to the comment body that was posted. */
@@ -3,7 +3,7 @@ stages: [review]
3
3
 
4
4
  variables:
5
5
  # Image registry — pin the SHA for reproducibility
6
- REVIEWER_IMAGE: "ddtcorex/maestro-reviewer:0.6.2"
6
+ REVIEWER_IMAGE: "ddtcorex/maestro-reviewer:0.7.2"
7
7
  # Or use $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA when building the image in the same project
8
8
 
9
9
  review: