mirror of
https://github.com/openai/codex.git
synced 2026-10-29 00:06:55 +00:00
Add cwd-relative turn diff paths (#39625)
## What changed - Add the opt-in `cwd_relative_turn_diffs` feature. - When enabled, render turn diff paths relative to each selected environment's working directory instead of the detected Git root. - Preserve repository-root-relative paths when the feature is disabled. ## Testing - Cover enabled and disabled behavior for nested working directories across supported originators. GitOrigin-RevId: 8b4908706a82b01f33ccd035b0945f9a29fce26f
This commit is contained in:
@@ -223,7 +223,27 @@ pub(crate) async fn run_turn(
|
||||
// Keep the exact model-visible state used by this turn and its inline compactions.
|
||||
let (world_state, display_roots) = tokio::join!(
|
||||
sess.record_context_updates_and_set_reference_context_item(first_step_context.as_ref()),
|
||||
turn_diff_display_roots(first_step_context.as_ref()),
|
||||
async {
|
||||
if first_step_context
|
||||
.turn
|
||||
.config
|
||||
.features
|
||||
.enabled(Feature::CwdRelativeTurnDiffs)
|
||||
{
|
||||
first_step_context
|
||||
.environments
|
||||
.turn_environments()
|
||||
.map(|environment| {
|
||||
(
|
||||
environment.selection().environment_id,
|
||||
environment.cwd().clone(),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
} else {
|
||||
turn_diff_display_roots(first_step_context.as_ref()).await
|
||||
}
|
||||
},
|
||||
);
|
||||
let mut world_state = world_state?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user