Skip to content
Draft
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
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ version-compare = "0.1"
vte = { git = "https://github.com/warpdotdev/vte.git", rev = "4b399c87b63ba88f45709edaa6383fc519f6c900", default-features = false }
walkdir = "2"
warp-workflows = { git = "https://github.com/warpdotdev/workflows", rev = "793a98ddda6ef19682aed66364faebd2829f0e01" }
warp_multi_agent_api = { git = "https://github.com/warpdotdev/warp-proto-apis.git", rev = "7b638a3bce15b6159116c25caa1dda62cf004b0e" }
warp_multi_agent_api = { git = "https://github.com/warpdotdev/warp-proto-apis.git", rev = "94d0881ca1cad6323c50b28d33bbb8526d434a54" }
wasm-bindgen = "0.2.89"
wasm-bindgen-futures = "0.4.42"
web-sys = { version = "0.3.69", features = [
Expand Down
1 change: 1 addition & 0 deletions app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ windows = { workspace = true, features = [
"Win32_System_Diagnostics_Debug",
"Win32_System_Environment",
"Win32_System_IO",
"Win32_System_JobObjects",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation",
"Win32_System_Threading",
Expand Down
3 changes: 3 additions & 0 deletions app/src/ai/agent/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub struct RequestParams {
pub warp_drive_context_enabled: bool,
pub context_window_limit: Option<u32>,
pub mcp_context: Option<MCPContext>,
pub oz_hook_context: Option<warp_multi_agent_api::OzHookContext>,
pub planning_enabled: bool,
should_redact_secrets: bool,

Expand Down Expand Up @@ -210,6 +211,7 @@ impl RequestParams {
warp_drive_context_enabled: false,
context_window_limit: None,
mcp_context: None,
oz_hook_context: None,
planning_enabled: false,
should_redact_secrets: false,
member_byo_credentials_allowed: false,
Expand Down Expand Up @@ -430,6 +432,7 @@ impl RequestParams {
supported_tools_override: request_input.supported_tools_override.clone(),
parent_agent_id: None,
agent_name: None,
oz_hook_context: None,
}
}
}
3 changes: 3 additions & 0 deletions app/src/ai/agent/api/convert_to.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ fn convert_input_to_user_input(
))
}
AIAgentInput::ActionResult { result, .. } => result.try_into(),
AIAgentInput::OzHookResult(result) => {
Ok(api::request::input::user_inputs::user_input::Input::OzHookResult(result))
}
AIAgentInput::MessagesReceivedFromAgents { messages } => Ok(
api::request::input::user_inputs::user_input::Input::MessagesReceivedFromAgents(
api::request::input::user_inputs::MessagesReceivedFromAgents {
Expand Down
2 changes: 2 additions & 0 deletions app/src/ai/agent/api/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ pub async fn generate_multi_agent_output(
supports_stored_screenshots: FeatureFlag::StoredScreenshots.is_enabled(),
custom_model_providers: params.custom_model_providers,
custom_model_routers: params.custom_model_routers,
supports_oz_lifecycle_hooks: params.oz_hook_context.is_some(),
}),
metadata: Some(api::request::Metadata {
logging: logging_metadata,
Expand Down Expand Up @@ -140,6 +141,7 @@ pub async fn generate_multi_agent_output(
.existing_suggestions
.map(|suggestions| suggestions.into()),
mcp_context: params.mcp_context.map(Into::into),
oz_hook_context: params.oz_hook_context,
};

let response_stream = warp_multi_agent_client::generate_multi_agent_output(
Expand Down
1 change: 1 addition & 0 deletions app/src/ai/agent/api/impl_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ fn request_params_with_ask_user_question_enabled(ask_user_question_enabled: bool
supported_tools_override: None,
parent_agent_id: None,
agent_name: None,
oz_hook_context: None,
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/ai/agent/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,7 +2121,7 @@ impl AIConversation {
for (task_id, inputs) in input_messages.into_iter() {
let should_hide = inputs
.iter()
.any(|input| input.is_passive_suggestion_trigger());
.any(|input| input.is_passive_suggestion_trigger() || input.is_oz_hook_result());

let new_exchange = AIAgentExchange {
id: AIAgentExchangeId::new(),
Expand Down Expand Up @@ -2829,6 +2829,7 @@ impl AIConversation {
log::debug!("Rollback transaction.");
self.rollback_transaction(response_stream_id);
}
Action::RunOzHook(_) => {}
Action::CreateTask(CreateTask { task: Some(task) }) => {
let task_id = TaskId::new(task.id.clone());
// Save an empty task to the transaction
Expand Down
15 changes: 12 additions & 3 deletions app/src/ai/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2989,6 +2989,7 @@ pub enum AIAgentInput {
config: OrchestrationConfig,
status: OrchestrationConfigStatus,
},
OzHookResult(warp_multi_agent_api::OzHookResult),
}

/// Data for a single message received by an agent from another agent.
Expand Down Expand Up @@ -3082,6 +3083,7 @@ impl Display for AIAgentInput {
}
Self::PassiveSuggestionResult { .. } => write!(f, "PassiveSuggestionResult"),
Self::OrchestrationConfigUpdate { .. } => write!(f, "OrchestrationConfigUpdate"),
Self::OzHookResult(_) => write!(f, "OzHookResult"),
}
}
}
Expand Down Expand Up @@ -3143,7 +3145,8 @@ impl AIAgentInput {
| Self::MessagesReceivedFromAgents { .. }
| Self::EventsFromAgents { .. }
| Self::PassiveSuggestionResult { .. }
| Self::OrchestrationConfigUpdate { .. } => None,
| Self::OrchestrationConfigUpdate { .. }
| Self::OzHookResult(_) => None,
}
}

Expand Down Expand Up @@ -3211,6 +3214,10 @@ impl AIAgentInput {
matches!(self, AIAgentInput::UserQuery { .. })
}

pub fn is_oz_hook_result(&self) -> bool {
matches!(self, AIAgentInput::OzHookResult(_))
}

pub fn prompt_suggestion_result(&self) -> Option<&String> {
if let Some(AIAgentActionResult {
result: AIAgentActionResultType::SuggestPrompt(SuggestPromptResult::Accepted { query }),
Expand Down Expand Up @@ -3248,7 +3255,8 @@ impl AIAgentInput {
Self::SummarizeConversation { context, .. } => Some(context),
Self::MessagesReceivedFromAgents { .. }
| Self::EventsFromAgents { .. }
| Self::OrchestrationConfigUpdate { .. } => None,
| Self::OrchestrationConfigUpdate { .. }
| Self::OzHookResult(_) => None,
}
}

Expand Down Expand Up @@ -3279,7 +3287,8 @@ impl AIAgentInput {
| Self::MessagesReceivedFromAgents { .. }
| Self::EventsFromAgents { .. }
| Self::PassiveSuggestionResult { .. }
| Self::OrchestrationConfigUpdate { .. } => None,
| Self::OrchestrationConfigUpdate { .. }
| Self::OzHookResult(_) => None,
}
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/ai/agent/redaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ pub(crate) fn redact_inputs(inputs: &mut [AIAgentInput]) {
// No user-provided text to redact in inter-agent relay inputs.
AIAgentInput::MessagesReceivedFromAgents { .. }
| AIAgentInput::EventsFromAgents { .. }
| AIAgentInput::OrchestrationConfigUpdate { .. } => {}
| AIAgentInput::OrchestrationConfigUpdate { .. }
| AIAgentInput::OzHookResult(_) => {}
AIAgentInput::ActionResult { result, context } => {
redact_context(Arc::make_mut(context));
match &mut result.result {
Expand Down
Loading
Loading