mirror of
https://github.com/AJaySi/ALwrity.git
synced 2026-04-25 08:55:58 +03:00
[PR #379] [MERGED] Fix pricing calculations and preserve model field during preflight operations processing #685
Labels
No labels
AI Content Agents
AI Content Strategy
AI Content planning
AI Marketing Tools
AI SEO
AI personalization
AI writer
ALwrity Copi-lot
Alwrity web search
Anthropic
DeepSeek
Gemini AI
Integration
LLM
OnBoarding
OnBoarding
RAG knowledgebase Memory
bug
documentation
enhancement
good first issue
help wanted
invalid
openai
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ALwrity#685
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AJaySi/ALwrity/pull/379
Author: @AJaySi
Created: 3/5/2026
Status: ✅ Merged
Merged: 3/5/2026
Merged by: @AJaySi
Base:
main← Head:codex/review-subscription-system-for-production-readiness📝 Commits (5)
81052d0Fix preflight model mapping when skipping invalid providers45dbf09Add Stripe webhook idempotency persistence guard81f49f4Add explicit usage summary uniqueness and billing indexes7d530b3Preserve full provider breakdown in billing UI coercion01bf568Fix unlimited video limit display in usage rings📊 Changes
6 files changed (+246 additions, -136 deletions)
View changed files
📝
backend/api/subscription/routes/preflight.py(+14 -7)📝
backend/models/subscription_models.py(+21 -1)📝
backend/services/subscription/stripe_service.py(+88 -19)📝
frontend/src/components/billing/CompactBillingDashboard/components/UsageLimitRings.tsx(+37 -14)📝
frontend/src/services/billingService.ts(+85 -90)📝
frontend/src/types/billing.ts(+1 -5)📄 Description
Motivation
modelfield in the validated operations list.Description
modelto each entry inoperations_to_validateand keep request fields together to ensure stable model lookup.operations_to_validatedirectly and useop.get('model')when fetching pricing.cost_per_input_tokenas a cost-per-token unit and multiply bytokens_requestedwithout dividing by 1000, and add clarifying comments.Testing
pytest(including preflight pricing checks) and the tests completed successfully.Codex Task
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.