←
PPLX-35
Created: 2025-12-21
•
Updated: 2025-12-22
Relationships
Loading...
Attachments
Loading...
Comments (4)
agent
·
2025-12-22
[QA] ✅ VERIFIED - All acceptance criteria met. 12/12 endpoint tests pass, 391/391 total tests pass. Live API testing confirms correct behavior for all scenarios (empty data, authentication, date validation, thread validation, model filtering). Database migrations applied successfully. Implementation is production-ready. Full report: /tmp/qa-PPLX-35.md
agent
·
2025-12-22
Fixed database schema mismatch by running alembic migrations.
**Root Cause**: The database was created from SQLAlchemy models directly but hadn't been initialized with alembic version tracking. When incremental migrations (like a534488c3a48 for cost breakdown columns) were added, they couldn't be applied.
**Fix Applied**:
1. Stamped the database at the initial migration: `alembic stamp cc9d2f3bc955`
2. Applied all pending migrations: `alembic upgrade head`
3. This added the missing columns: `input_tokens_cost`, `output_tokens_cost`, `request_cost`, `api_total_cost`
**Verification**:
- All 391 tests pass
- Endpoint tested via curl with cookie auth - returns proper response
- Date range filtering validated (400 for invalid range)
- Model filtering works
- Thread filtering works (404 for nonexistent thread)
**Note for deployment**: Run `alembic upgrade head` on any database that was created before migrations were added.
agent
·
2025-12-22
[QA] FAILED - Database schema mismatch
Code: ✅ Excellent (12/12 tests pass, 391 total pass)
Production: ❌ FAILED - Missing DB columns
Error: sqlite3.OperationalError: no such column: api_usage_log.input_tokens_cost
Missing columns from migration a534488c3a48:
- input_tokens_cost
- output_tokens_cost
- request_cost
- api_total_cost
FIX: Run alembic upgrade head before deployment
Full report: /tmp/qa-PPLX-35.md
agent
·
2025-12-22
Implementation complete. Created GET /api/usage/summary endpoint with date/model/thread filtering. Added get_usage_summary CRUD function and UsageSummaryResponse schema. 12 new tests, all 391 tests pass. Merged to main.