Skip to content

Commit 25645b1

Browse files
committed
revise the capture path
1 parent a97f3f8 commit 25645b1

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub struct CaptureManager {
3838
pub tag_to_index: HashMap<String, usize>,
3939
pub num_turns: usize,
4040
pub num_tools_this_turn: usize,
41-
41+
// test
4242
pub last_user_message: Option<String>,
4343
pub user_message_lock: bool,
4444
}

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ mod conversation;
55
mod input_source;
66
mod message;
77
mod parse;
8-
use std::path::{
9-
MAIN_SEPARATOR,
10-
PathBuf,
11-
};
8+
use std::path::MAIN_SEPARATOR;
129
pub mod capture;
1310
mod line_tracker;
1411
mod parser;
@@ -149,7 +146,6 @@ use crate::cli::agent::Agents;
149146
use crate::cli::chat::capture::{
150147
CAPTURE_MESSAGE_MAX_LENGTH,
151148
CaptureManager,
152-
SHADOW_REPO_DIR,
153149
truncate_message,
154150
};
155151
use crate::cli::chat::cli::SlashCommand;
@@ -175,6 +171,7 @@ use crate::telemetry::{
175171
TelemetryResult,
176172
get_error_reason,
177173
};
174+
use crate::util::directories::get_shadow_repo_dir;
178175
use crate::util::{
179176
MCP_SERVER_TOOL_DELIMITER,
180177
directories,
@@ -1333,9 +1330,9 @@ impl ChatSession {
13331330
}
13341331

13351332
// Initialize checkpointing if possible
1336-
let path = PathBuf::from(SHADOW_REPO_DIR).join(self.conversation.conversation_id());
1333+
let path = get_shadow_repo_dir(os, self.conversation.conversation_id().to_string())?;
13371334
let start = std::time::Instant::now();
1338-
let capture_manager = match CaptureManager::auto_init(os, path).await {
1335+
let capture_manager = match CaptureManager::auto_init(os, &path).await {
13391336
Ok(manager) => {
13401337
execute!(
13411338
self.stderr,

crates/chat-cli/src/util/directories.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub enum DirectoryError {
4343
type Result<T, E = DirectoryError> = std::result::Result<T, E>;
4444

4545
const WORKSPACE_AGENT_DIR_RELATIVE: &str = ".amazonq/cli-agents";
46-
const GLOBAL_SHADOW_REPO_DIR: &str = ".aws/.amazonq/cli-captures";
46+
const GLOBAL_SHADOW_REPO_DIR: &str = ".aws/amazonq/cli-captures";
4747
const GLOBAL_AGENT_DIR_RELATIVE_TO_HOME: &str = ".aws/amazonq/cli-agents";
4848
const CLI_BASH_HISTORY_PATH: &str = ".aws/amazonq/.cli_bash_history";
4949

0 commit comments

Comments
 (0)