Skip to content

Commit a7e1172

Browse files
committed
fix: specify custom address url for the container
1 parent d0ae422 commit a7e1172

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

refact-agent/engine/src/integrations/docker/docker_container_manager.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,17 @@ async fn docker_container_create(
223223
}
224224
let host_lsp_path = format!("{}/refact-lsp", get_host_cache_dir(gcx.clone(), &docker.settings_docker).await);
225225

226-
let (address_url, api_key, integrations_yaml) = {
226+
let (cmdline_address_url, api_key, integrations_yaml) = {
227227
let gcx_locked = gcx.read().await;
228228
(gcx_locked.cmdline.address_url.clone(), gcx_locked.cmdline.api_key.clone(), gcx_locked.cmdline.integrations_yaml.clone())
229229
};
230230

231+
let address_url = if !isolation.isolation_address_url.is_empty() {
232+
&isolation.isolation_address_url
233+
} else {
234+
&cmdline_address_url
235+
};
236+
231237
let mut lsp_command = format!(
232238
"{DEFAULT_CONTAINER_LSP_PATH} --http-port {lsp_port} --logs-stderr --inside-container \
233239
--address-url {address_url} --api-key {api_key} --vecdb --reset-memory --ast --experimental",

refact-agent/engine/src/integrations/docker/integr_isolation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ use crate::integrations::integr_abstract::{IntegrationTrait, IntegrationCommon};
1414
#[derive(Clone, Serialize, Deserialize, Default, Debug)]
1515
pub struct SettingsIsolation {
1616
pub container_workspace_folder: String,
17+
#[serde(default)]
18+
pub isolation_address_url: String,
1719
pub docker_image_id: String,
1820
#[serde(default)]
1921
pub docker_network: String,
@@ -87,6 +89,9 @@ fields:
8789
docker_extra_params:
8890
f_type: string_array
8991
f_desc: "Extra parameters to pass to the Docker command."
92+
isolation_address_url:
93+
f_type: string_long
94+
f_desc: "The address url that refact binary will use inside the container, in case it needs to be different than the one used by the host."
9095
available:
9196
on_your_laptop_possible: true
9297
when_isolated_possible: false

0 commit comments

Comments
 (0)