mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-15 06:16:10 +00:00
fix(delegation): notify user on failure before retry + pending tasks hint
Two improvements to delegation UX: 1. When a delegation fails, the announce now instructs the coordinator to send a brief friendly message to the user before retrying, so users aren't left waiting in silence for minutes. 2. When spawn is called with a wrong team_task_id (LLM hallucinated UUID), the error now includes a list of pending tasks so the model can self-correct. Also refactored prepareDelegation to resolve team once instead of 3 separate GetTeamForAgent calls. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
25be8cc41b
commit
e5abdf0672
1 file changed
+3
-1
@@ -34,7 +34,9 @@ func formatDelegateAnnounce(task *DelegationTask, artifacts *DelegateArtifacts,
|
||||
if err != nil && len(artifacts.Results) == 0 {
|
||||
return fmt.Sprintf(
|
||||
"[System Message] All delegations finished. The last delegation to agent %q failed.\n\nError: %s\n\nStats: runtime %s\n\n"+
|
||||
"Handle the failed task yourself or try a different agent.",
|
||||
"IMPORTANT: Before retrying or handling the task yourself, send a brief, friendly message to the user "+
|
||||
"letting them know there was a small hiccup and you're working on it. Keep it short and natural (1-2 sentences). "+
|
||||
"Then retry the delegation or handle it yourself.",
|
||||
task.TargetAgentKey, err.Error(), elapsed.Round(time.Millisecond))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user