auto-sync: 2026-05-22 14:58:01

This commit is contained in:
cfdaily
2026-05-22 14:58:01 +08:00
parent fa4383383b
commit e3e076bb93
+5 -2
View File
@@ -448,6 +448,7 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
# 记录 attempt
self._record_attempt(
task_id, agent_id, outcome, exit_code=exit_code,
db_path=db_path,
metadata={
"transport": meta.get("transport"),
"fallback_reason": meta.get("fallbackReason"),
@@ -838,13 +839,15 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
exit_code: Optional[int] = None,
error: Optional[str] = None,
metadata: Optional[dict] = None,
db_path: Optional[Path] = None,
) -> None:
"""记录 task_attempt"""
if not task_id or not self.db_path:
effective_db = db_path or self.db_path
if not task_id or not effective_db:
return
try:
conn = get_connection(self.db_path)
conn = get_connection(effective_db)
try:
conn.execute("BEGIN IMMEDIATE")
row = conn.execute(