Alert #muzzlefeedback on OpenAI 429 responses#260
Merged
Conversation
Copilot created this pull request from a session on behalf of
sfreeman422
June 23, 2026 01:28
View session
sfreeman422
approved these changes
Jun 23, 2026
There was a problem hiding this comment.
Pull request overview
Adds operational visibility for OpenAI rate-limit failures by emitting a Slack alert to #muzzlefeedback whenever an OpenAI-backed flow receives a 429, while preserving existing error propagation/handling semantics.
Changes:
- Introduces
AIService.alertOnOpenAiRateLimit(error, operation)plus helpers to extract OpenAI status/message safely. - Wires the alert into all OpenAI-backed flows called out in the PR (text, corpo-speak, prompt-with-history, participation, Moonbeam redeploy quote, and memory extraction).
- Adds focused unit coverage for the new alert behavior and verifies it’s invoked from failure paths.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/backend/src/ai/ai.service.ts |
Adds centralized OpenAI 429 detection + Slack alerting and invokes it from OpenAI failure paths. |
packages/backend/src/ai/ai.service.spec.ts |
Adds specs validating alerting behavior for 429 (and no alert for non-429). |
packages/backend/src/ai/memory/memory.job.ts |
Hooks memory extraction OpenAI failures into the centralized 429 alert path. |
packages/backend/src/ai/memory/memory.job.spec.ts |
Refactors private-method invocation helper and adds a spec asserting 429 extraction failures trigger alerting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
@copilot fix the failing tests |
Author
sfreeman422
approved these changes
Jun 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenAI rate-limit failures were surfacing as ordinary request errors, with no operational signal in Slack. This change notifies
#muzzlefeedbackwhenever an OpenAI call returns429, using the error message returned by OpenAI.Summary
429handling for OpenAI-backed flows in the backend AI service.Implementation
alertOnOpenAiRateLimit(error, operation)path inAIService.status === 429.error.messagefallback otherwise).#muzzlefeedbackand avoids altering non-429 behavior.Covered call sites
Regression coverage
429alerting behavior.