mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Skip Git enrichment for prewarm and Guardian turns (#34728)
## Why Startup prewarms and Guardian review sessions do not need workspace Git metadata. Collecting it for those requests performs redundant work, while user turns still need a fresh view of the repository. ## What changed - Add a per-session Git enrichment policy. - Skip enrichment for startup prewarm, preview, and Guardian review turns. - Keep fresh enrichment enabled for regular sessions and one-shot delegated turns. ## Testing - Cover prewarm and Guardian requests omitting workspace metadata while subsequent user turns observe repository changes. - Cover concurrent repositories and worktrees retaining distinct metadata. - Verify concurrent enrichment is coalesced and canceled enrichment can be retried. GitOrigin-RevId: 4a68615288bb568c75f2e487d9c0776e3e80f191
This commit is contained in:
1 parent
9fc715c086
commit
33d394c69e
12 files changed
+691
-21
No files matched your search
@@ -673,6 +673,7 @@ impl Session {
|
||||
session_configuration,
|
||||
final_output_json_schema,
|
||||
TurnMultiAgentRuntime::ResolveAndStore,
|
||||
self.git_enrichment_policy,
|
||||
)
|
||||
.await
|
||||
}
|
||||
@@ -687,6 +688,7 @@ impl Session {
|
||||
session_configuration,
|
||||
/*final_output_json_schema*/ None,
|
||||
TurnMultiAgentRuntime::Preview,
|
||||
GitEnrichmentPolicy::Skip,
|
||||
)
|
||||
.await
|
||||
}
|
||||
@@ -698,6 +700,7 @@ impl Session {
|
||||
session_configuration: SessionConfiguration,
|
||||
final_output_json_schema: Option<Option<Value>>,
|
||||
multi_agent_runtime: TurnMultiAgentRuntime,
|
||||
git_enrichment_policy: GitEnrichmentPolicy,
|
||||
) -> Arc<TurnContext> {
|
||||
let turn_environments = self.services.turn_environments.snapshot().await;
|
||||
let primary_turn_environment = turn_environments.primary();
|
||||
@@ -792,10 +795,11 @@ impl Session {
|
||||
turn_context.final_output_json_schema = final_schema;
|
||||
}
|
||||
let turn_context = Arc::new(turn_context);
|
||||
if turn_context
|
||||
.environments
|
||||
.single_local_environment_cwd()
|
||||
.is_some()
|
||||
if git_enrichment_policy == GitEnrichmentPolicy::Fresh
|
||||
&& turn_context
|
||||
.environments
|
||||
.single_local_environment_cwd()
|
||||
.is_some()
|
||||
{
|
||||
turn_context.turn_metadata_state.spawn_git_enrichment_task();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user