Skip to content

feat: add coderd_ai_user_budget_override resource - #454

Draft
ssncferreira wants to merge 1 commit into
ssncf/ai-group-budgetfrom
ssncf/ai-user-budget-override
Draft

ssncferreira wants to merge 1 commit into
ssncf/ai-group-budgetfrom
ssncf/ai-user-budget-override

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Oct 12, 2026 •

Copy link
Copy Markdown

Description

Adds the coderd_ai_user_budget_override resource, which manages an AI spend limit for a single user and the group their spend is attributed to (/api/v2/users/{user}/ai/budget/override). Stacked on #453.

Changes

  • Add coderd_ai_user_budget_override with user_id, group_id, and spend_limit, registered under the "AI Governance" docs subcategory.
  • Reuse the spend_limit validators and conventions from coderd_ai_group_budget, and link the two resources in the docs.
  • Import by user ID or username, like coderd_user.
  • Add an example, import docs, mock-server plan tests, and an acceptance test.
Decisions
  • user_id forces replacement. group_id and spend_limit update in place, since the upsert API supports both.
  • The plan fails when the user already has an override with a different group or limit. An equal override is adopted.
  • No plan-time membership check: membership often comes from IdP sync or a coderd_group in the same apply. The server's 400 ("User is not a member of the referenced group.") is surfaced as is.
  • Coder deletes the override when the user leaves the group or organization. Read then removes it from state, and the next apply recreates it, or fails if the user is still not a member.

Closes AIGOV-682

Note

Generated by Coder Agents on behalf of @ssncferreira.

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

AIGOV-682

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant