feat: Stripe・プリペイド課金一式を撤去(ADR-0023 / #522)#534
Merged
Conversation
ADR-0023 の撤去順序に従い、レート制限(#521)導入後にプリペイド課金を撤去する。 abuse 防止は日次レート制限が担う。 backend: - routers/billing・services/billing(credit_service/pricing/stripe_service)・ models/billing(CreditTransaction/AgentUsageLog)・schemas/billing・ repositories/billing・tests/test_billing を削除 - agent.py / resume_draft/run_task.py から残高チェック・クレジット消費・使用量 記録の課金配線を剥がす(rate limit は保持)。run_task は結果保存を明示 commit 化 - model_catalog からクレジット項目(is_free / credits_per_mtok / calculate_credit_cost 等)を trim(provider / model_id / エイリアスは #523 まで残す) - drop マイグレーション 0051(credit_transactions / agent_usage_logs / users.credit_balance) - stripe 依存削除 + uv.lock 再生成、Stripe env(env_keys/docker-compose/cloud_run/docs)削除、 ErrorCode(INSUFFICIENT_CREDITS/PAYMENT_ERROR)・messages.json の課金エントリ削除 web: - BillingPage・components/billing・api/billing・hooks(useBillingPage/useCreditBalance/ useModelRates/useAgentUsageSummary)・utils/creditEstimate を削除 - ModelSelectModal をクレジット表示なしのモデル選択 UI に書き換え、AgentChatWidget の 残高再取得を除去、agentModels の isPaid/costHint 削除、messages/errorCodes の課金削除 - SidebarLayout(CreditBalanceBadge/Provider・onOpenBilling)・UserMenu・routes から課金導線削除 - generated.ts 再生成(billing schema 除去) 判断事項(PR で明記): - skill-display-propose も LLM を叩き credit gate を持っていたため、rate limit を適用 (abuse 防止の一貫性 / ADR-0023) - AgentUsage のトークン計上は将来の観測用に温存(消費者なし。usage-tracking 撤去は別途) 検証: make ci green(backend 594 / web 334 / 全 lint)・E2E 36 passed・infra-validate 成功 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
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.
概要
機能整理ロードマップ #517 のサブ issue #522。ADR-0023(#520/PR #532)の撤去順序に従い、レート制限(#521/PR #533)導入後にプリペイド課金・Stripe 一式を撤去する。abuse 防止は日次レート制限が担い、Agent は残高ゼロのユーザでも動作する。
backend
routers/billing・services/billing(credit_service/pricing/stripe_service)・models/billing(CreditTransaction/AgentUsageLog)・schemas/billing・repositories/billing・tests/test_billingを削除agent.py・resume_draft/run_task.pyから残高チェック・クレジット消費・使用量記録の課金配線を剥がす(rate limit は保持)。run_task は結果保存を明示commit化(旧record_chat_usageの内部 commit を代替)model_catalogからクレジット項目(is_free/credits_per_mtok/calculate_credit_cost等)を trim(provider/model_id/エイリアスは [Agent 整理 4/4] マルチプロバイダ抽象の撤去(Haiku + Ollama 構成へ縮退) #523 まで残す)credit_transactions/agent_usage_logs/users.credit_balance。破壊的: 既存残高消失)stripe依存削除 +uv.lock再生成、Stripe env(env_keys/docker-compose/cloud_run/docs)削除、ErrorCode(INSUFFICIENT_CREDITS/PAYMENT_ERROR)・messages.jsonの課金エントリ削除web
BillingPage・components/billing・api/billing・hooks(useBillingPage/useCreditBalance/useModelRates/useAgentUsageSummary)・utils/creditEstimateを削除ModelSelectModalをクレジット表示なしのモデル選択 UI に書き換え(外科的分離。全モデル無料表示)、AgentChatWidgetの残高再取得を除去、agentModelsのisPaid/costHint削除、messages/errorCodesの課金削除SidebarLayout(CreditBalanceBadge/Provider・onOpenBilling)・UserMenu・routesから課金導線削除、generated.ts再生成判断事項(レビュー要)
AgentUsageのトークン計上は将来の観測用に温存(消費者はいないが LLM 層に深く配線されており、usage-tracking 撤去は [Agent 整理 3/4] Stripe・プリペイド課金一式の撤去 #522 のスコープ外として別途)受け入れ条件
make cigreen(backend 594 / web 334 / 全 lint)make infra-validate成功)Closes #522
🤖 Generated with Claude Code