Add cached environment manager for exec server URL (#15785)

Add environment manager that is a singleton and is created early in
app-server (before skill manager, before config loading).

Use an environment variable to point to a running exec server.
This commit is contained in:
pakrym-oai
2026-03-25 16:14:36 -07:00
committed by GitHub
parent f24c55f0d5
commit 8fa88fa8ca
32 changed files with 286 additions and 83 deletions

View File

@@ -1,5 +1,6 @@
use async_trait::async_trait;
use tokio::sync::broadcast;
use tracing::trace;
use crate::ExecProcess;
use crate::ExecServerClient;
@@ -19,6 +20,7 @@ pub(crate) struct RemoteProcess {
impl RemoteProcess {
pub(crate) fn new(client: ExecServerClient) -> Self {
trace!("remote process new");
Self { client }
}
}
@@ -26,10 +28,12 @@ impl RemoteProcess {
#[async_trait]
impl ExecProcess for RemoteProcess {
async fn start(&self, params: ExecParams) -> Result<ExecResponse, ExecServerError> {
trace!("remote process start");
self.client.exec(params).await
}
async fn read(&self, params: ReadParams) -> Result<ReadResponse, ExecServerError> {
trace!("remote process read");
self.client.read(params).await
}
@@ -38,14 +42,17 @@ impl ExecProcess for RemoteProcess {
process_id: &str,
chunk: Vec<u8>,
) -> Result<WriteResponse, ExecServerError> {
trace!("remote process write");
self.client.write(process_id, chunk).await
}
async fn terminate(&self, process_id: &str) -> Result<TerminateResponse, ExecServerError> {
trace!("remote process terminate");
self.client.terminate(process_id).await
}
fn subscribe_events(&self) -> broadcast::Receiver<ExecServerEvent> {
trace!("remote process subscribe_events");
self.client.event_receiver()
}
}