- HandoffContextScreen: 3-option layout (Continue/AI analysis/Own thing)
with hasTaskLane, activeOptionKey, spinner/disabled states
- AssistantChatPage: wire up handleContinue, handleAIAnalysis, handleOwnThing
handlers; chip detail expansion inline with copy-button fix; post-escalation
redirect to dashboard on ConcludeSessionModal close
- TaskLane: fix async copy button (await + execCommand fallback + copiedKey
visual feedback); whitespace-pre-wrap on command blocks
- Fix 500 on claim: Pydantic v2 model_validate() + model_copy(update={})
(was passing update= kwarg directly which v2 rejects)
- HandoffResponse schema: handed_off_by_name field
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
64 lines
1.8 KiB
Python
64 lines
1.8 KiB
Python
"""Pydantic schemas for session handoffs."""
|
|
from __future__ import annotations
|
|
from typing import Any
|
|
from uuid import UUID
|
|
from datetime import datetime
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class HandoffCreateRequest(BaseModel):
|
|
intent: str = Field(..., pattern="^(park|escalate)$")
|
|
engineer_notes: str | None = None
|
|
priority: str = Field("normal", pattern="^(normal|elevated)$")
|
|
# Optional escalation target — if set, only this user is the named
|
|
# recipient. Notification dispatch fans out to all engineer/admin/owner
|
|
# users in the account either way; this just records the original
|
|
# engineer's preferred recipient on the session for audit/UX.
|
|
target_user_id: UUID | None = None
|
|
|
|
|
|
class HandoffResponse(BaseModel):
|
|
id: UUID
|
|
session_id: UUID
|
|
handed_off_by: UUID
|
|
handed_off_by_name: str | None = None
|
|
intent: str
|
|
source_branch_id: UUID | None
|
|
snapshot: dict[str, Any]
|
|
ai_assessment: str | None
|
|
ai_assessment_data: dict[str, Any] | None
|
|
artifacts: list[dict[str, Any]] | None
|
|
engineer_notes: str | None
|
|
priority: str
|
|
claimed_by: UUID | None
|
|
claimed_at: datetime | None
|
|
psa_note_pushed: bool
|
|
notification_sent: bool
|
|
created_at: datetime
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class HandoffClaimRequest(BaseModel):
|
|
pass
|
|
|
|
|
|
class HandoffBriefingResponse(BaseModel):
|
|
briefing: str
|
|
handoff: HandoffResponse
|
|
|
|
|
|
class QueueItemResponse(BaseModel):
|
|
handoff_id: UUID
|
|
session_id: UUID
|
|
intent: str
|
|
problem_summary: str | None
|
|
problem_domain: str | None
|
|
priority: str
|
|
handed_off_by_name: str | None
|
|
engineer_notes: str | None
|
|
branch_count: int = 0
|
|
created_at: datetime
|
|
claimed_by: UUID | None
|
|
claimed_at: datetime | None
|
|
model_config = {"from_attributes": True}
|