pub struct LoopConfigSnapshot {
pub model: String,
pub provider: String,
pub config_id: Option<String>,
pub name: Option<String>,
pub api: Option<ApiProtocol>,
pub base_url: Option<String>,
pub reasoning: Option<bool>,
pub context_window: Option<u32>,
pub max_tokens: Option<u32>,
pub thinking_level: Option<ThinkingLevel>,
pub temperature: Option<f32>,
}Expand description
A lightweight, serialisable snapshot of the model that ran a loop.
§Why not store the full AgentLoopConfig?
AgentLoopConfig contains API keys (in ModelConfig.api_key) and
non-serialisable hook closures (BeforeTurnFn, AfterTurnFn, etc.).
Storing the full config would require stripping secrets and skipping
closures, yielding little extra value.
LoopConfigSnapshot captures just enough to:
- Identify which model/provider produced the messages (cost attribution, analysis).
- Support replay by telling the caller which config to reconstruct.
- Distinguish branches in evaluational parallelism (e.g. “haiku vs. opus”).
- Track per-loop config (thinking_level, temperature) for debugging.
Populated from AgentStart.config_snapshot (preferred) or extracted from
the first Message::Assistant seen in the loop (fallback for older sessions).
New fields (added after the initial struct) are Option with
#[serde(default, skip_serializing_if = "Option::is_none")] for backward
compatibility with existing serialized sessions.
Fields§
§model: StringThe model id string (e.g. "claude-opus-4-6", "gpt-4o").
provider: StringProvider name (e.g. "anthropic", "openai").
config_id: Option<String>The stable config identity from AgentLoopConfig.config_id (if set).
Matches the config_segment component embedded in the loop_id format
{session_id}.{config_segment}.{N}. Useful to correlate a LoopRecord
back to its named configuration.
name: Option<String>Human-friendly model name (e.g. "Claude Sonnet 4", "GPT-4o").
api: Option<ApiProtocol>Which API protocol was used.
base_url: Option<String>Base URL for API requests (useful for debugging which endpoint was hit).
reasoning: Option<bool>Whether this model supports reasoning/thinking.
context_window: Option<u32>Context window size in tokens.
max_tokens: Option<u32>Default max output tokens.
thinking_level: Option<ThinkingLevel>Thinking/reasoning level used for this loop.
temperature: Option<f32>Sampling temperature used for this loop.
Trait Implementations§
Source§impl Clone for LoopConfigSnapshot
impl Clone for LoopConfigSnapshot
Source§fn clone(&self) -> LoopConfigSnapshot
fn clone(&self) -> LoopConfigSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more