fix(acp): separate acp sessions from user sessions (#7857)

Signed-off-by: Rabi Mishra <mishra.rabi@gmail.com>
Co-authored-by: Douwe Osinga <douwe@squareup.com>
This commit is contained in:
Rabi Mishra
2026-03-26 22:22:42 +05:30
committed by GitHub
parent 3d8d2aa2dc
commit f5ad3384b8
7 changed files with 251 additions and 52 deletions
@@ -1,6 +1,7 @@
use crate::agents::extension::PlatformExtensionContext;
use crate::agents::mcp_client::{Error, McpClientTrait};
use crate::agents::tool_execution::ToolCallContext;
use crate::session::session_manager::SessionType;
use anyhow::Result;
use async_trait::async_trait;
use indoc::indoc;
@@ -58,6 +59,13 @@ impl ChatRecallClient {
Ok(Self { info, context })
}
fn search_session_types(&self) -> Vec<SessionType> {
match self.context.session.as_ref().map(|s| s.session_type) {
Some(SessionType::Acp) => vec![SessionType::Acp],
_ => vec![SessionType::User, SessionType::Scheduled],
}
}
#[allow(clippy::too_many_lines)]
async fn handle_chatrecall(
&self,
@@ -177,6 +185,7 @@ impl ChatRecallClient {
after_date,
before_date,
exclude_session_id,
self.search_session_types(),
)
.await
{