Symptom: long generations consistently die at the same elapsed time (e.g. ~15s, ~60s) on Vercel while working locally.

Cause: the serverless function timeout. Vercel kills the function at the plan limit regardless of stream state.

Confirmation:
1. Note the exact death time across several runs. A consistent number (not random) means a timeout, not a provider flake.
2. Check the function logs for timeout entries at that timestamp.

Fix:
1. Set export const maxDuration = 30 (App Router) or the Pages equivalent on the route. This raises the limit up to your plan's ceiling.
2. Know the ceiling: hobby and pro plans have different max durations. If generations need longer than the ceiling, the architecture must change, not the config.
3. Architectural options for long work: resumable streams (resume: true with the resumable-stream package and Redis) so a killed connection can reconnect; or move long generations to a background job and poll.
4. Reduce time-to-first-useful-byte instead of only raising timeouts: stream partial results, use smaller/faster models for drafts, split work across steps.
5. Do not set maxDuration above what your plan allows. It will not error; the platform just still kills at its own limit.

Verification: run a generation longer than the old death time and confirm it completes. Monitor p95 generation duration against the timeout in production.