Turn two State Hub sync failures into clean outcomes.
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Multi-Context Image / build-and-push (push) Successful in 31s

An over-long blocked_on now returns a 422 instead of a 500, and decided decision records such as 'approved' map onto the hub's made type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Assistant: claude-code
Assistant-Model: opus
Assistant-Process: 57383@bnt-lap001
Assistant-Session: ef71febe-2a37-4c34-a979-2508ca973c91
This commit is contained in:
tegwick 2026-10-06 11:16:00 +02:00
parent 2b5d8f90f8
commit 7d992821fb
5 changed files with 79 additions and 4 deletions

View file

@ -2,7 +2,7 @@ import uuid
from datetime import date, datetime
from typing import Self
from pydantic import BaseModel, ConfigDict, field_validator, model_validator
from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator
from api.models.task import TaskPriority, TaskStatus
from api.schemas.compat import WorkplanIdCompatMixin, WorkplanIdCreateMixin
@ -46,7 +46,8 @@ class TaskCreate(TaskStatusMixin, TaskFlavorMixin, WorkplanIdCreateMixin):
needs_human: bool = False
intervention_note: str | None = None
decision_id: str | None = None
blocked_on: str | None = None
# Bounded by tasks.blocked_on String(200); longer text belongs in blocking_reason.
blocked_on: str | None = Field(default=None, max_length=200)
wait_until: date | None = None
parent_task_id: uuid.UUID | None = None
@ -69,7 +70,8 @@ class TaskUpdate(TaskStatusMixin, TaskFlavorMixin):
needs_human: bool | None = None
intervention_note: str | None = None
decision_id: str | None = None
blocked_on: str | None = None
# Bounded by tasks.blocked_on String(200); longer text belongs in blocking_reason.
blocked_on: str | None = Field(default=None, max_length=200)
wait_until: date | None = None
parent_task_id: uuid.UUID | None = None
# Token passthrough — three tiers (highest precision wins):