fix: AI chat killed after 60 seconds on Vercel - #477
Merged
Conversation
Vercel resolves vercel.json function patterns first-match-wins in
definition order, so the 60s catch-all listed above the chat route
entry swallowed it — Vercel hard-killed every agent run at 60s and
turns ended silently truncated ("Thought for 1m" with no result).
List the specific route first so its 300s budget actually applies.
Co-authored-by: Cursor <cursoragent@cursor.com>
ysamcode
requested review from
liamwalder,
lunenas and
tristan-mouchet
as code owners
July 28, 2026 07:49
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
The 1.28.9 fix that moved the AI chat route's
maxDurationintovercel.jsondoesn't take effect: Vercel resolvesfunctionspatterns first-match-wins in definition order, and the 60s catch-allapp/(builder)/ycode/api/**/*.tsis listed above the chat route entry. Every agent run gets hard-killed at 60 seconds, so turns end silently truncated ("Thought for 1m" with no result).Refs: Vercel duration docs (ordering note), vercel/vercel#15315 (
getLambdaOptionsFromFunctionis first-match-wins).Changes
app/(builder)/ycode/api/ai/chat/route.tsentry above the builder API catch-all invercel.jsonso its 300s budget actually appliesTest plan
Made with Cursor