fix(chat): use workspace:// reference for large file downloads

Return workspace:// format instead of calling get_download_url so
the frontend urlTransform can properly add the proxy prefix.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-01-28 02:57:36 -06:00
parent ef3dfb8af4
commit d81e97b881

View File

@@ -326,9 +326,10 @@ class ReadWorkspaceFileTool(BaseTool):
session_id=session_id,
)
# Return metadata + URL for large or binary files
# Return metadata + workspace:// reference for large or binary files
# This prevents context bloat (100KB file = ~133KB as base64)
download_url = await manager.get_download_url(target_file_id)
# Use workspace:// format so frontend urlTransform can add proxy prefix
download_url = f"workspace://{target_file_id}"
# Generate preview for text files
preview: str | None = None