Description
commit_speculative_tier (native.rs:2234–2293) is a new private async helper added in PR #3651 (#3643). It has no direct unit tests — coverage is only achievable through integration tests that require a live speculation engine.
Missing test cases
engine = None → returns empty map immediately (zero-cost fast path)
try_commit returns None for all calls → returns empty map
try_commit returns Ok(result) → index present in map, tool_started_ats[idx] stamped, ToolStartEvent { speculative: true } emitted
try_commit returns Err(_) → index still in map, tracing::warn! fired
Expected
Each case covered by a focused #[tokio::test] using a mock SpeculationEngine or the existing test infrastructure.
Environment
Description
commit_speculative_tier(native.rs:2234–2293) is a new private async helper added in PR #3651 (#3643). It has no direct unit tests — coverage is only achievable through integration tests that require a live speculation engine.Missing test cases
engine = None→ returns empty map immediately (zero-cost fast path)try_commitreturnsNonefor all calls → returns empty maptry_commitreturnsOk(result)→ index present in map,tool_started_ats[idx]stamped,ToolStartEvent { speculative: true }emittedtry_commitreturnsErr(_)→ index still in map,tracing::warn!firedExpected
Each case covered by a focused
#[tokio::test]using a mockSpeculationEngineor the existing test infrastructure.Environment