Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

refactor: make user AI budget and spend endpoints consistent - #27611

#27611
Open
ssncferreira wants to merge 1 commit into
maincoder/coder:mainfrom
ssncf/refactor-user-spend-limitcoder/coder:ssncf/refactor-user-spend-limitCopy head branch name to clipboard
Open

refactor: make user AI budget and spend endpoints consistent#27611
ssncferreira wants to merge 1 commit into
maincoder/coder:mainfrom
ssncf/refactor-user-spend-limitcoder/coder:ssncf/refactor-user-spend-limitCopy head branch name to clipboard

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

Makes the user AI cost control endpoints consistent.

Changes

  • Replaces the flat spend_limit_micros and limit_source fields on GET /users/{user}/ai/spend with a nested effective_budget, reusing the type behind group_budget. The flat pair made it possible to encode a limit without a source.
  • Renames AIGroupBudget to AIBudgetLimit, since it also carries user_override limits and is no longer group-specific. The type name is not part of the wire format.
  • Moves /users/{user}/ai/budget to /users/{user}/ai/budget/override. The endpoint only ever managed the per-user override, which the type, the handlers, and the operation IDs all already said; the path was the only place that didn't.

Note

Initially generated by Claude Opus 4.7, modified and reviewed by @ssncferreira

@github-actions

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown

Docs preview

Check off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.

Copy link
Copy Markdown
Contributor Author

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

@ssncferreira ssncferreira changed the title refactor: nest user AI spend limit under effective_budget refactor: make user AI budget and spend endpoints consistent Jul 29, 2026
@ssncferreira
ssncferreira force-pushed the ssncf/refactor-user-spend-limit branch from bc3d981 to cd80e33 Compare July 29, 2026 09:59
@ssncferreira
ssncferreira force-pushed the ssncf/refactor-user-spend-limit branch from cd80e33 to 9c53517 Compare July 29, 2026 10:05
@ssncferreira
ssncferreira marked this pull request as ready for review July 29, 2026 10:07
@ssncferreira
ssncferreira requested a review from a team as a code owner July 29, 2026 10:07
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.