feat(server,web): page the cost center's error table, abbreviate the source, drop command-tool noise (#103)

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-29 16:16:15 +08:00
committed by GitHub
parent 6b3574f5c9
commit e0a47254af
17 changed files with 598 additions and 41 deletions
+13 -1
View File
@@ -1085,10 +1085,22 @@ export interface UsageErrors {
unexpected: number;
/** The most frequent source · code (null when there are no errors). */
topCode: UsageErrorCount | null;
/** Most recent N items (reverse chronological). */
/** Most recent N items (reverse chronological) — the first page; older ones come from `GET /usage/errors`. */
recent: UsageErrorItem[];
}
/**
* GET /api/projects/:projectId/usage/errors — one page of the error detail table, newest
* first. The dashboard response above already carries the first page; this exists so
* "show me earlier ones" does not have to refetch the whole aggregate. It takes the same
* date/agent filter as the dashboard, so a page never widens what the summary counted.
*/
export interface UsageErrorsPage {
items: UsageErrorItem[];
/** Filtered row count, so the caller knows when it has reached the end. */
total: number;
}
export interface UsageResponse {
summary: {
today: UsageBucket;