Observed behavior
POST /v1/dev/user/conversations/from-segments returns HTTP 500 with a generic error message. Recurring in production.
Call path
routers/developer.py:1009 → creates CreateConversation(source=external_integration)
└─ utils/conversations/process_conversation.py:643 → process_conversation()
└─ process_conversation.py:103-140 → _get_structured()
└─ accesses conversation.text_source ← AttributeError
How it happens
- The endpoint creates a
CreateConversation object (models/conversation.py:449) with source defaulting to ConversationSource.external_integration
- This is passed to
process_conversation() → _get_structured()
_get_structured() at line 103-140 checks:
if conversation.source == ConversationSource.external_integration:
if conversation.text_source == ExternalIntegrationConversationSource.audio:
CreateConversation does not have a text_source attribute — only ExternalIntegrationCreateConversation (models/conversation.py:481) has it
- The
AttributeError is caught by a blanket exception handler at line 199 and returned as a generic HTTP 500
Key facts
CreateConversation (line 449) has: transcript_segments, source, language — no text_source
ExternalIntegrationCreateConversation (line 481) has: text, text_source, text_source_spec — no transcript_segments
- These are two different Pydantic models for different conversation creation flows, but
_get_structured() doesn't distinguish between them
- The generic exception handler masks the real error — logs show "Error processing conversation" with no indication it's a type mismatch
Observed behavior
POST /v1/dev/user/conversations/from-segmentsreturns HTTP 500 with a generic error message. Recurring in production.Call path
How it happens
CreateConversationobject (models/conversation.py:449) withsourcedefaulting toConversationSource.external_integrationprocess_conversation()→_get_structured()_get_structured()at line 103-140 checks:CreateConversationdoes not have atext_sourceattribute — onlyExternalIntegrationCreateConversation(models/conversation.py:481) has itAttributeErroris caught by a blanket exception handler at line 199 and returned as a generic HTTP 500Key facts
CreateConversation(line 449) has:transcript_segments,source,language— notext_sourceExternalIntegrationCreateConversation(line 481) has:text,text_source,text_source_spec— notranscript_segments_get_structured()doesn't distinguish between them