Capture direct-tool critical paths behind a feature flag (#57201)

## What changed

Add the default-disabled `critical_path_timing` feature to capture dependency paths for root-agent turns. Connect direct tool dispatch, execution-lock handoffs, and completed tool batches to turn timing so overlapping work shares its common history without double counting.

Omit captures for unsupported dependencies, including CodeMode, agent communication, approval review, and user waits. Settle aborted tasks before freezing timing, invalidate captures on forced teardown, and apply runtime feature changes only to future turns.

## Testing

Add coverage for serial and overlapping tool dispatch, execution-lock dependency handoffs, cancellation, unsupported paths, frozen timing after completion, and configuration refresh boundaries.

GitOrigin-RevId: 71458b654b1c4a05799886928b449c948ea33109
This commit is contained in:
taohong-oai
2026-10-26 19:19:10 +00:00
committed by copyberry
parent 36021e1ad5
commit f371f9701f
31 changed files with 1436 additions and 106 deletions
+8
View File
@@ -203,6 +203,8 @@ pub enum Feature {
CwdRelativeTurnDiffs,
/// Enable runtime metrics snapshots via a manual reader.
RuntimeMetrics,
/// Capture internal direct-tool dependency paths for turn attribution.
CriticalPathTiming,
/// Enable startup memory extraction and file-backed memory consolidation.
MemoryTool,
/// Enable importing project-scoped memory from external agents.
@@ -1326,6 +1328,12 @@ pub const FEATURES: &[FeatureSpec] = &[
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::CriticalPathTiming,
key: "critical_path_timing",
stage: Stage::UnderDevelopment,
default_enabled: false,
},
FeatureSpec {
id: Feature::Sqlite,
key: "sqlite",