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

Closed
opened 2026-04-13 09:26:47 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/better-auth/better-auth/pull/5641

State: closed
Merged: Yes


  • 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.
**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5641 **State:** closed **Merged:** Yes --- - 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. -->
GiteaMirror added the pull-request label 2026-04-13 09:26:47 -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#14379