Skip to content

Commit 03da68b

Browse files
committed
fix: Fixes comments
1 parent f78b5cc commit 03da68b

3 files changed

Lines changed: 6 additions & 33 deletions

File tree

crates/chat-cli/src/cli/chat/conversation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ pub struct ConversationState {
150150
/// Tangent mode checkpoint - stores main conversation when in tangent mode
151151
#[serde(default, skip_serializing_if = "Option::is_none")]
152152
tangent_state: Option<ConversationCheckpoint>,
153-
/// Current continuation ID for billing tracking - generated per conversation turn
153+
/// Current continuation ID - generated per conversation turn
154154
#[serde(default, skip_serializing_if = "Option::is_none")]
155155
current_continuation_id: Option<String>,
156156
}
@@ -383,12 +383,12 @@ impl ConversationState {
383383
self.next_message = None;
384384
}
385385

386-
/// Returns the current continuation ID for billing tracking
386+
/// Returns the current continuation ID
387387
pub fn continuation_id(&self) -> Option<&str> {
388388
self.current_continuation_id.as_deref()
389389
}
390390

391-
/// Generate a new continuation ID for billing tracking
391+
/// Generate a new continuation ID
392392
fn generate_new_continuation_id(&mut self) {
393393
let new_continuation_id = uuid::Uuid::new_v4().to_string();
394394
self.current_continuation_id = Some(new_continuation_id);

crates/chat-cli/src/cli/chat/conversation/continuation_tests.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
// ABOUTME: Tests for continuation ID billing functionality
2-
// ABOUTME: Ensures continuation IDs are generated and propagated correctly for billing consistency
3-
1+
// ABOUTME: Ensures continuation IDs are generated and propagated correctly
42
#[cfg(test)]
53
mod tests {
64
use std::collections::HashMap;

crates/chat-cli/src/cli/chat/mod.rs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,7 +2129,7 @@ impl ChatSession {
21292129
user_input
21302130
};
21312131

2132-
// For tool approval responses (y/n/t), preserve continuation ID for billing consistency
2132+
// For tool approval responses (y/n/t), preserve continuation ID
21332133
let preserve_continuation_id = is_simple_tool_interaction(&input_trimmed);
21342134
self.conversation.abandon_tool_use_with_continuation_policy(
21352135
&self.tool_uses,
@@ -3700,7 +3700,7 @@ fn is_reject_response(input: &str) -> bool {
37003700
}
37013701

37023702
/// Check if input is any simple tool interaction response (y/Y/n/N/t/T)
3703-
/// These responses should preserve continuation ID for billing consistency
3703+
/// These responses should preserve continuation ID
37043704
fn is_simple_tool_interaction(input: &str) -> bool {
37053705
is_trust_response(input) || is_accept_response(input) || is_reject_response(input)
37063706
}
@@ -4455,28 +4455,3 @@ mod tests {
44554455
}
44564456
}
44574457
}
4458-
4459-
// Helper method to save the agent config to file
4460-
async fn save_agent_config(os: &mut Os, config: &Agent, agent_name: &str, is_global: bool) -> Result<(), ChatError> {
4461-
let config_dir = if is_global {
4462-
directories::chat_global_agent_path(os)
4463-
.map_err(|e| ChatError::Custom(format!("Could not find global agent directory: {}", e).into()))?
4464-
} else {
4465-
directories::chat_local_agent_dir(os)
4466-
.map_err(|e| ChatError::Custom(format!("Could not find local agent directory: {}", e).into()))?
4467-
};
4468-
4469-
tokio::fs::create_dir_all(&config_dir)
4470-
.await
4471-
.map_err(|e| ChatError::Custom(format!("Failed to create config directory: {}", e).into()))?;
4472-
4473-
let config_file = config_dir.join(format!("{}.json", agent_name));
4474-
let config_json = serde_json::to_string_pretty(config)
4475-
.map_err(|e| ChatError::Custom(format!("Failed to serialize agent config: {}", e).into()))?;
4476-
4477-
tokio::fs::write(&config_file, config_json)
4478-
.await
4479-
.map_err(|e| ChatError::Custom(format!("Failed to write agent config file: {}", e).into()))?;
4480-
4481-
Ok(())
4482-
}

0 commit comments

Comments
 (0)