fix: wire image uploads into correct chat endpoint (unified_chat_service)

The frontend calls /ai-sessions/{id}/chat (unified_chat_service), not
/assistant/chats/{id}/messages (assistant_chat_service). The previous
commit wired images into the wrong backend. This fixes it:

- ai_session.py schema: add upload_ids to ChatMessageRequest
- ai_sessions.py endpoint: fetch images via _fetch_upload_images
- unified_chat_service: accept and forward images to _call_ai

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-24 05:02:34 +00:00
parent 1c0f912cf6
commit 36ca830481
3 changed files with 14 additions and 0 deletions

View File

@@ -245,6 +245,7 @@ class ChatSessionCreateResponse(BaseModel):
class ChatMessageRequest(BaseModel):
"""Send a message in a chat session."""
message: str = Field(..., min_length=1, max_length=8000)
upload_ids: list[UUID] = Field(default_factory=list, max_length=10)
class ChatMessageResponse(BaseModel):