Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions services/agent-orchestrator-service/dependencies/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"""
from platform_shared.rbac import ( # noqa: F401 re-exported
IdentityContext,
_decode_token,
get_current_identity,
)
14 changes: 13 additions & 1 deletion services/agent-orchestrator-service/schemas/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from typing import Any, ClassVar, Dict, FrozenSet, List, Optional
from uuid import UUID, uuid4

from pydantic import BaseModel, Field
from pydantic import BaseModel, Field, field_validator


# ─────────────────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -127,6 +127,8 @@ class SessionLifecycleEvent(BaseModel):
event_type: EventType
# session_id is a free-form string -- the chat sessions use IDs like
# "session-1778614829220" and "agent-<uuid>-runtime" which are not UUIDs.
# Pydantic v2 rejects UUID for a str field under default strict-ish mode,
# but lifecycle event emission upstream passes a UUID, so coerce here.
session_id: str
correlation_id: str = Field(..., description="Shared trace ID across all steps")
timestamp: datetime = Field(default_factory=_utcnow)
Expand All @@ -135,6 +137,11 @@ class SessionLifecycleEvent(BaseModel):
summary: str = Field(..., description="Human-readable one-liner for timeline display")
payload: Dict[str, Any] = Field(default_factory=dict, description="Full step-specific data")

@field_validator("session_id", mode="before")
@classmethod
def _coerce_session_id_to_str(cls, v: Any) -> Any:
return str(v) if isinstance(v, UUID) else v


# ─────────────────────────────────────────────────────────────────────────────
# Domain payload: prompt.received (step 1)
Expand Down Expand Up @@ -277,6 +284,11 @@ class SessionEventListResponse(BaseModel):
event_count: int
events: List[SessionLifecycleEvent]

@field_validator("session_id", mode="before")
@classmethod
def _coerce_session_id_to_str(cls, v: Any) -> Any:
return str(v) if isinstance(v, UUID) else v


class SessionTimelineEntry(BaseModel):
"""Condensed view used in GET /sessions/{id} timeline array."""
Expand Down