fix(agent): 云端 Agent - 媒体失败可续跑并补齐快照哈希

生成任务失败不再把整轮判死,漏传画布快照由服务端补当前内容哈希,没有偏好层时不暴露空的 profile 读取。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
ddCat
2026-09-17 23:31:54 +08:00
parent e345a1b3b3
commit e5a5f0ccc8
13 changed files with 201 additions and 41 deletions

View File

@@ -425,7 +425,7 @@ func (s *Service) CreateCloudAgentRun(userID string, req CloudAgentRequest, pare
return nil, err
}
state := cloudAgentState{Version: 1, Request: req, ParentID: parentID, Fingerprint: fingerprint, CreativeAnchor: creativeAnchor, Plan: inheritedPlan, Skills: skillSnapshots, Profile: profile, Policy: policy}
canonical := cloudAgentCanonical(system, history, req.Prompt, req)
canonical := cloudAgentCanonicalFor(system, history, req.Prompt, req, len(profile.Layers) > 0)
s.attachCloudAgentLessons(&canonical, userID, req.Prompt)
canonical.PromptCacheKey = cloudAgentPromptCacheKey(req.CanvasID, canonical.SystemPrompt)
attachCloudAgentPlan(&canonical, inheritedPlan)