Skip to content

Conversation

@zach-2pir
Copy link

This PR addresses two things.

  1. The create_assistant_result internally spins off an asyncio task, but it does not await on it. Since it's called from an async context it can't switch to actually sending the results for a bit. This means the final chunk is sometimes not sent.
  2. The ranking routine takes in query parameters to control score thresholds and max_results, but the whoRanking does not. This PR adds that.

Copilot AI review requested due to automatic review settings September 30, 2025 16:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses two technical issues: fixing async message delivery in assistant results and ensuring WHO ranking respects debug parameters from URL query strings.

  • Fixed async task execution by properly awaiting the create_assistant_result function instead of creating fire-and-forget tasks
  • Modified WHO ranking to respect debug parameters like score thresholds and max results from query parameters
  • Updated frontend to preserve URL debug parameters when making ranking requests

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
static/who.html Extracts URL parameters and passes them to ranking requests to preserve debug settings
code/python/core/whoRanking.py Updates ranking logic to use handler's max_results and min_score parameters instead of hardcoded values
code/python/core/schemas.py Converts create_assistant_result to async function and properly awaits message sending
code/python/core/ranking.py Updates call to create_assistant_result to use await instead of fire-and-forget task

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants