Skip to content

Conversation

@kathmbeck
Copy link
Contributor

@kathmbeck kathmbeck commented Jan 28, 2026

🎉 Thanks for submitting a pull request! 🎉

Summary

All of the following commands properly check the ai gateway disabled flag as part of the site capabilities. Support for injecting aig env vars is also newly added for the latter two:

  • netlify dev
  • netlify functions:serve
  • netlify serve
  • netlify dev:exec

For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@github-actions
Copy link

github-actions bot commented Jan 28, 2026

📊 Benchmark results

Comparing with 8c9178d

  • Dependency count: 1,055 (no change)
  • Package size: 317 MB ⬇️ 0.00% decrease vs. 8c9178d
  • Number of ts-expect-error directives: 365 ⬇️ 0.27% decrease vs. 8c9178d

@kathmbeck kathmbeck force-pushed the kb/ai-gateway-use-site-cap branch from e44f9f5 to 71dd033 Compare January 28, 2026 17:28
@kathmbeck kathmbeck marked this pull request as ready for review January 28, 2026 22:14
@kathmbeck kathmbeck requested a review from a team as a code owner January 28, 2026 22:14
@kathmbeck kathmbeck requested a review from serhalp January 28, 2026 22:14
Copy link
Contributor

@ndhoule ndhoule left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment on lines +98 to +100
capabilities?: Record<string, unknown> & {
ai_gateway_disabled?: boolean
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming the linter doesn't whine:

Suggested change
capabilities?: Record<string, unknown> & {
ai_gateway_disabled?: boolean
}
capabilities?: {
ai_gateway_disabled?: boolean
[key: string]: unknown;
}

}
}
} else if (capabilities.aiGatewayDisabled) {
log(`${NETLIFYDEVLOG} AI Gateway is disabled for this account`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we skip this log line if we're in offline mode?

await setupAIGateway({ api, env, siteID: site.id, siteURL: siteUrl })

// Parse AI Gateway context and inject provider API keys
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- AI_GATEWAY is conditionally set by setupAIGateway
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the type on env, but based on this lint error, I would think the type is incorrect? Assuming I'm right about that: Is it possible to mark env.AI_GATEWAY as optional, or is that too much work?

@ndhoule
Copy link
Contributor

ndhoule commented Jan 28, 2026

Just a few minor nits and suggestions

Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no cap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants