Implement durable asynchronous API-cost webhook delivery & migrate APICostMonitor to SQLAlchemy - #863
Conversation
…SQLAlchemy - Defined SQLAlchemy ORM models for APIUsage, DailyBudget, and WebhookOutbox. - Replaced raw sqlite3 connections and cursors in APICostMonitor with context-managed SQLAlchemy sessions. - Designed a durable outbox state machine to claim, process, and retry budget alert webhooks. - Included automatic recovery of stale processing items stuck due to cancellation or crashes. - Added comprehensive unit tests in test_api_cost_monitor.py verifying duplicate prevention, retries, and crash recovery.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🔍 PR Validation
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
Implement durable asynchronous API-cost webhook delivery and migrate APICostMonitor to SQLAlchemy. All raw SQLite connection management inside APICostMonitor has been fully refactored to context-managed SQLAlchemy ORM session transactions. A robust webhook delivery outbox state machine has been added with duplicate prevention, failed-delivery retry, recovery from crashes/task cancellations, and retry boundaries. All 85 unit tests pass cleanly.
Fixes #861
PR created automatically by Jules for task 9314257410577574552 started by @groupthinking