Use live owner tool scope for autonomous routines and jobs (#1453)

* Use live owner tool scope for autonomous runs

* Address autonomous tool scope review feedback

* Normalize routine context paths again
This commit is contained in:
Henry Park
2026-03-20 10:12:32 -07:00
committed by GitHub
parent 3da9810e87
commit ee6f5cd62a
23 changed files with 944 additions and 967 deletions
+31
View File
@@ -463,6 +463,37 @@ fn sanitize_url_for_logging(url: &str) -> String {
}
impl ExtensionManager {
pub fn owner_id(&self) -> &str {
&self.user_id
}
pub async fn active_tool_names(&self) -> HashSet<String> {
let mut names = HashSet::new();
match self.list(None, false).await {
Ok(extensions) => {
for extension in extensions {
match extension.kind {
ExtensionKind::WasmTool if extension.active => {
names.insert(extension.name);
}
ExtensionKind::McpServer if extension.active => {
names.extend(extension.tools);
}
_ => {}
}
}
}
Err(err) => {
tracing::warn!(
owner_id = %self.user_id,
"Failed to list active extensions while resolving autonomous tool scope: {}",
err
);
}
}
names
}
#[allow(clippy::too_many_arguments)]
pub fn new(
mcp_session_manager: Arc<McpSessionManager>,