Prevent task session delivery NOT NULL crashes

* fix: coerce null endpoint_url when delivering task result to a session

* fix: also coerce null model so the session insert satisfies NOT NULL

* test: cover task session delivery on an empty database
This commit is contained in:
Afonso Coutinho
2026-06-01 10:28:48 +01:00
committed by GitHub
parent df7d32c70c
commit 3884f2b8b7
2 changed files with 53 additions and 2 deletions

View File

@@ -1300,8 +1300,8 @@ class TaskScheduler:
sess = DbSession(
id=session_id,
name=f"[Task] {task.name}",
endpoint_url=endpoint_url,
model=model_name,
endpoint_url=endpoint_url or "",
model=model_name or "",
owner=task.owner,
created_at=datetime.utcnow(),
updated_at=datetime.utcnow(),