diff --git a/modules/runs/trail.go b/modules/runs/trail.go
index 7880576e3..d3977b880 100644
--- a/modules/runs/trail.go
+++ b/modules/runs/trail.go
@@ -101,11 +101,16 @@ type TrailEntry struct {
Reasoning string `json:"reasoning,omitzero"`
ToolCalls []ToolCallView `json:"tool_calls,omitzero"`
Usage *chat.Usage `json:"usage,omitzero"`
- Input string `json:"input,omitzero"`
- Output string `json:"output,omitzero"`
- Value jsontext.Value `json:"value,omitzero"`
- Error string `json:"error,omitzero"`
- Unknown bool `json:"unknown,omitzero"`
+ // Request is the model request exactly as it was sent: the messages, the
+ // tools offered and the sampling settings.
+ Request jsontext.Value `json:"request,omitzero"`
+ // FinishReason is the wire finish reason of a model call.
+ FinishReason string `json:"finish_reason,omitzero"`
+ Input string `json:"input,omitzero"`
+ Output string `json:"output,omitzero"`
+ Value jsontext.Value `json:"value,omitzero"`
+ Error string `json:"error,omitzero"`
+ Unknown bool `json:"unknown,omitzero"`
}
// ToolCallView is a tool call a model asked for.
@@ -331,6 +336,7 @@ func entry(s store.Recorded) TrailEntry {
if je.Kind == agentloop.EntryCompact {
e.Kind = "compaction"
}
+ e.Request, e.FinishReason = je.Request, je.FinishReason
usage := je.Usage
e.Usage = &usage
if je.Message != nil {
diff --git a/ui/src/archie/ActionTrailView.vue b/ui/src/archie/ActionTrailView.vue
index 520d736be..52558e020 100644
--- a/ui/src/archie/ActionTrailView.vue
+++ b/ui/src/archie/ActionTrailView.vue
@@ -52,6 +52,26 @@ const ceilingTone = (v: Verdict): Tone => (v.failed ? "warn" : "secondary");
{{ json(decision.action.input) }}
+
+ Connector calls
+
+
+ {{ c.connector }} {{ c.method }}
+ Request
+
+ {{ json(c.request) }}
+
+
+ Response
+
+ {{ json(c.response) }}
+
+
+ {{ c.error }}
+
+
+
+
-
diff --git a/ui/src/archie/ComposerView.vue b/ui/src/archie/ComposerView.vue
index 33d25a45c..c19ca5028 100644
--- a/ui/src/archie/ComposerView.vue
+++ b/ui/src/archie/ComposerView.vue
@@ -3,6 +3,7 @@ import { computed, onBeforeUnmount, onMounted, ref } from "vue";
import { RouterLink } from "vue-router";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
+import { Badge } from "@/components/ui/badge";
import { ReadError } from "@/components/ui/read-error";
import { Button } from "@/components/ui/button";
import { Section } from "@/components/ui/section";
@@ -109,6 +110,20 @@ onBeforeUnmount(() => controller.abort());
{{ m.body }}
+
+ Delivery attempts
+
+ -
+ {{ a.channel }}
+ Attempt {{ a.attempt }}
+ {{ a.ok ? "Delivered" : "Failed" }}
+ {{ a.duration_ms }} ms
+
+ {{ a.response }}
+ {{ a.error }}
+
+
+
diff --git a/ui/src/archie/RunView.vue b/ui/src/archie/RunView.vue
index 972e188ca..d980b6cbd 100644
--- a/ui/src/archie/RunView.vue
+++ b/ui/src/archie/RunView.vue
@@ -19,7 +19,7 @@ import {
TraceTitle,
} from "@/components/ui/trace";
import ActionTrailView from "./ActionTrailView.vue";
-import { runTrail, type Trail, type TrailEntry, Unauthorized } from "./api";
+import { runTrail, type Trail, type TrailEntry, type Usage, Unauthorized } from "./api";
import { runTone } from "./state";
/** A run's decision trail: what started it, every step in order, and how it ended. */
@@ -78,6 +78,12 @@ function title(e: TrailEntry): string {
}
const json = (v: unknown) => JSON.stringify(v, null, 2);
+
+const usageRows = (u: Usage) => [
+ { label: "Prompt tokens", value: u.prompt_tokens.toLocaleString() },
+ { label: "Completion tokens", value: u.completion_tokens.toLocaleString() },
+ { label: "Total tokens", value: u.total_tokens.toLocaleString() },
+];
@@ -125,21 +131,46 @@ const json = (v: unknown) => JSON.stringify(v, null, 2);
-
{{ e.reasoning }}
-
{{ e.text }}
-
- {{ c.name }} {{ c.input }}
-
-
- {{ e.input }}
-
-
- {{ e.output }}
-
+
+ Request
+
+ {{ json(e.request) }}
+
+
+
+ Response
+
+
{{ e.reasoning }}
+
{{ e.text }}
+
+ {{ c.name }} {{ c.input }}
+
+
+ Finish reason {{ e.finish_reason }}
+
+
+
{{ e.error }}
+
+
+
+
+ Request
+
+ {{ e.input }}
+
+
+
+ Response
+ {{ e.error }}
+
+ {{ e.output }}
+
+
+
{{ json(e.value) }}
-
{{ e.error }}
+
{{ e.error }}
diff --git a/ui/src/archie/api.ts b/ui/src/archie/api.ts
index 95092c165..35965ddaa 100644
--- a/ui/src/archie/api.ts
+++ b/ui/src/archie/api.ts
@@ -32,6 +32,18 @@ export interface Message {
body: string;
expires_at?: string;
created_at: string;
+ /** Delivery attempts of the connector rows carrying this message, one per channel. */
+ attempts?: MessageAttempt[];
+}
+
+export interface MessageAttempt {
+ channel: string;
+ attempt: number;
+ at: string;
+ ok: boolean;
+ response?: string;
+ error?: string;
+ duration_ms: number;
}
export interface Usage {
@@ -72,6 +84,9 @@ export interface TrailEntry {
reasoning?: string;
tool_calls?: { name: string; input: string }[];
usage?: Usage;
+ /** The model request exactly as it was sent: messages, tools offered and sampling settings. */
+ request?: unknown;
+ finish_reason?: string;
input?: string;
output?: string;
value?: unknown;
@@ -103,6 +118,14 @@ export interface Verdict {
failed?: string;
}
+export interface ConnectorCall {
+ connector: string;
+ method: string;
+ request: unknown;
+ response?: unknown;
+ error?: string;
+}
+
export interface Decision {
id: string;
key: string;
@@ -121,6 +144,8 @@ export interface Decision {
change_request_rule?: string;
reason?: string;
at: string;
+ /** The connector calls behind the decision: resolve, target facts and invoke. */
+ calls?: ConnectorCall[];
}
export interface ApprovalRequest {