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
+21
View File
@@ -63,6 +63,7 @@ import type {
UiPrefs,
UpdateCheckResponse,
UpdateRunResponse,
UsageErrorsPage,
UsageGroupBy,
UsageResponse,
VaultResponse,
@@ -360,6 +361,26 @@ export const importAgentTrace = (projectId: string, agentId: string, body: Trace
// Usage statistics ----------------------------------------------------------------------
/**
* One page of the cost center's error table (newest first). The dashboard response already
* carries the first page; this is for paging back to earlier ones without refetching the
* whole aggregate. Takes the dashboard's date/agent filter only — the model filter never
* applied to errors.
*/
export const getUsageErrors = (
projectId: string,
params: { offset: number; limit: number; from?: string; to?: string; agentId?: string },
) =>
apiFetch<UsageErrorsPage>(`/api/projects/${encodeURIComponent(projectId)}/usage/errors`, {
query: {
offset: String(params.offset),
limit: String(params.limit),
from: params.from,
to: params.to,
agentId: params.agentId,
},
});
export const getUsage = (
projectId: string,
params: {