fix(036): timedelta import + emit_terminal status mapping + C5 decision memory

This commit is contained in:
2026-07-28 10:42:47 +03:00
parent 24fca2ec8a
commit 99fe5288f4
2 changed files with 7 additions and 3 deletions

View File

@@ -166,10 +166,12 @@ class RunTracker:
error_code: str | None = None,
error_detail: str | None = None,
) -> None:
"""Mark the run as COMPLETED, FAILED, or CANCELLED."""
"""Mark the run as completed, failed, or cancelled.
Maps run-level status to lowercase event status for Pydantic validation."""
status_map = {"COMPLETED": "completed", "FAILED": "failed", "CANCELLED": "skipped"}
await self.append_event(
event_type="terminal",
status=status,
status=status_map.get(status, "completed"),
payload={"error_code": error_code, "error_detail": error_detail},
)