[PR #5641] [MERGED] docs: refactor and improve llm-text logic to fix runtime error #31733

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5641
Author: @bytaesu
Created: 10/28/2025
Status: Merged
Merged: 10/28/2025
Merged by: @Bekacru

Base: canaryHead: 2025-10-28/docs/llm-text-runtime-error


📝 Commits (2)

  • 0bce24a docs: refactor and improve llm-text logic to fix runtime error
  • f5ed592 chore: comment

📊 Changes

2 files changed (+92 additions, -36 deletions)

View changed files

📝 docs/app/llms.txt/[...slug]/route.ts (+14 -8)
📝 docs/lib/llm-text.ts (+78 -28)

📄 Description

  • Fix runtime error in /llms.txt/ routes
  • Add fallback message for LLM on error
  • Refactor related code

Closes https://github.com/better-auth/better-auth/issues/5640


Summary by cubic

Fixes runtime errors in /llms.txt by refactoring LLM text generation and adding a fallback markdown response. Improves reliability of the docs text endpoint and error handling.

  • Bug Fixes

    • Wrap route handler in try/catch and return 500 with a markdown fallback on errors.
    • Read doc content with filesystem fallbacks when source content is unavailable.
    • Ensure consistent headers and status codes for success (200) and failure (500).
  • Refactors

    • Centralized and renamed utility to lib/llm-text; updated imports.
    • Added PropertyDefinition types and tightened function signatures.
    • Improved generated comments (use “optional”), and simplified APIMethod parsing.

🔄 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/5641 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 10/28/2025 **Status:** ✅ Merged **Merged:** 10/28/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2025-10-28/docs/llm-text-runtime-error` --- ### 📝 Commits (2) - [`0bce24a`](https://github.com/better-auth/better-auth/commit/0bce24ab74eb38e6ea95b60764f7e3611549b66c) docs: refactor and improve llm-text logic to fix runtime error - [`f5ed592`](https://github.com/better-auth/better-auth/commit/f5ed5928721a2fe35f005de21f6a894a5100966d) chore: comment ### 📊 Changes **2 files changed** (+92 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `docs/app/llms.txt/[...slug]/route.ts` (+14 -8) 📝 `docs/lib/llm-text.ts` (+78 -28) </details> ### 📄 Description - Fix runtime error in `/llms.txt/` routes - Add fallback message for LLM on error - Refactor related code Closes https://github.com/better-auth/better-auth/issues/5640 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes runtime errors in /llms.txt by refactoring LLM text generation and adding a fallback markdown response. Improves reliability of the docs text endpoint and error handling. - **Bug Fixes** - Wrap route handler in try/catch and return 500 with a markdown fallback on errors. - Read doc content with filesystem fallbacks when source content is unavailable. - Ensure consistent headers and status codes for success (200) and failure (500). - **Refactors** - Centralized and renamed utility to lib/llm-text; updated imports. - Added PropertyDefinition types and tightened function signatures. - Improved generated comments (use “optional”), and simplified APIMethod parsing. <!-- 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:37:12 -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#31733