Skip to content

feat(site): add AI Gateway keys management page - #25817

Merged
pawbana merged 8 commits into
mainfrom
pb/gateway-multi-replica-key-auth-ui
Jun 15, 2026
Merged

pawbana merged 8 commits into
mainfrom
pb/gateway-multi-replica-key-auth-ui

Conversation

@pawbana

@pawbana pawbana commented May 28, 2026 •

Copy link
Copy Markdown
Collaborator

Vibe-coded using Coder Agents, author with limited frontend knowledge, manually tested.

Adds an AI Gateway Keys page under Admin settings > AI > AI Gateway Keys for key management of keys used by standalone AI Gateway replicas to authenticate into coderd.
The page is shown to users with viewAIGatewayKeys permission and a Premium license with AI Gateway enabled.
Adds Storybook coverage.

pawbana commented May 28, 2026 •

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch 3 times, most recently from 61253f1 to c6f9888 Compare May 29, 2026 10:48
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch from e929815 to 2da5a54 Compare May 29, 2026 10:48
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from c6f9888 to f6d48a7 Compare May 29, 2026 15:24
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch 2 times, most recently from c4c363c to e953487 Compare June 1, 2026 11:33
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch 2 times, most recently from 99083fe to 7d516d4 Compare June 1, 2026 14:47
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch 2 times, most recently from ac72698 to fc22aeb Compare June 1, 2026 18:47
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch 2 times, most recently from 2c718a0 to e4bf7e6 Compare June 1, 2026 18:48
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch from fc22aeb to ca99dc0 Compare June 1, 2026 18:48
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from e4bf7e6 to abe5a17 Compare June 2, 2026 07:06
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch from ca99dc0 to 5303d30 Compare June 2, 2026 07:06
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from abe5a17 to a57cc01 Compare June 2, 2026 07:42
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch 2 times, most recently from 841b471 to f1cb484 Compare June 2, 2026 09:39
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch 2 times, most recently from 05c5d96 to b9eb8cb Compare June 2, 2026 10:52
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch from f1cb484 to 6d42bab Compare June 2, 2026 10:52
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from b9eb8cb to 677456f Compare June 2, 2026 11:03
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-cli branch from 6d42bab to 8b22178 Compare June 2, 2026 11:03
@pawbana

pawbana commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review

coder-agents-review Bot commented Jun 10, 2026 •

Copy link
Copy Markdown
Contributor

Chat: Review in progress | View chat
Requested: 2026-06-11 13:16 UTC by @pawbana
Spend: $54.15 / $100.00

deep-review v0.7.1 | Round 3 | cfb03f5..eada64a

Last posted: Round 3, 12 findings (2 P2, 8 P3, 1 Nit, 1 Note), APPROVE. Review

Finding inventory

Findings

# Sev Status Location Summary Round Reviewer Posted
CRF-1 P2 Author fixed (b212d0f) CreateGatewayKeyDialog.tsx:41 Non-validation API errors silently swallowed in create dialog R1 Bisky P2, Leorio P2, Nami P2, Kite P2 Yes
CRF-2 P3 Author fixed (b212d0f) CreateGatewayKeyDialog.tsx:24 Client-side name validation absent; helper text promises unenforced format constraints R1 Hisoka P2, Robin P2, Zoro P2, Bisky P3, Mafuuu P3, Chopper P3, Kite P3, Pariston Nit, Nami Nit Yes
CRF-3 P3 Author fixed (b212d0f) CreateGatewayKeyDialog.tsx:70 Key reveal state accidentally dismissable via backdrop click or Escape R1 Hisoka P3, Kite P3 Yes
CRF-4 P3 Author fixed (b212d0f) GatewayKeysPageView.tsx:76 Error alert and empty state render simultaneously on load failure R1 Nami P3, Hisoka Note Yes
CRF-5 P3 Author fixed (b212d0f) CreateGatewayKeyDialog.stories.tsx:37 No story exercises creation error path R1 Chopper P3, Bisky P2 Yes
CRF-6 P3 Author fixed (b212d0f) CreateGatewayKeyDialog.stories.tsx:25 No story verifies dialog state resets between close and reopen R1 Bisky P3 Yes
CRF-7 Note Author fixed (b212d0f) Navbar.tsx:30 Navbar AI Settings link undiscoverable for users with only viewAIGatewayKeys permission R1 Zoro P3, Pariston Note Yes
CRF-8 Nit Author fixed (b212d0f) GatewayKeysPageView.stories.tsx:31 Empty story missing play function to verify CTA fires onCreateKey R1 Bisky Nit Yes
CRF-9 P2 Author fixed (eada64a) Navbar.tsx:31 CRF-7 fix regression: gateway-keys-only users trapped on permission wall at /ai/settings index route R2 Hisoka P2, Nami P2, Meruem P2 Yes
CRF-10 P3 Author fixed (eada64a) CreateGatewayKeyDialog.stories.tsx:27 CRF-2 fix (client-side validation) has no test coverage R2 Bisky P3 Yes
CRF-11 P3 Author fixed (eada64a) CreateGatewayKeyDialog.stories.tsx:93 CRF-3 fix (escape guard during key reveal) has no test coverage R2 Bisky P3 Yes
CRF-12 P3 Author fixed (eada64a) CreateGatewayKeyDialog.tsx:82 Dialog close prevention split across two mechanisms for the same concern R2 Meruem P3 Yes

Round log

Round 1

