feat(agent): 云端 Agent - 增加上下文预算、任务事实与终态恢复保障

This commit is contained in:
ddCat
2026-09-19 20:43:20 +08:00
parent 3bf21d79af
commit b52bc9d5f2
61 changed files with 3512 additions and 309 deletions

View 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
}