Thanks to visit codestin.com
Credit goes to github.com

Skip to content

refactor(coderd): add budget.CurrentPeriod for [start, end) windows - #26972

Merged
ssncferreira merged 1 commit into
mainfrom
ssncf/ai-budget-period-helper
Jul 6, 2026
Merged

refactor(coderd): add budget.CurrentPeriod for [start, end) windows#26972
ssncferreira merged 1 commit into
mainfrom
ssncf/ai-budget-period-helper

Conversation

@ssncferreira

@ssncferreira ssncferreira commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Extracts the AI budget period computation into a shared budget.CurrentPeriod helper. Pure refactor with no wire-value changes.

Changes

  • Add budget.CurrentPeriod(now, period) returning a PeriodWindow{Start, End} in UTC. Unknown periods return an error, matching the pattern used by ResolveUserAIBudget for unknown policies.
  • Update the callers and respective tests to use CurrentPeriod.

Note

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

ssncferreira commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

@ssncferreira
ssncferreira force-pushed the ssncf/ai-budget-period-helper branch from 15239d1 to 2551b28 Compare July 2, 2026 17:29
@linear-code

linear-code Bot commented Jul 2, 2026

Copy link
Copy Markdown

AIGOV-472

@ssncferreira
ssncferreira force-pushed the ssncf/ai-budget-period-helper branch from 2551b28 to 143991c Compare July 2, 2026 17:35
@ssncferreira
ssncferreira marked this pull request as ready for review July 2, 2026 17:36

@evgeniy-scherbina evgeniy-scherbina 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

@ssncferreira
ssncferreira merged commit 64ca5ac into main Jul 6, 2026
34 of 35 checks passed
@ssncferreira
ssncferreira deleted the ssncf/ai-budget-period-helper branch July 6, 2026 09:37
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 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