fix: add production support for cluster-specific AI Gateway URLs#2190
Merged
Conversation
738e9af to
944a42d
Compare
In production embedded mode, the frontend now uses config.aiGatewayUrl
(set by cloud-ui from REACT_APP_AI_GATEWAY_URL_TEMPLATE env var) to
construct AI Gateway transport URLs.
Changes:
- Add aiGatewayUrl?: string to SetConfigArguments and Config types in config.ts
- Update useAIGatewayTransport to use config.aiGatewayUrl when isEmbedded()
- In production embedded: use config.aiGatewayUrl + /.redpanda/api
- In development: use relative /.redpanda/api with dev server proxy
- Fallback to relative path for standalone mode
Cloud-ui passes aiGatewayUrl by:
aiGatewayUrl: process.env.REACT_APP_AI_GATEWAY_URL_TEMPLATE?.replace('{clusterId}', clusterId)
This enables environment-specific AI Gateway domains:
- Integration: https://ai-gateway.{clusterId}.clusters.ign.rdpa.co
- Staging: https://ai-gateway.{clusterId}.clusters.staging.rdpa.co
- Production: https://ai-gateway.{clusterId}.clusters.prod.rdpa.co
Fixes issue where production requests went to:
https://main--redpanda-cloud.netlify.app/.redpanda/api/...
Instead of:
https://ai-gateway.{clusterId}.clusters.ign.rdpa.co/.redpanda/api/...
Related: cloudv2 PR #24457 (adds REACT_APP_AI_GATEWAY_URL_TEMPLATE env var)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
944a42d to
f1d6f4b
Compare
malinskibeniamin
approved these changes
Jan 28, 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.
Summary
Fixes AI Gateway API requests in production to use cluster-specific URLs instead of Netlify domain.
Problem
In production (Netlify), AI Gateway requests were going to:
Instead of the cluster-specific AI Gateway:
Solution
Updated
useAIGatewayTransporthook to:/.redpanda/apiwith dev server proxyChanges
src/hooks/use-ai-gateway-transport.ts/clusters/{clusterId}/...)Testing
/clusters/{clusterId}/console/agents/...pathsRelated
🤖 Generated with Claude Code