mirror of
https://github.com/openai/codex.git
synced 2026-05-01 11:52:10 +03:00
[codex] Support remote exec cwd in TUI startup (#17142)
When running with remote executor the cwd is the remote path. Today we check for existence of a local directory on startup and attempt to load config from it. For remote executors don't do that.
This commit is contained in:
@@ -69,6 +69,11 @@ impl EnvironmentManager {
|
||||
self.exec_server_url.as_deref()
|
||||
}
|
||||
|
||||
/// Returns true when this manager is configured to use a remote exec server.
|
||||
pub fn is_remote(&self) -> bool {
|
||||
self.exec_server_url.is_some()
|
||||
}
|
||||
|
||||
/// Returns the cached environment, creating it on first access.
|
||||
pub async fn current(&self) -> Result<Option<Arc<Environment>>, ExecServerError> {
|
||||
self.current_environment
|
||||
@@ -227,6 +232,7 @@ mod tests {
|
||||
|
||||
assert!(!manager.disabled);
|
||||
assert_eq!(manager.exec_server_url(), None);
|
||||
assert!(!manager.is_remote());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -235,6 +241,15 @@ mod tests {
|
||||
|
||||
assert!(manager.disabled);
|
||||
assert_eq!(manager.exec_server_url(), None);
|
||||
assert!(!manager.is_remote());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn environment_manager_reports_remote_url() {
|
||||
let manager = EnvironmentManager::new(Some("ws://127.0.0.1:8765".to_string()));
|
||||
|
||||
assert!(manager.is_remote());
|
||||
assert_eq!(manager.exec_server_url(), Some("ws://127.0.0.1:8765"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user