Fix compilation error: match on RuntimeStatus enum variants
- Changed from .as_str() to direct enum matching
- Matches: Loading, Error, Starting, Stopping variants
- validation_score remains 100
Result: {"status":"keep","validation_score":100,"compilation":"passed"}
This commit is contained in:
1 parent
77c57c3d45
commit
e529a05bd0
5 files changed
+63
-27
No files matched your search
@@ -556,15 +556,15 @@ async fn start_forgeagent_session_command(
|
||||
}
|
||||
|
||||
if !snapshot.ready {
|
||||
let error_message = match snapshot.status.as_str() {
|
||||
"loading" => "O modelo está carregando. Aguarde antes de enviar mensagens.".to_string(),
|
||||
"error" => {
|
||||
let error_message = match snapshot.status {
|
||||
runtime::types::RuntimeStatus::Loading => "O modelo está carregando. Aguarde antes de enviar mensagens.".to_string(),
|
||||
runtime::types::RuntimeStatus::Error => {
|
||||
snapshot.last_error
|
||||
.map(|e| format!("Erro no runtime: {}", e.message))
|
||||
.unwrap_or_else(|| "O runtime encontrou um erro. Verifique os logs.".to_string())
|
||||
},
|
||||
"starting" => "O runtime está iniciando. Aguarde...".to_string(),
|
||||
"stopping" => "O runtime está parando. Aguarde finalizar.".to_string(),
|
||||
runtime::types::RuntimeStatus::Starting => "O runtime está iniciando. Aguarde...".to_string(),
|
||||
runtime::types::RuntimeStatus::Stopping => "O runtime está parando. Aguarde finalizar.".to_string(),
|
||||
_ => "O runtime não está pronto. Tente reiniciar.".to_string(),
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user