[PR #4997] [MERGED] docs: replace with better-fetch and maxDuration for the vercel runtime #22605

Closed
opened 2026-04-15 21:10:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4997
Author: @Kinfe123
Created: 9/30/2025
Status: Merged
Merged: 9/30/2025
Merged by: @himself65

Base: canaryHead: fix/use-better-auth-for-fetching-ai-response


📝 Commits (3)

  • 576b674 fix: use better-fetch and api route 404
  • b73c7ba max duration
  • 1e00a30 Merge branch 'canary' into fix/use-better-auth-for-fetching-ai-response

📊 Changes

2 files changed (+18 additions, -12 deletions)

View changed files

📝 docs/app/api/ai-chat/route.ts (+3 -3)
📝 docs/components/floating-ai-search.tsx (+15 -9)

📄 Description

Summary by cubic

Switched AI chat requests to better-fetch with typed responses and clearer errors. Set maxDuration=300 and corrected the route Request type to prevent 404s and allow longer-running responses.

  • Bug Fixes

    • Fixed /api/ai-chat 404 by using the standard Request and exporting maxDuration=300.
    • Disabled the input using isLoading to block interaction during request processing.
  • Refactors

    • Replaced fetch with better-fetch; surfaced HTTP status/messages and added typing.
    • Normalized handling for content, answer, and response; persisted session_id when present.

🔄 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/4997 **Author:** [@Kinfe123](https://github.com/Kinfe123) **Created:** 9/30/2025 **Status:** ✅ Merged **Merged:** 9/30/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `fix/use-better-auth-for-fetching-ai-response` --- ### 📝 Commits (3) - [`576b674`](https://github.com/better-auth/better-auth/commit/576b674e55d270ed7b4fac9a15b8e60098b53b3e) fix: use better-fetch and api route 404 - [`b73c7ba`](https://github.com/better-auth/better-auth/commit/b73c7badc2aea8db4bd90b25b804e1b93c8e1d4b) max duration - [`1e00a30`](https://github.com/better-auth/better-auth/commit/1e00a308e38f426cddf6d845f2eb6d74b8b056a1) Merge branch 'canary' into fix/use-better-auth-for-fetching-ai-response ### 📊 Changes **2 files changed** (+18 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `docs/app/api/ai-chat/route.ts` (+3 -3) 📝 `docs/components/floating-ai-search.tsx` (+15 -9) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Switched AI chat requests to better-fetch with typed responses and clearer errors. Set maxDuration=300 and corrected the route Request type to prevent 404s and allow longer-running responses. - **Bug Fixes** - Fixed /api/ai-chat 404 by using the standard Request and exporting maxDuration=300. - Disabled the input using isLoading to block interaction during request processing. - **Refactors** - Replaced fetch with better-fetch; surfaced HTTP status/messages and added typing. - Normalized handling for content, answer, and response; persisted session_id when present. <!-- 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-15 21:10:00 -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#22605