feat(gateway): record how long each chat tool call took and show it per row

This commit is contained in:
sam committed 2026-10-24 20:44:40 +11:00
1 parent a3eeeca672
commit e100b01c52
9 files changed
+149 -109

No files matched your search

+7
View File
@@ -51,6 +51,11 @@ const outcome = computed(
"",
);
const running = computed(() => !outcome.value && !failed.value && !!props.streaming);
const duration = computed(() => {
const ms = props.tool.duration_ms;
if (!ms) return "";
return ms < 1000 ? `${ms}ms` : `${(ms / 1000).toFixed(ms < 10000 ? 1 : 0)}s`;
});
const argument = computed(() => parameters.value.split("\n", 1)[0]);
const detail = computed(() =>
[parameters.value && `> ${parameters.value}`, outcome.value].filter(Boolean).join("\n\n"),
@@ -69,6 +74,7 @@ const detail = computed(() =>
</TraceIcon>
<span class="font-mono text-foreground">{{ name }}</span>
<TraceTitle class="font-mono text-xs">{{ argument }}</TraceTitle>
<span v-if="duration" class="shrink-0 text-xs tabular-nums">{{ duration }}</span>
</TraceLine>
</TraceCollapsibleTrigger>
<TraceCollapsibleContent>
@@ -85,5 +91,6 @@ const detail = computed(() =>
</TraceIcon>
<span class="font-mono text-foreground">{{ name }}</span>
<TraceTitle class="font-mono text-xs">{{ argument }}</TraceTitle>
<span v-if="duration" class="shrink-0 text-xs tabular-nums">{{ duration }}</span>
</TraceLine>
</template>
+1
View File
@@ -46,6 +46,7 @@ export interface ChatToolCall {
summary?: string;
text?: string;
failed?: boolean;
duration_ms?: number;
/** A dashboard_navigate result: the page to route to, instead of a tool line. */
path?: string;
label?: string;