Commit Graph
18 Commits
Author SHA1 Message Date
fawney19 6ef6cbade2 Fallback dashboard aggregate reads on schema mismatch 2026-05-22 17:52:36 +08:00
stabeyandClaude Opus 4.7 cadc45c5b8 fix(data): cleanup uses failed candidate status instead of 504
The stale-pending cleanup task previously hardcoded status_code=504 and a
generic timeout message for every usage row it finalized. When a request
had already been observed as failing — e.g. upstream Connection reset by
peer, watchdog 504, or an authenticated 4xx — the cleanup overwrote that
context with a misleading "服务器超时" outcome and 504 status, hiding the
real cause from the dashboards and customer.

Pull the most recent failed/cancelled candidate per stale request_id and,
if present, finalize the usage row with the candidate's status_code
(defaulting to 502 when none was recorded) and error_message. Requests
that have no terminal candidate (truly stuck pending/streaming) keep the
existing 504 + timeout-message behavior, since they really are timeouts
from the cleanup's perspective. Applied to all three SQL backends with
parameterized UPDATE statements.

The Postgres failed-candidate lookup orders by
COALESCE(finished_at, started_at, created_at) DESC, matching the MySQL
and SQLite ORDER BY clauses so the three backends pick the same
"most recent terminal candidate" under every NULL combination of timing
columns.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-21 16:56:56 +08:00
fawney19 57910f906d Preserve usage provider identity 2026-05-20 20:56:36 +08:00
mayrain b4d17a392a feat(kiro): simulate prompt cache usage accounting 2026-05-19 10:47:17 +08:00
fawney19 5eed329916 Rootfix usage counter outbox 2026-05-19 00:44:37 +08:00
RWDai 24129d7f12 Merge upstream/main into feat/356-usage-record-columns 2026-05-18 20:33:05 +08:00
RWDai b6f558d10b Project usage client family in Postgres reads 2026-05-18 19:29:10 +08:00
RWDai 0a26accca4 Merge remote-tracking branch 'upstream/main' into feat/356-usage-record-columns 2026-05-18 17:49:35 +08:00
Kayphoon ae472d6744 fix(data): require provider id for provider usage aggregation 2026-05-18 00:36:29 +08:00
RWDai b2266b588e Preserve usage origin metadata in Postgres lists 2026-05-17 21:09:59 +08:00
fawney19 6a608b8e3f fix: recover finalized usage provider links safely 2026-05-16 15:15:57 +08:00
fawney19 0c03c188f1 fix codex window usage stats 2026-05-07 13:35:25 +08:00
fawney19 fd44906bb7 fix provider pool quota status handling 2026-05-07 11:28:44 +08:00
Kayphoon 79cb9b502a feat(pool): add codex cycle stats mode 2026-05-07 00:07:32 +08:00
fawney19 6fbb867f5f Exclude unknown providers from usage aggregations 2026-05-06 13:40:18 +08:00
fawney19 887a58d639 Fix usage provider stats and performance analysis UI 2026-05-06 09:29:12 +08:00
fawney19 be580c35bb chore: resolve pr 377 checks 2026-05-06 02:22:32 +08:00
fawney19 fce7e959e5 Add multi-database data layer
Introduce aether-data-schema and driver-specific schema generation for Postgres, MySQL, and SQLite.

Split data backends, lifecycle, repositories, and gateway runtime integration across database drivers.

Verified with cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, and cargo test --workspace.
2026-05-05 18:27:36 +08:00