Preserve native diagnostic evidence

This commit is contained in:
2026-11-23 04:39:00 +00:00
parent c167a5e5ab
commit c477bcc388
9 changed files with 172 additions and 105 deletions

View File

@@ -40,6 +40,7 @@ func (s *sectionInteractions) write(offset int) {
// Earlier snapshots keep their own lengths while additional turns add messages.
type repairHistory struct {
messages []structuredoutput.Message
native any
}
func (h *repairHistory) retain(prepared *structuredoutput.PreparedSnapshot) *structuredoutput.PreparedSnapshot {
@@ -55,6 +56,10 @@ func (h *repairHistory) retain(prepared *structuredoutput.PreparedSnapshot) *str
}
snapshot := *prepared
snapshot.Messages = slices.Clip(h.messages)
if shareable, ok := prepared.PromptKit.(interface{ ShareMessages(any) any }); ok {
snapshot.PromptKit = shareable.ShareMessages(h.native)
}
h.native = snapshot.PromptKit
return &snapshot
}