feat: mid-session status updates — ticket notes, client updates, email drafts
Engineers can now generate AI-powered status updates during active FlowPilot
sessions and after resolve/escalate. Three audiences (Ticket Notes, Client
Update, Email Draft) with Quick/Detailed length options. Copy to clipboard
with one click. Client names auto-inserted from intake/PSA context.
Backend: new endpoint POST /ai-sessions/{id}/status-update with audience-aware
system prompts. Frontend: StatusUpdateModal with 2-step selection flow,
Share Update button in action bar, Share Resolution/Escalation on completed
sessions. Also updates Solutions Library spec with Community tier design.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,8 @@ from app.schemas.ai_session import (
|
||||
SessionCloseResponse,
|
||||
SessionDocumentation,
|
||||
RateSessionRequest,
|
||||
StatusUpdateRequest,
|
||||
StatusUpdateResponse,
|
||||
PickupSessionRequest,
|
||||
LinkTicketRequest,
|
||||
AISessionSummary,
|
||||
@@ -733,6 +735,31 @@ async def get_documentation(
|
||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=str(e))
|
||||
|
||||
|
||||
# ── Status Update ──
|
||||
|
||||
@router.post("/{session_id}/status-update", response_model=StatusUpdateResponse)
|
||||
@limiter.limit("20/minute")
|
||||
async def create_status_update(
|
||||
request: Request,
|
||||
session_id: UUID,
|
||||
data: StatusUpdateRequest,
|
||||
current_user: Annotated[User, Depends(get_current_active_user)],
|
||||
db: Annotated[AsyncSession, Depends(get_db)],
|
||||
):
|
||||
"""Generate a status update for ticket notes, client, or email."""
|
||||
try:
|
||||
return await flowpilot_engine.generate_status_update(
|
||||
session_id=session_id,
|
||||
request=data,
|
||||
user_id=current_user.id,
|
||||
db=db,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=str(e))
|
||||
except PermissionError as e:
|
||||
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN, detail=str(e))
|
||||
|
||||
|
||||
# ── Rate ──
|
||||
|
||||
@router.post("/{session_id}/rate", status_code=204)
|
||||
|
||||
Reference in New Issue
Block a user