fix: report a web search where no page loaded instead of blaming the embedding settings (#31859)

This commit is contained in:
G30 2026-10-04 22:42:48 -04:00 • committed by GitHub
parent 8e03389de1
commit 2e43d66985
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3039,6 +3039,12 @@ async def process_web_search(request: Request, form_data: SearchForm, user=Depen
'loaded_count': len(docs),
}
else:
if not any(doc.page_content.strip() for doc in docs):
raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND,
detail=ERROR_MESSAGES.DEFAULT('None of the web search results could be loaded'),
)
# Create a single collection for all documents
# Bind the ephemeral collection to its owner so filter_accessible_collections can scope it per-user.
collection_name = f'web-search-{user.id}-{calculate_sha256_string("-".join(form_data.queries))}'[:63]