modelgen: recurse through nested generics in list resolvers

_get_list_inner (Pydantic) and _resolve_ts_list (TypeScript) collapsed
nested generics to "str" / "string[]" — so List[List[int]] became
List[str] and List[Dict[str,Any]] became List[str]. Fix recurses on
list-of-list and falls back to Dict[str,Any] / Record<string,unknown>
for list-of-dict.

Regenerated outputs:
- core/gpu/models/models.py: SegmentFieldResponse.boundary now
  List[List[int]], unblocking /segment_field which was 500ing on every
  request with pydantic ValidationError
- core/db/models.py + ui/common/types/generated.ts: Brand.airings now
  matches its source schema (List[Dict[str,Any]] / Record<string,unknown>[])
This commit is contained in:
2026-04-29 08:48:21 -03:00
parent f66d3a273f
commit ddb4f17faa
4 changed files with 18 additions and 6 deletions

View File

@@ -115,13 +115,13 @@ class SegmentFieldRequest(BaseModel):
class SegmentFieldResponse(BaseModel):
"""Response from field segmentation."""
boundary: List[str] = Field(default_factory=list)
boundary: List[List[int]] = Field(default_factory=list)
coverage: float = 0.0
mask_b64: str = ""
class SegmentFieldDebugResponse(BaseModel):
"""Response from field segmentation with debug overlay."""
boundary: List[str] = Field(default_factory=list)
boundary: List[List[int]] = Field(default_factory=list)
coverage: float = 0.0
mask_overlay_b64: str = ""