Skip to content

Commit 0de1451

Browse files
authored
fix(mcp): bug where refreshed credentials gets deleted (#2880)
1 parent 5b379eb commit 0de1451

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/chat-cli/src/mcp_client/client.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,9 @@ impl McpClientService {
361361
info!("Retry for http transport failed {e}. Possible reauth needed");
362362
// This could be because the refresh token is expired, in which
363363
// case we would need to have user go through the auth flow
364-
// again
364+
// again. We do this by deleting the cred
365+
// and discarding the client to trigger a full auth flow
366+
tokio::fs::remove_file(&auth_client.cred_full_path).await?;
365367
let new_transport =
366368
get_http_transport(&os_clone, &url, None, &*messenger_dup).await?;
367369

0 commit comments

Comments
 (0)