Panel. 1 P2, 5 P3, 1 Note, 1 Nit. Netero: no findings. Reviewed against cfb03f5..590996b.

Round 2

Panel. CRF-1 through CRF-8 all addressed. 1 P2, 3 P3 new. CRF-9 is fix-chain regression from CRF-7. Reviewed against cfb03f5..b212d0f.

Round 3

Panel. CRF-9 through CRF-12 all addressed. No new findings. All 12 findings resolved. Reviewed against cfb03f5..eada64a.

About deep-review

CRF = Coder Review Finding (P0-P4, Nit, Note)

Reviewer Focus
Bisky tests
Chopper ops/errors
Churn-guard change verification
Ging language modernization
Gon naming
Hisoka edge cases
Killua perf
Kite change integrity
Knov contracts
Knuckle SQL
Kurapika security
Law decomposition
Leorio docs
Luffy product
Mafu-san process
Mafuuu contracts
Melody dispatch/pairing
Meruem structural
Nami frontend
Netero mechanical checks
Pariston premise testing
Pen-botter product gaps
Razor verification
Robin duplication
Ryosuke Go arch
Takumi concurrency
Zoro shape

🤖 Managed by Coder Agents.

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean, well-structured CRUD page that reuses the right shared components. The page/view/dialog decomposition, query cache invalidation, permission gating, and paywall pattern all follow the established AI providers page conventions. The Storybook coverage is strong: the interaction stories use real assertions on real transitions, not render-only placeholders. The delete confirmation text is a highlight: "Any AI Gateway replica using it will no longer be able to authenticate" tells the operator the consequence, not the mechanism.

"tells the operator the consequence: not what the system does ('deletes the key'), but what breaks in their infrastructure. This is the standard every delete confirmation should meet." (Leorio)

Severity summary: 1 P2, 5 P3, 1 Note, 1 Nit.

The PR description is empty (only the template comment). For a 563-line, 11-file feature addition with CRUD, paywall gating, and permission checks, the reasoning and design choices belong in the PR description.


site/src/modules/dashboard/Navbar/Navbar.tsx:30

Note [CRF-7] canViewAISettings only checks viewAnyAIProvider. A user with viewAIGatewayKeys but not viewAnyAIProvider cannot discover the gateway keys page through the navigation (the page itself works via direct URL). This is unlikely to affect real users since these permissions are typically granted together, but worth noting if the permission model evolves.

(Zoro P3, Pariston Note)

🤖

🤖 This review was automatically generated with Coder Agents.

@linear-code

linear-code Bot commented Jun 11, 2026

Copy link
Copy Markdown

AIGOV-313

@pawbana

pawbana commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All 8 R1 findings verified fixed. The error surfacing, validation schema, key-reveal guard, error/empty state separation, and story coverage are all correct. The PR description is now filled in. Nice turnaround.

"This is the kind of assertion suite that proves the fix: it checks for the presence of what should appear AND the absence of what shouldn't." (Bisky, on the LoadError story)

Severity summary: 1 P2, 3 P3 new this round.

The P2 (CRF-9) is a fix-chain regression from the CRF-7 fix. Expanding canViewAISettings to include viewAIGatewayKeys made the "AI" dropdown link visible to users who lack viewAnyAIProvider, but clicking it lands on the Providers index route, which shows a full-screen permission modal with no escape to the sidebar. The gateway keys page is unreachable through the UI for this user class.

🤖 This review was automatically generated with Coder Agents.

@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from 8f195e2 to eada64a Compare June 11, 2026 13:11
@pawbana

pawbana commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

/coder-agents-review

@coder-agents-review coder-agents-review Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All 12 findings from rounds 1 and 2 verified fixed. No new findings from the R3 panel (Bisky, Hisoka, Mafuuu, Knov). Netero clean.

The R2 fix for CRF-9 (permission-wall dead end) is well-designed: AISettingsIndexPage checks permissions in priority order and redirects gateway-keys-only users with replace. The sidebar correctly gates each link on the individual permission. The CRF-12 simplification (single onOpenChange guard) eliminated the dual-mechanism split cleanly.

"The code presented one face and showed the same face on inspection. Nothing hidden." (Hisoka)

Test density climbed from 18.8% (R1) to 34.6% (R3) across the three rounds. Story coverage now includes happy paths, both error shapes, client-side validation, escape guard, state-reset lifecycle, and error/empty mutual exclusion. The contract chain (permissions, routing, API, dialog state, query cache) is consistent end to end.

🤖 This review was automatically generated with Coder Agents.

@pawbana
pawbana marked this pull request as ready for review June 12, 2026 09:23

@jakehwll jakehwll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

State was annoying me as stated but LGTM otherwise 🥳

@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from eada64a to 51867bd Compare June 15, 2026 11:07
@pawbana
pawbana force-pushed the pb/gateway-multi-replica-key-auth-ui branch from 51867bd to 6462221 Compare June 15, 2026 12:15
pawbana and others added 5 commits June 15, 2026 14:17
…Dialog.tsx

Co-authored-by: Jake Howell <jacob@coder.com>
…Dialog.tsx

Co-authored-by: Jake Howell <jacob@coder.com>
…Dialog.tsx

Co-authored-by: Jake Howell <jacob@coder.com>
@pawbana
pawbana merged commit e019210 into main Jun 15, 2026
28 of 30 checks passed
@pawbana
pawbana deleted the pb/gateway-multi-replica-key-auth-ui branch June 15, 2026 16:27
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants