Uh oh!
There was an error while loading. Please reload this page.
feat(ai-image): expose the per-user generation history - #89
Conversation
A generation can complete and be billed server-side while the client saw a timeout or an error; the upstream keeps the delivered result in a per-user history that no route exposed, so such images were invisible to every client. Pipe it through /private-api/ai-images for the validated username only - prompts are private to their author. Fixes#88
ⓘ Your Qodo trial ends soon. Ask your workspace admin to set up billing to keep reviews running after the trial. Manage billing |
PR Summary by QodoExpose authenticated per-user AI image history
AI Description
Diagram
High-Level Assessment
Files changed (2) |
Code Review by Qodo
1. ai-images lacks parity artifacts |
Warning Review limit reachedNext included review available in 11 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change adds ChangesAI image history endpoint
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk:⚪ Minimal · up to This localized endpoint addition exposes validated per-user image history without any identified merge-blocking risk; it is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Client
participant Routes
participant PrivateApi
participant UserAiImages
Client->>Routes: POST /private-api/ai-images
Routes->>PrivateApi: Invoke AiImagesHistory
PrivateApi->>PrivateApi: ValidateCode
PrivateApi->>UserAiImages: Forward request for validated username
UserAiImages-->>Client: Return AI image history
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes add POST /private-api/ai-images, validate the signed code, reject invalid authentication with 401 Unauthorized, and proxy the request to the validated user's AI image history endpoint. The implementation does not accept a username from the request body, satisfying issue ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review by Qodo
1. ai-images lacks parity artifacts |
Uh oh!
There was an error while loading. Please reload this page.
| app.MapPost("/private-api/boosted-post", PrivateApi.BoostedPost); | ||
| app.MapPost("/private-api/ai-generate-price", PrivateApi.AiGeneratePrice); | ||
| app.MapPost("/private-api/ai-generate-image", PrivateApi.AiGenerateImage); | ||
| app.MapPost("/private-api/ai-images", PrivateApi.AiImagesHistory); |
There was a problem hiding this comment.
2. ai-images lacks parity artifacts 📘 Rule violation▣ Testability
The PR adds the observable POST /private-api/ai-images endpoint without a corresponding dotnet/parity/KNOWN_DIVERGENCES entry or an automated endpoint test. Both artifacts are required for HTTP-visible route changes.
Agent Prompt
## Issue description
The new `POST /private-api/ai-images` route changes the public HTTP surface without the required parity divergence documentation or automated behavior coverage.
## Issue Context
Document how this endpoint differs from the reference image and add tests covering at least successful authenticated proxying and rejection of invalid signed codes.
## Fix Focus Areas
- dotnet/EcencyApi/Handlers/Routes.cs[158-158]
- dotnet/EcencyApi/Handlers/PrivateApi.Misc.cs[575-585]
- dotnet/parity/KNOWN_DIVERGENCES[1-1]
- dotnet/EcencyApi.Tests[1-1]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
Parity artifacts added in 2f5a086: an AI_IMAGES_DIVERGENCE entry for the three generated probes, mirroring the dictation-route precedent for additive endpoints. On tests: the repo's convention unit-tests extractable request-construction logic (BuildTranscribeContent), while thin validate-and-pipe handlers like the sibling AI price routes have no endpoint harness; this handler has no extractable logic beyond the upstream URL, and the username-from-validated-code property is exercised by the parity badcode probe answering 401.
Same shape as the dictation entries: the reference build predates the route and answers 404 while this build validates the code, so the three generated probes are expected diffs, not regressions.
Uh oh!
There was an error while loading. Please reload this page.
Adds
POST /private-api/ai-images: validates the signed code and pipes the upstream per-user AI image history (users/{username}/ai-images) for the validated username only, mirroring the auth pattern of the other AI routes. Prompts are private to their author, so the username never comes from the request body.Consumer: the AI dialog History tab in ecency/vision-web#1687.
Fixes#88
Summary by CodeRabbit