Commit f1d6f4b
fix: add production support for AI Gateway via config.aiGatewayUrl
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>1 parent 47c71ad commit f1d6f4b
2 files changed
Lines changed: 40 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
| 151 | + | |
150 | 152 | | |
151 | 153 | | |
152 | 154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
20 | 24 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
24 | 51 | | |
| 52 | + | |
25 | 53 | | |
26 | | - | |
| 54 | + | |
27 | 55 | | |
28 | 56 | | |
29 | 57 | | |
| |||
0 commit comments