Repository navigation
fix(auth): skip mcp plugin db seed during next build - #1606
Merged
Merged
Conversation
The mcp/oauth-provider plugin seeds its OAuthResource row from init, which queries the DB whenever createAuth runs. During next build this fired in every page-data worker for nothing. Skip the plugin in the production build phase and fall back to a loopback MCP URL when SKIP_ENV_CHECK leaves the builder URL unset. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
The mcp/oauth-provider plugin seeds its OAuthResource row from init, which queries the DB whenever createAuth runs. During next build this fired in every page-data worker for nothing. Skip the plugin in the production build phase and fall back to a loopback MCP URL when SKIP_ENV_CHECK leaves the builder URL unset.
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
mcp(oauth-provider) plugin whenNEXT_PHASE === "phase-production-build". Itsinitseeds theOAuthResourcerow with a DB query whenevercreateAuthruns, which fired in everynext buildpage-data worker for nothing (and fails with no DB). The runtime server re-evaluatescreateAuthand seeds normally.getMcpResourceUrlreturns a loopback placeholder whenSKIP_ENV_CHECK=trueand no builder/MCP URL is set, socreateAuthdoesn't throw at build time. It never applies at runtime.Test plan
pnpm --filter builder buildwithSKIP_ENV_CHECK=trueno longer logs theOAuthResourceselect/insert queriesOAuthResourcepnpm lintandpnpm --filter @chatbotx.io/auth check-types🤖 Generated with Claude Code