Fix Local Agent Execution And Auth Checks
- Gate server requests on available credentials - Run local child agents directly without a parent run ID - Include command IDs in Bedrock context and recognize transfer tools
This commit is contained in:
@@ -8066,8 +8066,7 @@ impl View for PaneGroup {
|
||||
}
|
||||
}
|
||||
// Render agent-assisted environment modal at tab level when open.
|
||||
if let Some(_pane_id) = self.pane_with_open_agent_assisted_environment_modal {
|
||||
}
|
||||
if let Some(_pane_id) = self.pane_with_open_agent_assisted_environment_modal {}
|
||||
|
||||
stack.finish()
|
||||
}
|
||||
|
||||
@@ -214,9 +214,7 @@ impl PaneId {
|
||||
}
|
||||
|
||||
/// Creates a [`PaneId`] from a [`ViewContext<PaneView<SettingsView>>`] (environment management stub)
|
||||
pub fn from_environment_management_pane_ctx(
|
||||
ctx: &ViewContext<PaneView<SettingsView>>,
|
||||
) -> Self {
|
||||
pub fn from_environment_management_pane_ctx(ctx: &ViewContext<PaneView<SettingsView>>) -> Self {
|
||||
Self::new_from_ctx(IPaneType::EnvironmentManagement, ctx)
|
||||
}
|
||||
|
||||
|
||||
@@ -1647,6 +1647,11 @@ fn launch_local_no_harness_child(
|
||||
model_id: Option<String>,
|
||||
ctx: &mut ViewContext<PaneGroup>,
|
||||
) {
|
||||
if request.parent_run_id.is_none() {
|
||||
launch_direct_provider_child(group, parent_pane_id, request, model_id, ctx);
|
||||
return;
|
||||
}
|
||||
|
||||
let ai_client = ServerApiProvider::handle(ctx).as_ref(ctx).get_ai_client();
|
||||
let request_id = request.id;
|
||||
let agent_name = normalize_orchestrator_agent_name(&request.name);
|
||||
@@ -1776,6 +1781,78 @@ fn launch_local_no_harness_child(
|
||||
);
|
||||
}
|
||||
|
||||
/// Launches a child conversation entirely inside Galaxy for direct Bedrock
|
||||
/// and OpenAI-compatible providers. These parents have no Warp server run id,
|
||||
/// so creating an Oz task would either fail or produce an orphan. The
|
||||
/// StartAgentExecutor links this hidden conversation to the pending tool call
|
||||
/// and returns its output after the child reaches Success.
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
fn launch_direct_provider_child(
|
||||
group: &mut PaneGroup,
|
||||
parent_pane_id: PaneId,
|
||||
request: StartAgentRequest,
|
||||
model_id: Option<String>,
|
||||
ctx: &mut ViewContext<PaneGroup>,
|
||||
) {
|
||||
let request_id = request.id;
|
||||
let request_name = normalize_orchestrator_agent_name(&request.name).unwrap_or_default();
|
||||
let parent_conversation_id = request.parent_conversation_id;
|
||||
let prompt = request.prompt;
|
||||
|
||||
let Some(HiddenChildAgentConversation {
|
||||
terminal_view,
|
||||
terminal_view_id,
|
||||
conversation_id,
|
||||
}) = create_hidden_child_agent_conversation(
|
||||
group,
|
||||
HiddenChildAgentConversationRequest {
|
||||
parent_pane_id,
|
||||
name: request_name.clone(),
|
||||
parent_conversation_id,
|
||||
orchestration_harness: None,
|
||||
env_vars: HashMap::new(),
|
||||
task_context: None,
|
||||
is_shared_session_creator: IsSharedSessionCreator::No,
|
||||
},
|
||||
ctx,
|
||||
)
|
||||
else {
|
||||
let _ = create_error_child_agent_conversation(
|
||||
group,
|
||||
ErrorChildAgentConversationRequest {
|
||||
parent_pane_id,
|
||||
name: request_name,
|
||||
parent_conversation_id,
|
||||
request_id: Some(request_id),
|
||||
orchestration_harness: None,
|
||||
error_message: "Failed to create a hidden pane for the local child agent."
|
||||
.to_string(),
|
||||
},
|
||||
ctx,
|
||||
);
|
||||
return;
|
||||
};
|
||||
|
||||
apply_child_model_id_override(terminal_view_id, model_id.as_deref(), ctx);
|
||||
BlocklistAIHistoryModel::handle(ctx).update(ctx, |model, ctx| {
|
||||
model.record_new_conversation_request_complete(request_id, conversation_id, ctx);
|
||||
});
|
||||
|
||||
terminal_view.update(ctx, |terminal_view, ctx| {
|
||||
terminal_view
|
||||
.ai_controller()
|
||||
.update(ctx, |controller, ctx| {
|
||||
controller.send_agent_query_in_conversation(prompt, conversation_id, ctx);
|
||||
});
|
||||
terminal_view.enter_agent_view(
|
||||
None,
|
||||
Some(conversation_id),
|
||||
AgentViewEntryOrigin::ChildAgent,
|
||||
ctx,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/// Asynchronously prepares a local harness launch, then creates the
|
||||
/// hidden child pane and executes the launch command.
|
||||
#[cfg(not(target_family = "wasm"))]
|
||||
|
||||
Reference in New Issue
Block a user