fixup previous

This commit is contained in:
Chris Beck
2025-12-09 08:33:51 -07:00
parent 9d785d21b4
commit 19b8561b9b
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -56,16 +56,16 @@ pub struct ClaudeConfig {
pub struct CompactionConfig {
/// Path to file containing the compaction prompt.
#[conf(long, env)]
pub compaction_prompt_file: PathBuf,
pub prompt_file: PathBuf,
/// Model to use for compaction (typically a faster/cheaper model).
#[conf(long, env, default_value = "claude-sonnet-4-5-20250929")]
pub compaction_model: String,
pub model: String,
/// Maximum tokens for the compaction response.
#[conf(long, env, default_value = "2048")]
pub compaction_max_tokens: u32,
pub max_tokens: u32,
/// Trigger compaction when message buffer exceeds this many characters.
#[conf(long, env, default_value = "50000")]
pub compaction_trigger_chars: u32,
pub trigger_chars: u32,
}
/// Error type for Claude API operations.
+4 -4
View File
@@ -121,7 +121,7 @@ impl ClaudeWorker {
.collect::<Result<_, _>>()?;
let compaction_prompt = {
let path = &config.compaction.compaction_prompt_file;
let path = &config.compaction.prompt_file;
std::fs::read_to_string(path)
.map_err(|e| ClaudeError::SystemPromptRead(path.clone(), e))?
};
@@ -156,7 +156,7 @@ impl ClaudeWorker {
// Check if we need to trigger compaction
let buffer_chars = self.message_buffer_chars();
if buffer_chars > self.config.compaction.compaction_trigger_chars as usize {
if buffer_chars > self.config.compaction.trigger_chars as usize {
self.handle_compact().await;
}
@@ -259,8 +259,8 @@ impl ClaudeWorker {
}
let request_body = MessagesRequest {
model: &self.config.compaction.compaction_model,
max_tokens: self.config.compaction.compaction_max_tokens,
model: &self.config.compaction.model,
max_tokens: self.config.compaction.max_tokens,
system: &system,
messages: &self.messages,
tools: Vec::new(),