Skip to content

chore(frontend): remove vestigial AI Gateway v1 references#2403

Merged
malinskibeniamin merged 4 commits intomasterfrom
ben/remove-old-aigw-refs
Apr 21, 2026
Merged

chore(frontend): remove vestigial AI Gateway v1 references#2403
malinskibeniamin merged 4 commits intomasterfrom
ben/remove-old-aigw-refs

Conversation

@malinskibeniamin
Copy link
Copy Markdown
Contributor

@malinskibeniamin malinskibeniamin commented Apr 21, 2026

Summary

  • Remove the old AI Gateway v1 references from Console frontend (dev proxy, buf-generated npm packages, AI_GATEWAY_URL env helper).
  • AI Gateway v2 (aigw) wiring is fully preserved: /.aigw/api dev proxy, v2 transport hook, v2 query hooks, and the agent pages that depend on them all stay.
  • Old AI Gateway v1 UI was removed in Remove deprecated AI Gateway API #2155 (Jan 2026); this PR finishes the job by deleting the last vestigial references.

What's removed

  • Dev proxy block for /.redpanda/api/redpanda.api.aigateway.v1 in frontend/rsbuild.config.ts (v1 only)
  • AI_GATEWAY_URL env var export in frontend/start-cloud.sh (plus the cluster-id regex helper it fed)
  • @buf/redpandadata_ai-gateway.bufbuild_es and @buf/redpandadata_ai-gateway.connectrpc_query-es dependencies
  • Lockfile entries regenerated (bun.lock, yarn.lock)

What's preserved

  • AIGW v2 proxy block (/.aigw/api) in rsbuild.config.ts — still gated on AIGW_URL env var
  • useAigwTransport, useListLLMProvidersQuery, useListAigwMCPServersQuery and the agent-page call sites
  • Scope.AI_GATEWAY secret scope label — semantically refers to stored credentials scoped to AIGW access
  • Deprecated virtualGatewayId field in AIAgent.GatewayConfig proto — backend contract stays

Companion PR

cloudv2 cleanup (kills the old AI Gateway front-end embedded under /clusters/:id/ai-gateway in Cloud UI): https://github.com/redpanda-data/cloudv2/pull/25788

Test plan

  • bun i && bun i --yarn in frontend/ — lockfiles stay clean
  • bun run start:cloud <backend-url> — dev server starts; aigw v2 proxy still routes when AIGW_URL is set
  • bun run test — existing agent/secret suites still pass

Generated with Claude Code

The old AI Gateway v1 UI was removed from Console in #2155 (Jan 2026)
but a dev proxy and two buf-generated npm packages remained. Drop them.

Removed:
- Dev proxy block for `/.redpanda/api/redpanda.api.aigateway.v1` in rsbuild.config.ts
- `AI_GATEWAY_URL` env var export in start-cloud.sh (and cluster-id regex helper it depended on)
- `@buf/redpandadata_ai-gateway.bufbuild_es` / `@buf/redpandadata_ai-gateway.connectrpc_query-es` deps

Preserved:
- AI Gateway v2 (`aigw`) proxy, hooks, query layer, agent pages
- Scope.AI_GATEWAY secret scope (semantically v2 now)
- Deprecated `virtualGatewayId` field in `AIAgent.GatewayConfig` proto — backend contract stays

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@malinskibeniamin
Copy link
Copy Markdown
Contributor Author

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 21, 2026

Claude finished @malinskibeniamin's task in 1m 11s —— View job


Code Review

  • Gather context and read changed files
  • Check CLAUDE.md for repo guidelines
  • Review changes and check for remaining v1 references
  • Post review feedback

Overall: This is a clean, well-scoped deletion-only PR. The logic of what's removed is sound — no source files import the dropped packages, the v2 aigw wiring is untouched, and the CLUSTER_ID extraction was only ever used to construct AI_GATEWAY_URL so removing both together is safe.

One issue: lock files not regenerated

Both frontend/bun.lock and frontend/yarn.lock still contain entries for the removed packages. This means the dropped dependencies are still present in the lock files on the branch, which could lead to them being installed by CI or other tooling despite being removed from package.json.

bun.lock (lines 10–11, 305, 307, etc.):

"@buf/redpandadata_ai-gateway.bufbuild_es": "^2.11.0-20260313141452-dbbaece03f76.1",
"@buf/redpandadata_ai-gateway.connectrpc_query-es": "^2.2.0-20260313141452-dbbaece03f76.1",

yarn.lock (lines 620–640):

"@buf/redpandadata_ai-gateway.bufbuild_es@2.7.0-..."
"@buf/redpandadata_ai-gateway.connectrpc_query-es@..."

The test plan already calls for bun i && bun i --yarn locally, but the resulting lock file updates weren't committed. Running that and committing the result would complete the cleanup. Fix this →

Minor observations (no action needed)

  • rsbuild.config.ts — The v1 proxy block removal is correct. The v2 aigw proxy (/.aigw/api) and "all other APIs" proxy remain intact.
  • start-cloud.sh — The CLUSTER_ID sed regex was only used to construct AI_GATEWAY_URL, so removing both together is clean and safe with no unintended side effects.
  • package.json — No remaining source imports of @buf/redpandadata_ai-gateway.* exist anywhere in frontend/src/. The removal is safe.
  • No v1 references were found elsewhere in the codebase (confirmed by searching *.ts, *.tsx, *.js, *.json, *.sh, *.md).

