fix(monitoring): restore SQLite token statistics - #2479
Merged
Conversation
Allow the monitored SQLite strftime bucket expression through the tenant SQL guard and preserve structured backend errors in the token dashboard. Add persistence and frontend regressions.\n\nVerified-by: independent-review
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Keep the PostgreSQL capacity probe aligned with the runtime handler contract and assert the bounded reconcile timeout.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
概述 / Overview
Fixes #2468.
strftimethroughTenantUnitOfWork;msgwhen the token dashboard receives the HTTP client's structured{ code, msg, data }error object, instead of displaying[object Object];master(the first CI run exposed this unrelated deterministic base regression).This is an independent reimplementation of the focused fix discussed in #2473 because that contribution cannot be merged without its author's CLA signature.
更改前后对比截图 / Screenshots
No layout change.
Before: token monitoring returned HTTP 500 on SQLite, and the UI rendered
[object Object].After: SQLite time buckets execute through the tenant SQL guard; future structured API failures display their backend message.
Validation
uv run pytest tests/unit_tests/persistence/test_tenant_uow.py -q --tb=short— 118 passeduv run pytest tests/unit_tests/api/service/test_monitoring_tenancy.py::test_token_statistics_aggregate_and_limit_groups_in_database -q --tb=short— passeduv run ruff check ...— passeduv run ruff format --check ...— passedpnpm test:unit— 54 passedpnpm lint— 0 errors (34 existing warnings)pnpm build— passedpnpm exec prettier --check ...— passedgit diff --check— passed检查清单 / Checklist
项目维护者完成 / For project maintainer