feat(daemon): Mail 失败通知 v2.0 — api_error retry + 通知增强
P1: api_error rate_limit/500/503 改为可恢复 retry(should_retry=True,60s cooldown) P2: 通知模板动态化(reason 人话翻译 + detail 信息 + 重试情况 + AI Native 知识库) 设计文档:§20.7 (20-task-type-architecture.md)
This commit is contained in:
@@ -845,6 +845,8 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
|
||||
cls.get("retry_field", "retry_count")
|
||||
)
|
||||
elif outcome == "api_error":
|
||||
# A9: [DEPRECATED] api_error 已改为 should_retry=True 走续杯路径。
|
||||
# 此分支理论上不再命中,保留作为安全兜底。
|
||||
# A9: 429/API 错误 → release counter(on_complete)+ 推回 pending + 冷却
|
||||
# 有上限:api_retry_count 累计达 max_retries 则标 failed
|
||||
await self._do_on_complete_async(on_complete, agent_id, outcome)
|
||||
@@ -1842,7 +1844,8 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
|
||||
"retry_field": "retry_count", "cooldown_seconds": 60}
|
||||
if any(kw in stderr_lower for kw in [
|
||||
"rate_limit", "500", "503", "api error"]):
|
||||
return {"outcome": "api_error", "should_retry": False}
|
||||
return {"outcome": "api_error", "should_retry": True,
|
||||
"retry_field": "retry_count", "cooldown_seconds": 60}
|
||||
if any(kw in stderr_lower for kw in [
|
||||
"compaction-diag", "context-overflow"]):
|
||||
return {"outcome": "compact_failed", "should_retry": False}
|
||||
|
||||
Reference in New Issue
Block a user