Repository navigation
Friendly error messages, clean research text, and remove eval of model output - #2
Merged
Merged
Conversation
No API credit, a bad key or a retired model now shows 'The assistant is temporarily unavailable'; rate limits and outages ask the user to retry. Chat replies carry is_error, research status carries error, and error notices are not sent back to the model as history. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XtW6Y5JF5GNt1txL7PriFg
The search tool rendered highlights as a Python list, and the parser split that text at every quote mark, so reports showed escaped newlines and sentences cut off at apostrophes. Sources are now plain text with their URLs, and when the model cannot write the report the result lists the sources with short excerpts. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XtW6Y5JF5GNt1txL7PriFg
Search query lists returned by the model were run through eval(). The model reads text from web pages, so a page could inject code that would run on the server. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XtW6Y5JF5GNt1txL7PriFg
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XtW6Y5JF5GNt1txL7PriFg
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XtW6Y5JF5GNt1txL7PriFg
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Visitors see short, friendly notices instead of raw provider errors, and deep research no longer shows broken text. This also fixes an
eval()of model output.Changes
app/services/errors.py):is_error, and/api/research/status/{id}gainserror. Error notices are no longer replayed to the model as conversation history.retrieve_web_contentused to render Exa highlights as a Python list, and the research parser cut that text at every quote mark. That produced the escaped\nand the sentences cut off at apostrophes. The tool now returns plain-text sources with URLs.eval(). The model reads web content, so a malicious page could inject code. Nowast.literal_eval.Verification
ruff check app tests: passespytest -qon Python 3.11: 31 passed (19 new), including an end-to-end research run with a failing model and a fake search toolFrontend
The matching frontend PR reads
is_errorand the researcherror, and renders Markdown. Merge this one first. The frontend still works with the old API, but this one changes the text it will show.Generated by Claude Code