Preserve native diagnostic evidence
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user