Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| thread_id, | ||
| ) | ||
|
|
||
| return search_result |
There was a problem hiding this comment.
Web search messages stored out of order
Medium Severity
perform_agent_web_search_if_requested appends the “web search results” assistant message to message_history before the original assistant web_search response (which is appended later in agent_execution_handler.py). This reverses chronology and creates consecutive assistant messages, which can confuse the next agent turn and make the conversation history inconsistent.
Additional Locations (1)
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.


Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, and the specification if there is one.
Testing
Please provide a list of the ways you can "access" or use the functionality. Please try and be exhaustive here, and make sure that you test everything you list.
Documentation
Note if any new documentation needs to addressed or reviewed.
Note
Medium Risk
Adds new agent control-flow and external network calls via OpenAI’s Responses API; failures or provider mismatches could alter agent execution behavior or chat history consistency.
Overview
Adds a new agent tool,
web_search, allowing the agent to request up-to-date information and receive results back in-band.On the backend,
AgentResponsenow supportsweb_searchwithweb_search_query/web_search_results;AgentExecutionHandlerdetects this response type, runs an OpenAI Responses API search via a newOpenAIClient.web_search, appends the results into message history, and injects them into the returned JSON payload for the frontend.On the frontend, agent execution and chat history handling are updated to recognize/display
web_searchresults and to automatically continue the agent loop after a search, plus a small bugfix ingetLastAIDisplayOptimizedChatItem’s index check.Written by Cursor Bugbot for commit a8543ee. Configure here.