diff options
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 39c63a3..e0e1efa 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -137,6 +137,7 @@ pub struct Config { pub serve_addr: Option<String>, pub user_agent: Option<String>, + pub append_command_to_history_file: bool, pub clients: Vec<ClientConfig>, @@ -206,6 +207,7 @@ impl Default for Config { serve_addr: None, user_agent: None, + append_command_to_history_file: true, clients: vec![], @@ -1950,7 +1952,7 @@ impl Config { if output.is_empty() || !self.save { return Ok(()); } - let timestamp = now(); + let now = now(); let summary = input.summary(); let raw_input = input.raw(); let scope = if self.agent.is_none() { @@ -1983,7 +1985,7 @@ impl Config { None => String::new(), }; let output = format!( - "# CHAT: {summary} [{timestamp}]{scope}\n{raw_input}\n--------\n{tool_calls}{output}\n--------\n\n", + "# CHAT: {summary} [{now}]{scope}\n{raw_input}\n--------\n{tool_calls}{output}\n--------\n\n", ); file.write_all(output.as_bytes()) .with_context(|| "Failed to save message") @@ -2225,6 +2227,9 @@ impl Config { if let Some(v) = read_env_value::<String>(&get_env_name("user_agent")) { self.user_agent = v; } + if let Some(Some(v)) = read_env_bool(&get_env_name("append_command_to_history_file")) { + self.append_command_to_history_file = v; + } } fn load_functions(&mut self) -> Result<()> { |
