Skip to main content

codetether_rlm/context_trace/
event.rs

1use serde::{Deserialize, Serialize};
2
3/// A context event logged during RLM iteration.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub enum ContextEvent {
6    /// System prompt with context summary.
7    SystemPrompt { content: String, tokens: usize },
8    /// Result from a grep operation.
9    GrepResult {
10        pattern: String,
11        matches: usize,
12        tokens: usize,
13    },
14    /// Result from a sub-LLM query.
15    LlmQueryResult {
16        query: String,
17        response_preview: String,
18        tokens: usize,
19    },
20    /// Code generated by the assistant.
21    AssistantCode { code: String, tokens: usize },
22    /// Output from code execution.
23    ExecutionOutput { output: String, tokens: usize },
24    /// Final answer.
25    Final { answer: String, tokens: usize },
26    /// Tool call.
27    ToolCall {
28        name: String,
29        arguments_preview: String,
30        tokens: usize,
31    },
32    /// Tool result.
33    ToolResult {
34        tool_call_id: String,
35        result_preview: String,
36        tokens: usize,
37    },
38}