Unify structured call completion and retain typed failures
This commit is contained in:
@@ -41,8 +41,16 @@ type ExecutionCounts struct {
|
||||
HTTPStatus *int `json:"http_status,omitempty"`
|
||||
}
|
||||
|
||||
// ReasonCode is a fixed, safe explanation category. Raw provider errors and
|
||||
// prompt content are never stored in an operation outcome.
|
||||
// FailureClass determines whether processing can skip an operation or must stop.
|
||||
type FailureClass string
|
||||
|
||||
const (
|
||||
FailureRecoverable FailureClass = "recoverable"
|
||||
FailureFatal FailureClass = "fatal"
|
||||
FailureCanceled FailureClass = "canceled"
|
||||
)
|
||||
|
||||
// ReasonCode is a fixed explanation category for the serialized outcome.
|
||||
type ReasonCode string
|
||||
|
||||
const (
|
||||
@@ -85,6 +93,8 @@ type Operation struct {
|
||||
Reference Reference `json:"reference"`
|
||||
Counts ExecutionCounts `json:"counts"`
|
||||
Succeeded bool `json:"succeeded"`
|
||||
FailureClass FailureClass `json:"-"`
|
||||
Cause error `json:"-"`
|
||||
FailureReason ReasonCode `json:"failure_reason,omitempty"`
|
||||
RecoveryReasons []RecoveryReason `json:"recovery_reasons,omitempty"`
|
||||
ProposalIndices []int `json:"proposal_indices,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user