feat(agent): 云端 Agent - 增加上下文预算、任务事实与终态恢复保障
This commit is contained in:
34
backend/internal/model/task_execution.go
Normal file
34
backend/internal/model/task_execution.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
TaskCancellationUserRequest = "user_request"
|
||||
TaskCancellationParentCancelled = "parent_cancelled"
|
||||
TaskCancellationParentFailed = "parent_failed"
|
||||
TaskCancellationWorkerContext = "worker_context"
|
||||
)
|
||||
|
||||
// TaskExecutionDiagnostic records execution facts independently of the node's
|
||||
// presentation state. SafeMessage is suitable for users and model context.
|
||||
type TaskExecutionDiagnostic struct {
|
||||
Code string `json:"code"`
|
||||
Phase string `json:"phase"`
|
||||
FieldPath string `json:"fieldPath,omitempty"`
|
||||
TaskSubmitted bool `json:"taskSubmitted"`
|
||||
SubmissionOutcome string `json:"submissionOutcome"`
|
||||
RetryClass string `json:"retryClass"`
|
||||
SafeMessage string `json:"safeMessage"`
|
||||
DiagnosticID string `json:"diagnosticId"`
|
||||
WritebackOutcome string `json:"writebackOutcome,omitempty"`
|
||||
WritebackReason string `json:"writebackReason,omitempty"`
|
||||
WritebackNodeID string `json:"writebackNodeId,omitempty"`
|
||||
WritebackMessage string `json:"writebackMessage,omitempty"`
|
||||
}
|
||||
|
||||
type TaskCancellationIntent struct {
|
||||
Source string
|
||||
ActorID string
|
||||
RequestedAt time.Time
|
||||
Diagnostic TaskExecutionDiagnostic
|
||||
}
|
||||
Reference in New Issue
Block a user