Skip to content

Conversation

@lukasdotcom
Copy link
Member

Discussed to be a background job, but I think it would probably be better to notify when the quota is exceeded as this is already checked by default. This also means that the assistant error has more information when the quota is exceeded in a separate notification.
Resolves: #200

@lukasdotcom lukasdotcom force-pushed the feat/notify-quota-exceeded branch from 0eaf312 to 42b2fd7 Compare August 12, 2025 15:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds notification functionality to alert users when their OpenAI API quota is exceeded. The notification system provides specific messaging for different quota types (text, image, transcription, speech) and includes a link to the user's AI settings page.

  • Implements a notification system for quota exceeded scenarios
  • Creates a new Notifier class to handle notification preparation and display
  • Modifies the quota checking logic to trigger notifications when limits are reached

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lib/Service/OpenAiAPIService.php Modified quota checking to create and send notifications when quota is exceeded
lib/Notification/Notifier.php New notifier class that formats and prepares quota exceeded notifications
lib/AppInfo/Application.php Registered the new notifier service in the application

@lukasdotcom lukasdotcom force-pushed the feat/notify-quota-exceeded branch from 42b2fd7 to 71f29df Compare August 12, 2025 15:23
Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this approach is indeed better.

@lukasdotcom lukasdotcom requested a review from kyteinsky August 14, 2025 13:44
Signed-off-by: Lukas Schaefer <[email protected]>
Signed-off-by: Lukas Schaefer <[email protected]>
@lukasdotcom lukasdotcom force-pushed the feat/notify-quota-exceeded branch from 8f4c890 to 4026c0b Compare August 14, 2025 19:02
Copy link
Contributor

@kyteinsky kyteinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good!

would you mind organizing your commits into two parts? The second one becuase it affects more than quota related changes.
"feat: add notification when quota exceeded" and "chore: use ocp server get"
or you can merge the whole commit as one using the squash button here in github.
the incremental changes in different commits is nice for PRs but when looking back, you see individual commits and comments in code.

@lukasdotcom lukasdotcom merged commit ca0598c into main Aug 14, 2025
29 checks passed
@lukasdotcom lukasdotcom deleted the feat/notify-quota-exceeded branch August 14, 2025 19:13
@kyteinsky kyteinsky mentioned this pull request Oct 6, 2025
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.

Inform user if the account is running out of tokens

3 participants