Finish the domain pipeline cleanup
This commit is contained in:
@@ -409,6 +409,17 @@ type attemptTerminalRecorder struct {
|
||||
envelope debugTimedEnvelope
|
||||
}
|
||||
|
||||
type attemptDebugPersistenceError struct {
|
||||
label string
|
||||
err error
|
||||
}
|
||||
|
||||
func (e *attemptDebugPersistenceError) Error() string {
|
||||
return fmt.Sprintf("write %s attempt debug artifact: %v", e.label, e.err)
|
||||
}
|
||||
|
||||
func (e *attemptDebugPersistenceError) Unwrap() error { return e.err }
|
||||
|
||||
func newAttemptTerminalRecorder(recorder DebugRecorder, attemptPath, label string, scope *debugLLMScope, envelope debugTimedEnvelope) attemptTerminalRecorder {
|
||||
return attemptTerminalRecorder{recorder: recorder, path: attemptPath, label: label, scope: scope, envelope: envelope}
|
||||
}
|
||||
@@ -420,7 +431,7 @@ func (r attemptTerminalRecorder) record(payload any, terminalErr error) error {
|
||||
envelope.Error = terminalErr.Error()
|
||||
}
|
||||
if err := writeDebugAttempt(r.recorder, r.path, envelope, r.scope); err != nil {
|
||||
debugErr := fmt.Errorf("write %s attempt debug artifact: %w", r.label, err)
|
||||
debugErr := &attemptDebugPersistenceError{label: r.label, err: err}
|
||||
return errors.Join(terminalErr, debugErr)
|
||||
}
|
||||
return terminalErr
|
||||
|
||||
Reference in New Issue
Block a user