write finished_at to steps table (#3135)
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import json
|
import json
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta, timezone
|
||||||
from typing import Any, List, Sequence
|
from typing import Any, List, Sequence
|
||||||
|
|
||||||
import structlog
|
import structlog
|
||||||
@@ -558,6 +558,9 @@ class AgentDB:
|
|||||||
).first():
|
).first():
|
||||||
if status is not None:
|
if status is not None:
|
||||||
step.status = status
|
step.status = status
|
||||||
|
|
||||||
|
if status.is_terminal() and step.finished_at is None:
|
||||||
|
step.finished_at = datetime.now(timezone.utc)
|
||||||
if output is not None:
|
if output is not None:
|
||||||
step.output = output.model_dump(exclude_none=True)
|
step.output = output.model_dump(exclude_none=True)
|
||||||
if is_last is not None:
|
if is_last is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user