add input_guards and update prompt guards section

This commit is contained in:
Adil Hafeez 2025-12-23 15:17:55 -08:00
parent bbadd61de0
commit 0533987a2f
No known key found for this signature in database
GPG key ID: 9B18EF7691369645
11 changed files with 321 additions and 71 deletions

View file

@ -61,6 +61,7 @@ pub async fn agent_chat(
body,
}) = &err
{
warn!(
"Client error from agent '{}' (HTTP {}): {}",
agent, status, body
@ -77,7 +78,7 @@ pub async fn agent_chat(
let json_string = error_json.to_string();
let mut response = Response::new(ResponseHandler::create_full_body(json_string));
*response.status_mut() = hyper::StatusCode::from_u16(*status)
.unwrap_or(hyper::StatusCode::INTERNAL_SERVER_ERROR);
.unwrap_or(hyper::StatusCode::BAD_REQUEST);
response.headers_mut().insert(
hyper::header::CONTENT_TYPE,
"application/json".parse().unwrap(),

View file

@ -4,7 +4,7 @@ use std::collections::HashMap;
pub const JSON_RPC_VERSION: &str = "2.0";
pub const TOOL_CALL_METHOD : &str = "tools/call";
pub const MCP_INITIALIZE: &str = "initialize";
pub const MCP_INITIALIZE_NOTIFICATION: &str = "initialize/notification";
pub const MCP_INITIALIZE_NOTIFICATION: &str = "notifications/initialized";
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]

View file

@ -551,7 +551,7 @@ impl PipelineProcessor {
return Err(PipelineError::ClientError {
agent: agent.id.clone(),
status: http_status.as_u16(),
status: hyper::StatusCode::BAD_REQUEST.as_u16(),
body: error_message,
});
}