Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion crates/tower-cmd/src/mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,15 @@ impl TowerService {
Self::modify_towerfile(&request.common, |tf| {
let existing = tf.parameters.iter().find(|p| p.name == name)
.ok_or_else(|| format!("Parameter '{name}' not found"))?;
let target_name = request
.new_name
.clone()
.unwrap_or_else(|| existing.name.clone());
if target_name != name && tf.parameters.iter().any(|p| p.name == target_name) {
return Err(format!("Parameter '{}' already exists", target_name));
}
let param = Parameter {
name: request.new_name.unwrap_or_else(|| existing.name.clone()),
name: target_name,
description: request.description.unwrap_or_else(|| existing.description.clone()),
default: request.default.unwrap_or_else(|| existing.default.clone()),
hidden: request.hidden.unwrap_or(existing.hidden),
Expand Down
14 changes: 14 additions & 0 deletions crates/tower-cmd/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@ where
output::error(&format!("Your local run crashed with exit code: {}", code));
return Err(Error::AppCrashed);
}
Status::Failed {
error_code,
error_message,
} => {
output::error(&format!(
"Your local run failed due to a platform error (code: {}, message: {})",
error_code, error_message
));
return Err(Error::AppCrashed);
}
_ => {
debug!("Unexpected status after monitoring: {:?}", status_result);
output::error("An unexpected error occurred while monitoring your local run status!");
Expand Down Expand Up @@ -703,6 +713,10 @@ async fn monitor_cli_status(
debug!("Run crashed, stopping status monitoring");
return status;
}
Status::Failed { .. } => {
debug!("Run failed at platform layer, stopping status monitoring");
return status;
}
_ => {
debug!("Handle status: other, continuing to monitor");
sleep(Duration::from_millis(100)).await;
Expand Down
Loading