feat: support uploaded images in debug voice preview

Allow paste/drag temporary image assets so vision turns work without a live camera frame.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Xin Wang
2026-08-05 19:52:37 +08:00
co-authored by Cursor
parent 555c8f5fa6
commit e36ca308b8
16 changed files with 686 additions and 94 deletions
+9 -3
View File
@@ -176,6 +176,8 @@ class ConversationRecorder:
*,
input_id: str,
timestamp: object,
content: str = "",
source: str = "camera_capture",
mime_type: str = "image/jpeg",
) -> None:
"""Persist a captured frame without delaying the realtime model turn."""
@@ -185,6 +187,8 @@ class ConversationRecorder:
data,
input_id=input_id,
timestamp=timestamp,
content=content,
source=source,
mime_type=mime_type,
),
name=f"conversation-image:{self.session_id}:{input_id}",
@@ -198,6 +202,8 @@ class ConversationRecorder:
*,
input_id: str,
timestamp: object,
content: str,
source: str,
mime_type: str,
) -> None:
message_id = f"msg_{uuid4().hex[:20]}"
@@ -221,11 +227,11 @@ class ConversationRecorder:
sequence=next_sequence,
role="user",
content_type="image",
content="",
content=content.strip(),
occurred_at=_parse_timestamp(timestamp),
extra={
"input_id": input_id,
"source": "camera_capture",
"source": source,
},
)
)
@@ -238,7 +244,7 @@ class ConversationRecorder:
storage_uri=storage_uri(key),
mime_type=mime_type,
size_bytes=len(data),
extra={"input_id": input_id},
extra={"input_id": input_id, "source": source},
)
)
conversation = await db.get(ConversationSession, self.session_id)