Recipe slash command parsing (#6173)

This commit is contained in:
David Katz
2025-12-19 13:15:56 -05:00
committed by GitHub
parent 41588e8795
commit bf95995e1d
2 changed files with 82 additions and 20 deletions
+11 -3
View File
@@ -797,7 +797,15 @@ impl Agent {
.await;
match command_result {
Some(response) if response.role == rmcp::model::Role::Assistant => {
Err(e) => {
let error_message = Message::assistant()
.with_text(e.to_string())
.with_visibility(true, false);
return Ok(Box::pin(stream::once(async move {
Ok(AgentEvent::Message(error_message))
})));
}
Ok(Some(response)) if response.role == rmcp::model::Role::Assistant => {
SessionManager::add_message(
&session_config.id,
&user_message.clone().with_visibility(true, false),
@@ -830,7 +838,7 @@ impl Agent {
}
}));
}
Some(resolved_message) => {
Ok(Some(resolved_message)) => {
SessionManager::add_message(
&session_config.id,
&user_message.clone().with_visibility(true, false),
@@ -842,7 +850,7 @@ impl Agent {
)
.await?;
}
None => {
Ok(None) => {
SessionManager::add_message(&session_config.id, &user_message).await?;
}
}