[PR #5013] [MERGED] docs: fix optimize ai streaming query #31320

Closed
opened 2026-04-17 22:12:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5013
Author: @Kinfe123
Created: 10/1/2025
Status: Merged
Merged: 10/2/2025
Merged by: @himself65

Base: canaryHead: fix/optimized-streaming-for-ai


📝 Commits (3)

📊 Changes

2 files changed (+168 additions, -79 deletions)

View changed files

📝 docs/components/floating-ai-search.tsx (+168 -68)
📝 docs/components/search-dialog.tsx (+0 -11)

📄 Description

Summary by cubic

Optimized the floating AI search flow: the first answer now streams live, and follow-up questions reuse cached responses to cut latency and API calls. Also cleaned up UI and improved error handling and reference attachment.

  • Refactors

    • Stream the first question with chunked updates; fetch and attach references after streaming.
    • Use fetch_existing for follow-ups; set session_id on the second question to establish the session.
    • Added questionCount state; filtered out GitHub links from references.
    • UI cleanup: removed role label, adjusted spacing, and removed the Ask AI button from the search dialog.
  • Bug Fixes

    • Reduced flicker and avoided duplicate assistant messages during streaming.
    • Ensured references reliably attach to the correct message after responses.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/5013 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 10/1/2025 **Status:** ✅ Merged **Merged:** 10/2/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/optimized-streaming-for-ai` --- ### 📝 Commits (3) - [`17e9233`](https://github.com/better-auth/better-auth/commit/17e92338da4da4108e672265fad8bc94caa2feaf) fix: optimize the streaming - [`082a307`](https://github.com/better-auth/better-auth/commit/082a307121c0a024cdfcd0acfe1162166fe08c69) clean up - [`713ebe3`](https://github.com/better-auth/better-auth/commit/713ebe3e764d37d0e17fc3d5067721c8a47b8cb0) lint ### 📊 Changes **2 files changed** (+168 additions, -79 deletions) <details> <summary>View changed files</summary> 📝 `docs/components/floating-ai-search.tsx` (+168 -68) 📝 `docs/components/search-dialog.tsx` (+0 -11) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Optimized the floating AI search flow: the first answer now streams live, and follow-up questions reuse cached responses to cut latency and API calls. Also cleaned up UI and improved error handling and reference attachment. - **Refactors** - Stream the first question with chunked updates; fetch and attach references after streaming. - Use fetch_existing for follow-ups; set session_id on the second question to establish the session. - Added questionCount state; filtered out GitHub links from references. - UI cleanup: removed role label, adjusted spacing, and removed the Ask AI button from the search dialog. - **Bug Fixes** - Reduced flicker and avoided duplicate assistant messages during streaming. - Ensured references reliably attach to the correct message after responses. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 22:12:09 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#31320