Conversation
The chat route exported maxDuration = 800, which fails Vercel build validation on free plans (max 300). A route-level export also always overrides vercel.json, so paid deployments couldn't raise it either. Move the duration to vercel.json (300 default) and derive the agent loop's run budget from AI_CHAT_MAX_DURATION so paid deployments can keep longer runs.
ysamcode
requested review from
liamwalder,
lunenas and
tristan-mouchet
as code owners
July 28, 2026 07:08
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
Deploying YCode on a Vercel hobby (free) plan failed because the AI chat route exported
maxDuration = 800, which exceeds the hobby-plan limit of 300 seconds and fails build validation. The route-level export also always overrodevercel.json, so paid deployments couldn't configure their own limit either.Changes
maxDuration = 800export from the AI chat route and set it invercel.jsoninstead (300s — the hobby-plan maximum), so deployments can override it in their ownvercel.jsonMAX_RUN_MS) from a new optionalAI_CHAT_MAX_DURATIONenv var (defaults to 300s, minus a 60s buffer), so the agent still stops gracefully before Vercel hard-kills the functionAI_CHAT_MAX_DURATIONin.env.example, including the requirement to keep it in sync withvercel.jsonon paid plansTest plan
maxDurationinvercel.jsonand setAI_CHAT_MAX_DURATIONto match — confirm longer runs are allowedMade with Cursor