cleanup: remove dead _entity_discriminator and CheckpointPayload

This commit is contained in:
Greyson LaLonde
2026-04-06 20:47:41 +08:00
parent 4e15d49176
commit 408cd045e4

View File

@@ -9,7 +9,7 @@ via ``RuntimeState.model_rebuild()``.
from __future__ import annotations
from typing import TYPE_CHECKING, Any, TypedDict
from typing import TYPE_CHECKING, Any
from pydantic import (
ModelWrapValidatorHandler,
@@ -29,19 +29,6 @@ if TYPE_CHECKING:
from crewai import Entity
class CheckpointPayload(TypedDict):
entities: list[Entity]
event_record: dict[str, Any]
def _entity_discriminator(v: dict[str, Any] | object) -> str:
if isinstance(v, dict):
raw = v.get("entity_type", "agent")
else:
raw = getattr(v, "entity_type", "agent")
return str(raw)
def _sync_checkpoint_fields(entity: object) -> None:
"""Copy private runtime attrs into checkpoint fields before serializing.