Skip to content

Improve context length chat errors#258

Open
Chel-Tbl wants to merge 1 commit into
jasonhedman:mainfrom
Chel-Tbl:bounty/context-length-error
Open

Improve context length chat errors#258
Chel-Tbl wants to merge 1 commit into
jasonhedman:mainfrom
Chel-Tbl:bounty/context-length-error

Conversation

@Chel-Tbl
Copy link
Copy Markdown

Closes #94.

Summary

  • Detect context-window / token-limit provider errors in the chat stream error path.
  • Show a user-facing recovery message for long chats instead of the generic processing error.
  • Keep the existing OpenRouter 402 logging behavior while avoiding unsafe unknown error stringification.

Verification

  • node .\node_modules\prettier\bin\prettier.cjs --check 'src/app/api/chat/route.ts'
  • .\node_modules\.bin\tsc.cmd --noEmit --pretty false
  • SKIP_ENV_VALIDATION=1 node .\node_modules\next\dist\bin\next build

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.

Better error messages for context length exceeded

1 participant