Skip to content
Merged
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
8 changes: 7 additions & 1 deletion src/acp/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ impl AcpService {
}
messages.push(user_message);

let process_registry = std::sync::Arc::new(crate::tools::ProcessRegistry::new());
let prompt_registry = crate::tools::initialize_tool_registry_with_dynamic_config(
None,
tool_permissions(&session),
Expand All @@ -644,6 +645,7 @@ impl AcpService {
&session.config.merged_config.websearch,
&session.config.merged_config.mcp,
&session.cwd,
process_registry.clone(),
)
.await;
let is_git_repo =
Expand All @@ -669,6 +671,7 @@ impl AcpService {
let stream_sender = sender.clone();
let stream_session = session.clone();
let stream_tool_registry = prompt_registry;
let stream_process_registry = process_registry;
tokio::spawn(async move {
let result = crate::llm::client::stream_llm_with_cancellation(
stream_cancellation,
Expand All @@ -691,6 +694,7 @@ impl AcpService {
Some(stream_tool_registry),
messages,
sender,
stream_process_registry,
)
.await;
if let Err(error) = result {
Expand Down Expand Up @@ -1414,7 +1418,9 @@ fn replay_tool_result(

fn tool_kind(tool_name: &str) -> ToolKind {
match tool_name {
"bash" | "terminal_session" => ToolKind::Execute,
"bash" | "bash_output" | "bash_kill" | "bash_restart" | "terminal_session" => {
ToolKind::Execute
}
"webfetch" => ToolKind::Fetch,
"grep" | "glob" | "context" => ToolKind::Search,
"read" | "view_image" => ToolKind::Read,
Expand Down
2 changes: 2 additions & 0 deletions src/agent/subagent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub async fn run_subagent(
cancel_token: tokio_util::sync::CancellationToken,
permissions: crate::tools::ToolPermissions,
max_steps: Option<usize>,
process_registry: Option<std::sync::Arc<crate::tools::ProcessRegistry>>,
) -> Result<SubAgentRunResult, String> {
use crate::aisdk::core::{
chunk::ChunkType, response::StreamTextResponse, stop::StopReason, Message as AisdkMessage,
Expand Down Expand Up @@ -77,6 +78,7 @@ pub async fn run_subagent(
None,
session.supports_image_input,
cancel_token.clone(),
process_registry,
)
.await;
let hosted_selection = match crate::config::ConfigLoader::load() {
Expand Down
Loading
Loading