feat: guard git enrichment (#26175)

Skip turn git metadata enrichment when a turn has remote or multiple
executors, so we do not report the orchestrator checkout as executor
workspace metadata.

Test: `just test -p codex-core` (blocked by existing
`Session::conversation_id` compile error in `close_agent.rs`).
This commit is contained in:
jif
2026-06-03 18:36:10 +02:00
committed by GitHub
parent 99c9be1d30
commit 8030c36970
3 changed files with 69 additions and 2 deletions
+3 -1
View File
@@ -160,7 +160,9 @@ pub(super) async fn spawn_review_thread(
client_id: None,
}];
let tc = Arc::new(review_turn_context);
tc.turn_metadata_state.spawn_git_enrichment_task();
if tc.environments.single_local_environment_cwd().is_some() {
tc.turn_metadata_state.spawn_git_enrichment_task();
}
// TODO(ccunningham): Review turns currently rely on `spawn_task` for TurnComplete but do not
// emit a parent TurnStarted. Consider giving review a full parent turn lifecycle
// (TurnStarted + TurnComplete) for consistency with other standalone tasks.
+7 -1
View File
@@ -814,7 +814,13 @@ impl Session {
turn_context.final_output_json_schema = final_schema;
}
let turn_context = Arc::new(turn_context);
turn_context.turn_metadata_state.spawn_git_enrichment_task();
if turn_context
.environments
.single_local_environment_cwd()
.is_some()
{
turn_context.turn_metadata_state.spawn_git_enrichment_task();
}
turn_context
}