Fix turn environment cwd update semantics

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-04-30 19:09:22 -07:00
parent 66af15aa9a
commit ab4f20622c
3 changed files with 5 additions and 5 deletions

View File

@@ -161,7 +161,7 @@ mod tests {
&manager,
&[TurnEnvironmentSelection {
environment_id: "local".to_string(),
cwd: selected_cwd.clone(),
cwd: selected_cwd,
}],
)
.expect("environment selections should resolve");

View File

@@ -207,7 +207,7 @@ impl SessionConfiguration {
.unwrap_or_else(|| self.cwd.clone());
let cwd_changed = absolute_cwd.as_path() != self.cwd.as_path();
next_configuration.cwd = absolute_cwd.clone();
next_configuration.cwd = absolute_cwd;
if let Some(permission_profile) = updates.permission_profile.clone() {
let active_permission_profile =

View File

@@ -3280,7 +3280,7 @@ async fn session_configuration_apply_preserves_absolute_cwd_write_root_on_cwd_up
}
#[tokio::test]
async fn session_update_settings_keeps_runtime_cwds_absolute() {
async fn session_update_settings_does_not_rewrite_sticky_environment_cwds() {
let (session, turn_context) = make_session_and_context().await;
let updated_cwd = turn_context.cwd.join("project");
std::fs::create_dir_all(updated_cwd.as_path()).expect("create project dir");
@@ -3302,8 +3302,8 @@ async fn session_update_settings_keeps_runtime_cwds_absolute() {
assert_eq!(session_cwd, updated_cwd);
assert_eq!(config.cwd, turn_context.cwd);
assert_eq!(next_turn.cwd, updated_cwd);
assert_eq!(next_turn.config.cwd, updated_cwd);
assert_eq!(next_turn.cwd, turn_context.cwd);
assert_eq!(next_turn.config.cwd, turn_context.cwd);
}
#[tokio::test]