Skip to content

feat: add group AI budget management UI#26375

Merged
EhabY merged 2 commits into
mainfrom
ehab/group-ai-budget-ui
Jun 17, 2026
Merged

feat: add group AI budget management UI#26375
EhabY merged 2 commits into
mainfrom
ehab/group-ai-budget-ui

Conversation

@EhabY

@EhabY EhabY commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds an AI budget section to the group settings page (/organizations/{org}/groups/{group}/settings), gated by the aibridge feature.

The page's existing Save persists a per-member monthly budget through PUT/DELETE /api/v2/groups/{group}/ai/budget alongside the group patch. An empty field is uncapped (deletes the budget), 0 disables spending, and any value >= 0 is accepted (matching the API's gte=0). The helper shows the resulting group-wide monthly maximum.

Part of AIGOV-294. The "AI governance add-on" access toggle shown in the design is out of scope here, as no backend field or endpoint exists for it yet.

Closes AIGOV-294

@linear-code

linear-code Bot commented Jun 15, 2026

Copy link
Copy Markdown

AIGOV-294

AIGOV-444

@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch 2 times, most recently from 0e4e595 to 7ca5b73 Compare June 15, 2026 15:03
@EhabY EhabY marked this pull request as ready for review June 15, 2026 15:04
@coder-tasks

coder-tasks Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/ai-coder/ai-governance.md - This page lists AI Governance Add-On features (AI Gateway, Agent Firewall) but does not mention AI budget / spend controls. Add AI budgets as a listed feature and briefly describe what they do (per-group monthly spend limits for AI usage, configurable in group settings).

    ⚠️ Was addressed in a previous revision but the docs change was removed from this PR

New Documentation Needed

  • docs/admin/users/quotas.md or docs/ai-coder/ai-governance.md - Add a section explaining AI budget behavior: empty field = uncapped spend, 0 = spending disabled, positive value = per-member monthly budget in USD. Clarify how the group-wide maximum is calculated (per-member budget x member count). This is a user-facing setting with no prose documentation anywhere; the only references are auto-generated API docs in docs/reference/api/enterprise.md and audit log field tracking.

    ⚠️ Was addressed in a previous revision but the docs change was removed from this PR


Automated review via Coder Agents

Comment thread site/src/pages/GroupsPage/GroupSettingsPage.tsx Outdated
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch from 7ca5b73 to d6279fb Compare June 15, 2026 15:27
@github-actions

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/ai-coder/ai-governance.md

@EhabY EhabY changed the title feat(site): add group AI budget management UI feat: add group AI budget management UI Jun 15, 2026
@EhabY EhabY requested a review from ssncferreira June 15, 2026 16:58

@ssncferreira ssncferreira 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.

LGTM 👍 just a few comments 🙂

Comment thread docs/ai-coder/ai-governance.md Outdated
Comment thread site/src/pages/GroupsPage/GroupSettingsPage.tsx Outdated
Comment thread site/src/pages/GroupsPage/GroupSettingsPageView.stories.tsx Outdated
Comment thread site/src/pages/GroupsPage/GroupSettingsPage.tsx
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch 2 times, most recently from 232eda9 to a76e439 Compare June 16, 2026 10:25
@EhabY EhabY requested a review from ssncferreira June 16, 2026 10:29
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch from a76e439 to 8a49e8a Compare June 16, 2026 10:34
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch 2 times, most recently from 6abebb2 to ced7a04 Compare June 16, 2026 11:01

@ssncferreira ssncferreira 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.

LGTM 🐈

Comment thread site/src/pages/GroupsPage/GroupSettingsPage.tsx
Comment thread site/src/pages/GroupsPage/GroupSettingsPage.tsx
Comment thread site/src/pages/GroupsPage/GroupSettingsPageView.stories.tsx
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch from ced7a04 to 1e957fa Compare June 17, 2026 09:49
EhabY added 2 commits June 17, 2026 12:59
Add an AI budget section to the group settings page, gated by the
aibridge feature. The page's Save persists a per-member monthly budget
via the group AI budget endpoints alongside the group patch: an empty
field is uncapped (deletes the budget), 0 disables spending, and any
value >= 0 is accepted. A helper shows the group-wide monthly maximum.
Gate the AI budget UI behind the ai-gateway-cost-control experiment
while the feature is in development. Also give the group patch and
budget save separate error handling so a budget failure is not
reported as a group update failure.
@EhabY EhabY force-pushed the ehab/group-ai-budget-ui branch from 1e957fa to 47e322c Compare June 17, 2026 10:00
@EhabY EhabY merged commit 74a7ad0 into main Jun 17, 2026
34 checks passed
@EhabY EhabY deleted the ehab/group-ai-budget-ui branch June 17, 2026 10:22
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 17, 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