pub struct ModelChangeRecord {
pub turn: usize,
pub from_model: String,
pub to_model: String,
pub reasoning_filtered: bool,
pub reasoning_artifacts_filtered: usize,
pub timestamp_ms: i64,
}Expand description
One mid-session model switch, as Agent::switch_model records it when
Config::model_switch_allow_switch is on (see that field’s doc comment
for the exact gate — with the knob off, switch_model never creates one
of these at all, matching Agent::set_model’s pre-existing,
record-free mechanics byte-for-byte).
Fields§
§turn: usize0-based index of the model round-trip THIS switch takes effect
before (i.e. Agent::turn_index at the moment of the switch) — the
same per-turn addressing crate::usage_log::UsageRecord::turn
uses, so the two logs can be correlated.
from_model: StringThe model id in effect immediately before this switch.
to_model: StringThe model id in effect immediately after this switch.
reasoning_filtered: boolWhether reduce::rehydrate::filter_reasoning_artifacts ran over the
live history as part of this switch (dep 8) — always true when
this record exists at all (a record is only ever created under
allow_switch = true, which is the same gate that runs the filter),
but recorded explicitly rather than implied, so a reader of the
persisted log alone (without also knowing the config that produced
it) can see the safety guarantee held for this specific switch.
reasoning_artifacts_filtered: usizeCount of ChatMessages the reasoning-artifact filter actually
touched (stripped a metadata key from, or removed a content_parts
reasoning block from) during this switch. 0 is a legitimate,
common value (nothing to filter yet), not an error signal.
timestamp_ms: i64Unix-ms wall-clock time the switch happened.
Implementations§
Trait Implementations§
Source§impl Clone for ModelChangeRecord
impl Clone for ModelChangeRecord
Source§fn clone(&self) -> ModelChangeRecord
fn clone(&self) -> ModelChangeRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more