Skip to content

Commit 160eeb6

Browse files
committed
Fix first transcript being invalid
1 parent 76baea6 commit 160eeb6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

crates/but-claude/src/bridge.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ use std::{
4141
sync::Arc,
4242
};
4343
use tokio::{
44+
fs,
4445
process::{Child, Command},
4546
sync::{
4647
Mutex,
@@ -399,6 +400,11 @@ async fn spawn_command(
399400
if let Some(current_id) = current_id {
400401
command.args(["--resume", &format!("{current_id}")]);
401402
} else {
403+
// Ensure that there isn't an existant invalid transcript
404+
let path = Transcript::get_transcript_path(&project_path, session.id)?;
405+
if fs::try_exists(&path).await? {
406+
fs::remove_file(&path).await?;
407+
}
402408
command.args(["--session-id", &format!("{}", session.id)]);
403409
}
404410

0 commit comments

Comments
 (0)