mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-05 04:15:08 -05:00
fix(backend): use correct lookup method for path-based workspace refs
When adding MIME type to workspace refs without fragments, use get_file_info_by_path() for path-based refs instead of get_file_info() which expects an ID. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -368,7 +368,12 @@ async def store_media_file(
|
||||
if not ws.mime_type:
|
||||
# Add MIME type fragment if missing (older refs without it)
|
||||
try:
|
||||
info = await workspace_manager.get_file_info(ws.file_ref)
|
||||
if ws.is_path:
|
||||
info = await workspace_manager.get_file_info_by_path(
|
||||
ws.file_ref
|
||||
)
|
||||
else:
|
||||
info = await workspace_manager.get_file_info(ws.file_ref)
|
||||
if info:
|
||||
return MediaFileType(f"{file}#{info.mimeType}")
|
||||
except Exception:
|
||||
|
||||
Reference in New Issue
Block a user