Summary

The code changes themselves are correct and complete. The only gap is the uncommitted lock file regeneration. Once that's addressed this is ready to merge.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@malinskibeniamin
Copy link
Copy Markdown
Contributor Author

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 21, 2026

Claude finished @malinskibeniamin's task in 1m 1s —— View job


Code Review

  • Gather context
  • Check CLAUDE.md for repo guidelines
  • Read changed files
  • Verify lockfile regeneration addressed previous feedback
  • Post review feedback

Overall: This is a clean, correct, deletion-only PR. The previous review flagged uncommitted lockfile regeneration — that has been addressed in follow-up commit 0f8c643. The PR is now complete and ready to merge.

Changes reviewed

frontend/package.json — Two packages removed:

  • @buf/redpandadata_ai-gateway.bufbuild_es
  • @buf/redpandadata_ai-gateway.connectrpc_query-es

Confirmed: no source files under frontend/src/ import either package. Safe removal.

frontend/rsbuild.config.ts — The v1 proxy block (/.redpanda/api/redpanda.api.aigateway.v1AI_GATEWAY_URL) is gone. The v2 aigw proxy (/.aigw/apiAIGW_URL) and the general API/auth proxy are untouched.

frontend/start-cloud.sh — The CLUSTER_ID sed extraction and AI_GATEWAY_URL export are removed together. CLUSTER_ID was only ever used to construct AI_GATEWAY_URL, so removing both is correct with no side effects.

frontend/bun.lock / frontend/yarn.lock — Regenerated in commit 0f8c643. Confirmed: zero remaining entries for ai-gateway.bufbuild_es or ai-gateway.connectrpc_query-es in either lock file.

No issues found

The v1 cleanup is complete. No remaining references to AI Gateway v1 exist in source files, config, scripts, or lock files. AI Gateway v2 wiring is untouched. This is ready to merge.

…via ADP UI

The /.aigw/api dev proxy is removed. Console does not call AI Gateway
(v1 or v2) directly anymore; ADP UI (hosted inside Cloud UI) owns all
AIGW interaction going forward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@malinskibeniamin
Copy link
Copy Markdown
Contributor Author

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 21, 2026

Claude finished @malinskibeniamin's task in 2m 3s —— View job


Code Review

  • Gather context and read changed files
  • Check CLAUDE.md for repo guidelines
  • Review all changes thoroughly
  • Post review feedback

Overall: This is a clean, complete cleanup. The issue from the previous review (lock files not regenerated) has been addressed across commits 0f8c643 and de81204. All 5 changed files are correct.

Previous issue — resolved

Both bun.lock and yarn.lock have been regenerated and no longer contain any @buf/redpandadata_ai-gateway.* entries. No source file imports those packages either.

Commit de81204 — v2 proxy also removed (scope expansion)

This commit went beyond the original PR description by also removing the /.aigw/api dev proxy block. This is architecturally sound: AIGW pages (/agents, /mcp-servers, /transcripts) are all guarded by visibilityCheck: routeVisibility(() => isEmbedded()) in route-utils.tsx:304,311. In embedded mode, useAigwTransport() uses config.aigwUrl from the parent cloud-ui config — never /.aigw/api — so removing the dev proxy is safe and non-breaking.

Minor: stale JSDoc comments (no action required)

Three files have comments that now describe a dev proxy that no longer exists:

src/hooks/use-aigw-transport.ts:12

In Development:
  - Uses base path: /.aigw/api
  - Dev server proxies to the aigw v2 management endpoint  // ← stale

src/react-query/api/aigw/llm-providers.tsx:6 and mcp-servers.tsx:6

@note This hook uses the aigw v2 transport - requires /.aigw/api/ proxy configuration  // ← stale

These are comment-only rot and don't affect runtime behavior (the standalone fallback to /.aigw/api in the transport hook is harmless since AIGW pages only render in embedded mode). Fine to leave or clean up as a follow-on. Fix this →

Summary

The changes are correct, safe, and complete. Lock files are clean, no source imports remain for the dropped packages, and the routing logic confirms AIGW features are isEmbedded()-gated so removing both dev proxies is non-breaking. Ready to merge.


@malinskibeniamin malinskibeniamin requested review from a team, c-julin, datamali, eblairmckee and r-vasquez and removed request for a team April 21, 2026 12:06
Comment thread frontend/rsbuild.config.ts
…me AIGW via ADP UI"

Per reviewer feedback on #2403: the aigw v2 (`/.aigw/api`) dev proxy
stays. It powers Console's own aigw v2 API calls (LLMProviderService,
ModelService) used by the agent pages. Only the v1 proxy is removed
in this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@malinskibeniamin malinskibeniamin merged commit c4c0633 into master Apr 21, 2026
19 checks passed
@malinskibeniamin malinskibeniamin deleted the ben/remove-old-aigw-refs branch April 21, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants