Skip to content

fix(auth): skip mcp plugin db seed during next build - #1606

Merged
realcodesiman merged 1 commit into
mainfrom
fix/auth-skip-mcp-seed-at-build
Oct 31, 2026
Merged

realcodesiman merged 1 commit into
mainfrom
fix/auth-skip-mcp-seed-at-build

Conversation

@realcodesiman

Copy link
Copy Markdown
Contributor

Summary

  • Skip the mcp (oauth-provider) plugin when NEXT_PHASE === "phase-production-build". Its init seeds the OAuthResource row with a DB query whenever createAuth runs, which fired in every next build page-data worker for nothing (and fails with no DB). The runtime server re-evaluates createAuth and seeds normally.
  • getMcpResourceUrl returns a loopback placeholder when SKIP_ENV_CHECK=true and no builder/MCP URL is set, so createAuth doesn't throw at build time. It never applies at runtime.

Test plan

  • pnpm --filter builder build with SKIP_ENV_CHECK=true no longer logs the OAuthResource select/insert queries
  • Runtime server still registers the MCP plugin and seeds OAuthResource
  • pnpm lint and pnpm --filter @chatbotx.io/auth check-types

🤖 Generated with Claude Code

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]>
@github-actions github-actions Bot added the bug Something isn't working as expected label Oct 31, 2026
@realcodesiman
realcodesiman merged commit 5b96881 into main Oct 31, 2026
15 checks passed
@realcodesiman
realcodesiman deleted the fix/auth-skip-mcp-seed-at-build branch October 31, 2026 09:43
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant