Skip to main content

Module request_trace

Module request_trace 

Source
Expand description

Provider request traces for offline evals (Rust-only feature; the idea is reflection-oss/mirror’s *.model-calls.jsonl, mirror-agent/src/http/traced_model.rs): with ULTRON_REQUEST_TRACE=<file> every conversation request (the root lane’s and each subagent conversation’s) appends one JSON line to <file> once its response arrived, holding only the DELTA from the previous request of the same lane:

  • kind: "start": the lane’s first request, all its messages;
  • kind: "append": the previous request’s messages are a prefix of this one’s; messages are the ones added after base of them;
  • kind: "reset": the prefix changed (a prompt-cache miss): reason (model, system, tools, compaction, branch_summary, context_edit for ctx.forget and other context edits, truncated, prefix_changed), at (the first message that differs) and all the messages.

Plus session, lane, request (per lane, from 1), model (provider/id), usage and stopReason of the response, and timestamp. check (ultron trace check <file>) reports every reset with its reason. The file is opened for appending (several sessions may share one) with mode 0600; a failed write disables the trace without touching the request.

Structs§

Report
What check found in a trace.
RequestTrace
Reset
One reset check found.

Enums§

Delta
How a request relates to the previous request of its lane.

Constants§

TRACE_ENV

Functions§

check
Read a trace: every request line counted, every reset listed. Malformed lines are an error naming the line.
delta
The delta of current (on model) from previous (the lane’s last request and its model).