mirror of
https://github.com/openai/codex.git
synced 2026-10-21 23:19:44 +00:00
test: assert selected environment roots directly
This commit is contained in:
@@ -193,10 +193,11 @@ async fn turn_model_context_uses_selected_environment() -> Result<()> {
|
||||
.build()
|
||||
.await?;
|
||||
timeout(DEFAULT_READ_TIMEOUT, app_server.initialize()).await??;
|
||||
let (environment_cwd, environment_shell) = {
|
||||
let (environment_cwd, environment_workspace_roots, environment_shell) = {
|
||||
let auto_env = app_server.auto_env()?;
|
||||
(
|
||||
auto_env.selection().cwd.clone(),
|
||||
auto_env.selection().workspace_roots.clone(),
|
||||
auto_env.environment().info().await?.shell.name,
|
||||
)
|
||||
};
|
||||
@@ -209,11 +210,7 @@ async fn turn_model_context_uses_selected_environment() -> Result<()> {
|
||||
app_server.read_stream_until_response_message(RequestId::Integer(request_id)),
|
||||
)
|
||||
.await??;
|
||||
let ThreadStartResponse {
|
||||
thread,
|
||||
runtime_workspace_roots,
|
||||
..
|
||||
} = to_response(response)?;
|
||||
let ThreadStartResponse { thread, .. } = to_response(response)?;
|
||||
timeout(
|
||||
DEFAULT_READ_TIMEOUT,
|
||||
app_server.start_turn_and_wait_for_completion(text_turn_params(
|
||||
@@ -248,15 +245,13 @@ async fn turn_model_context_uses_selected_environment() -> Result<()> {
|
||||
)),
|
||||
)
|
||||
);
|
||||
let [runtime_workspace_root] = runtime_workspace_roots.as_slice() else {
|
||||
let [environment_workspace_root] = environment_workspace_roots.as_slice() else {
|
||||
anyhow::bail!("expected one runtime workspace root");
|
||||
};
|
||||
let expected_workspace_roots = format!(
|
||||
"<workspace_roots><root>{}</root></workspace_roots>",
|
||||
runtime_workspace_root.as_path().display()
|
||||
environment_workspace_root.inferred_native_path_string()
|
||||
);
|
||||
// TODO(anp): Derive model-visible workspace roots from the selected remote environment and
|
||||
// render them using its native path convention.
|
||||
assert!(environment_context.contains(&expected_workspace_roots));
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user