Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ss bootstrap - Wrap each kernel.use() with 10s per-plugin timeout - Wrap kernel.bootstrap() with 30s timeout - Wrap overall bootstrap() with 50s budget (10s margin for Vercel 60s limit) - Return 503 Service Unavailable on bootstrap failure instead of hanging - Add timestamped [HotCRM] diagnostic logs at every bootstrap step - Update CHANGELOG.md and DEPLOYMENT.md Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
…from business plugin loop Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [ISSUE-123] Fix Vercel login timeout after 60 seconds
fix: add timeout protection to Vercel serverless bootstrap to prevent 60s hangs
Mar 19, 2026
Contributor
|
@copilot 评估是否已经完成了任务中要求的所有开发 |
There was a problem hiding this comment.
Pull request overview
Adds fail-fast timeout protection and diagnostic logging around the Vercel serverless kernel bootstrap so permanently-pending plugin initialization doesn’t consume the full 60s function limit, and documents the new behavior.
Changes:
- Added
withTimeout()plus 10s per-plugin, 30skernel.bootstrap(), and 50s overall bootstrap budgets with timestamped logs in the Vercel handler. - Updated handler behavior to return
503 Service Unavailablewith JSON when bootstrap fails. - Documented the timeout architecture in
docs/DEPLOYMENT.mdand recorded the fix inCHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
api/[[...route]].ts |
Wraps bootstrap phases in layered timeouts and adds step-by-step elapsed-time logs; returns 503 on bootstrap failure. |
docs/DEPLOYMENT.md |
Documents the timeout protection and diagnostics for Vercel deployments. |
CHANGELOG.md |
Adds an Unreleased “Fixed” entry describing the Vercel bootstrap hang mitigation. |
Comment on lines
309
to
316
| @@ -243,10 +315,12 @@ async function bootstrap(): Promise<Hono> { | |||
| ...(process.env.VERCEL_PROJECT_PRODUCTION_URL ? [`https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`] : []), | |||
| ...(process.env.AUTH_TRUSTED_ORIGINS ? process.env.AUTH_TRUSTED_ORIGINS.split(',').map(s => s.trim()) : []), | |||
… missing On Vercel (VERCEL env var set), AUTH_SECRET is now required. Without it, the handler throws with an actionable error pointing to Vercel Dashboard settings, instead of silently falling back to an insecure dev placeholder. Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Contributor
Author
已完成 issue 中所有可通过代码修改实现的任务,具体对照如下: Issue 推荐策略 → 完成情况:
额外完成:
|
Copilot
AI
changed the title
fix: add timeout protection to Vercel serverless bootstrap to prevent 60s hangs
fix: add timeout protection and AUTH_SECRET fail-fast to Vercel serverless bootstrap to prevent 60s hangs
Mar 19, 2026
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
The Vercel serverless handler hangs for the full 60s function limit when any plugin's
init/startreturns a never-resolving promise. This adds 3-layer timeout protection, diagnostic logging, and environment variable fail-fast checks so hangs fail fast with an actionable error instead of silently timing out.Type of Change
Related Issues
Related to #62
Changes Made
api/[[...route]].tswithTimeout<T>(promise, ms, label)utility that races a promise against a deadlinekernel.use()with 10s per-plugin timeoutkernel.bootstrap()with 30s timeoutbootstrap()with 50s budget (10s margin for Vercel's 60s limit)[HotCRM] [<elapsed>ms]diagnostic logs at each step — identifies the blocking plugin from Vercel Function LogsAUTH_SECRETfail-fast check on Vercel — when theVERCELenv var is set, missingAUTH_SECRETnow throws immediately with an actionable error pointing to Vercel Dashboard settings, instead of silently falling back to an insecure dev placeholderCHANGELOG.md/docs/DEPLOYMENT.md— document timeout architecture and AUTH_SECRET fail-fast behaviorTesting
npm test)npm run lint)npm run build)All 196 test files / 4036 tests pass unchanged.
Screenshots
N/A
Checklist
Additional Notes
No tests added for the handler itself — the
api/directory is outside the vitest test root (packages/**) and the handler requires the full@objectstack/runtimekernel to bootstrap. The timeout utility is straightforward enough to verify by inspection.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.