Skip to content

Add DB-backed billing cache - #29

Open
lqkhanh295 wants to merge 1 commit into
OpenAgentsInc:mainfrom
lqkhanh295:fix-db-backed-billing-cache
Open

Add DB-backed billing cache#29
lqkhanh295 wants to merge 1 commit into
OpenAgentsInc:mainfrom
lqkhanh295:fix-db-backed-billing-cache

Conversation

@lqkhanh295

@lqkhanh295 lqkhanh295 commented Jun 12, 2026

Copy link
Copy Markdown

Fixes #14

Summary

  • add a DB-backed billing store with an in-memory LRU cache for recent account credits
  • route credential checks and completion billing through the local DB store when DB_URI is configured
  • keep BILLING_URL as a legacy fallback for deployments that have not moved billing into the Queenbee DB yet
  • document the new billing table/column/cost configuration

Validation

  • python -m compileall ai_spider tests/test_billing.py
  • python -m pytest tests/test_billing.py -q

Note: I installed only the minimal local test dependencies needed in this Codex environment (pytest, notanorm, fastapi) because Poetry is not available here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

billing endpoint changes

1 participant