Repository navigation
fix(mcp): Accept open-ended time ranges in search_issue_events - #2261
Merged
Merged
Conversation
"Since X" and timestamp:>=X requests have a start but no end. The search_issue_events agent schema required both start and end, and required timeRange even though its prompt said to omit it for the default window. Model outputs in either shape failed schema validation and surfaced as "The AI was unable to process your query". Make end optional (the handler runs the search until now) and default timeRange to null. Update the prompt so "since" examples set only start.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
joshuarli
approved these changes
Nov 14, 2026
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.
search_issue_eventsfails on open-ended "since X" windows such astimestamp:>=2026-11-12T06:39:00Zor "since November 12 2026 at 06:39 UTC". It returns "The AI was unable to process your query";search_errorshandles the same window fine.Why it fails
The embedded agent's output schema (
tools/support/search-issue-events/agent.ts) is stricter than its prompt:timeRangerequires bothstartandend. A "since X" request has no natural end, and the agent doesn't know the current time.timeRangeis required, but the prompt says to omit it for the default window.If the model returns
{start}only, or omitstimeRange, the AI SDK raisesNoObjectGeneratedError("response did not match schema").rescueFromTextcan't repair that, so the tool returns the "unable to process" error (internal/agents/callEmbeddedAgent.ts:226). Production logs show this exact error withfinishReason: stopfor these queries. Which of the two shapes the model produced is inferred, since the traces weren't sampled.Change
timeRange,endis optional. When it's missing, the handler runs the search until now.timeRangedefaults tonull, meaning the default 14d window.Existing outputs, whether full
{start, end}or{statsPeriod}, behave as before.Related but separate: #1215 / #1228 (caller-supplied
start/endforsearch_eventsandsearch_issues) and #2139 / #2146 (dropped absolute bounds inrunSearchEvents). Longer term, #1896 removes the embedded search agents.via @joshuarli.
--
View Session [Sentry]