feat: add CTAs to AI budget admin notifications - #28138
Conversation
324e89c to
0a26fd1
Compare
| //nolint:gocritic // The AI Gateway daemon actor cannot read organizations, | ||
| // which the notification's link to the group's members page requires. | ||
| org, err := s.store.GetOrganizationByID(dbauthz.AsSystemRestricted(ctx), group.OrganizationID) |
There was a problem hiding this comment.
In order to get the link to the user's effective group page, we need the organization name. Currently, the aibridge daemon has no org:read permissions (it is currently org-agnostic), so using AsSystemRestricted. Alternatively, we could add this permission to the daemon, but this is something that might make more sense when we do introduce org-scoping to AI Gateway 🤔
There was a problem hiding this comment.
Might as well start now, I reckon. AsSystemRestricted is something we should avoid as much as possible.
0a26fd1 to
52d44e8
Compare
dannykopping
left a comment
There was a problem hiding this comment.
Appreciate the follow-through and the description with screenshots here
Left a couple notes on how we could improve this
| //nolint:gocritic // The AI Gateway daemon actor cannot read organizations, | ||
| // which the notification's link to the group's members page requires. | ||
| org, err := s.store.GetOrganizationByID(dbauthz.AsSystemRestricted(ctx), group.OrganizationID) |
There was a problem hiding this comment.
Might as well start now, I reckon. AsSystemRestricted is something we should avoid as much as possible.
525683e to
1254667
Compare

Problem
AI budget admin notifications tell an admin that a user crossed a budget threshold, but give them nothing to act on: no link to the user's budget, and no pointer to the docs.
Changes
{{period_end}}").organization_namelabel, needed to build the members page URL.Screenshots
Admin Notifications in Coder UI
Admin Notification in Email
Related to internal Slack threads:
Note
Initially generated by Claude Opus 5, modified and reviewed by @ssncferreira