Skip to content

Commit d54213e

Browse files
wip
1 parent 9d3d4d8 commit d54213e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

codex-rs/core/src/codex.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1217,7 +1217,12 @@ impl Session {
12171217

12181218
pub async fn interrupt_task(self: &Arc<Self>) {
12191219
info!("interrupt received: abort current task, if any");
1220-
self.abort_all_tasks(TurnAbortReason::Interrupted).await;
1220+
let has_active_turn = { self.active_turn.lock().await.is_some() };
1221+
if has_active_turn {
1222+
self.abort_all_tasks(TurnAbortReason::Interrupted).await;
1223+
} else {
1224+
self.cancel_mcp_startup().await;
1225+
}
12211226
}
12221227

12231228
pub(crate) fn notifier(&self) -> &UserNotifier {

codex-rs/core/src/mcp_connection_manager.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ fn validate_mcp_server_name(server_name: &str) -> Result<()> {
801801
let re = regex_lite::Regex::new(r"^[a-zA-Z0-9_-]+$")?;
802802
if !re.is_match(server_name) {
803803
return Err(anyhow!(
804-
"invalid server name '{server_name}': must match pattern {pattern}",
804+
"Invalid MCP server name '{server_name}': must match pattern {pattern}",
805805
pattern = re.as_str()
806806
));
807807
}

0 commit comments

Comments
 (0)