Repository navigation
[AISAGE-503] feat(ai-gateway): add unused usage enqueue helper - #7295
Merged
Merged
Conversation
2 tasks done
johnnyeric
marked this pull request as ready for review
October 8, 2026 13:50
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by deepseek-v4.1-flash · Input: 71K · Output: 17.7K · Cached: 738K Review guidance: REVIEW.md from base branch |
joshburt
self-requested a review
October 8, 2026 14:06
joshburt
approved these changes
Oct 8, 2026
This was referenced Oct 9, 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.
Summary
Add an unused
enqueueUsagehelper that sends the complete shared usage event to the authenticated usage-ingest endpoint. Missing endpoint or dedicated publisher secret returnsdisabledwithout network activity. A single request has a two-second timeout; only HTTP 202 returnsaccepted. Failures report only the usage ID and a categorical reason.Verification
disabled, zero network calls and no additional queue receipt. Closed the fixture and confirmed its port was released.Visual Changes
N/A
Reviewer Notes
The helper has no gateway callers. Queue acceptance does not establish billing completion; this change adds no consumer or inference/billing integration.
Validation: 12 focused Jest cases, shared-package and gateway typechecks, scoped type-aware lint, formatting and diff checks. Cases cover dedicated authentication, exact payload preservation, missing/malformed configuration, non-202 responses, a real stalled HTTP request and rejected response-body cleanup. Failure logs require exactly one safe warning; negative controls adding URL/secret warnings on HTTP refusal or timeout fail the tests.