Description
SpeculationEngine is fully implemented in crates/zeph-core/src/agent/speculative/mod.rs with both Decoding mode (issue #2290) and Pattern/PASTE mode (issue #2409). SpeculativeConfig is declared in crates/zeph-config/src/tools.rs (line 1060) and included in ToolsConfig (line 1263). However, SpeculationEngine is never instantiated in the agent loop and all tool dispatch call sites hardcode speculative: false.
Reproduction Steps
- Review
crates/zeph-core/src/agent/speculative/mod.rs:31 — #![allow(dead_code)] confirms intentional deferral
- Search for
SpeculationEngine outside the speculative module: grep -rn "SpeculationEngine" crates/ | grep -v "speculative/" — zero results
- Search call sites:
grep -rn "speculative: false" crates/zeph-core/src/ — 7 hardcoded false values
Hardcoded false call sites
crates/zeph-core/src/channel.rs:1061, 1088, 1111
crates/zeph-core/src/agent/channel_impl.rs:113
crates/zeph-core/src/agent/tool_execution/native.rs:590, 687, 2194
Expected Behavior
When tools.speculative.mode is set to Decoding or Pattern in the config, the agent loop should instantiate SpeculationEngine from SpeculativeConfig and pass it through to tool dispatch so speculative execution can fire.
Actual Behavior
SpeculativeConfig is read from TOML but never used. All tool dispatch calls receive speculative: false regardless of config. The SpeculationEngine type has #![allow(dead_code)] suppressing warnings on the entire module.
Environment
- Version: v0.20.1 (commit a17a5bd)
- Features: full
Logs / Evidence
$ grep -rn "SpeculationEngine" crates/ | grep -v "speculative/"
(no output — zero instantiation sites outside the module)
$ grep -rn "speculative: false" crates/zeph-core/src/
crates/zeph-core/src/channel.rs:1061: speculative: false,
crates/zeph-core/src/channel.rs:1088: speculative: false,
crates/zeph-core/src/channel.rs:1111: speculative: false,
crates/zeph-core/src/agent/channel_impl.rs:113: speculative: false,
crates/zeph-core/src/agent/tool_execution/native.rs:590: speculative: false,
crates/zeph-core/src/agent/tool_execution/native.rs:687: speculative: false,
crates/zeph-core/src/agent/tool_execution/native.rs:2194: speculative: false,
Implementation Notes
SpeculationEngine is in crates/zeph-core/src/agent/speculative/mod.rs
SpeculativeConfig is in crates/zeph-config/src/tools.rs:1060; included via ToolsConfig::speculative at line 1263
- Wire: instantiate
SpeculationEngine in crates/zeph-core/src/agent/builder.rs from config.tools.speculative, propagate through ToolExecutionContext, and replace hardcoded false with config-driven flag at the 7 call sites above
Description
SpeculationEngineis fully implemented incrates/zeph-core/src/agent/speculative/mod.rswith both Decoding mode (issue #2290) and Pattern/PASTE mode (issue #2409).SpeculativeConfigis declared incrates/zeph-config/src/tools.rs(line 1060) and included inToolsConfig(line 1263). However,SpeculationEngineis never instantiated in the agent loop and all tool dispatch call sites hardcodespeculative: false.Reproduction Steps
crates/zeph-core/src/agent/speculative/mod.rs:31—#![allow(dead_code)]confirms intentional deferralSpeculationEngineoutside the speculative module:grep -rn "SpeculationEngine" crates/ | grep -v "speculative/"— zero resultsgrep -rn "speculative: false" crates/zeph-core/src/— 7 hardcoded false valuesHardcoded false call sites
crates/zeph-core/src/channel.rs:1061,1088,1111crates/zeph-core/src/agent/channel_impl.rs:113crates/zeph-core/src/agent/tool_execution/native.rs:590,687,2194Expected Behavior
When
tools.speculative.modeis set toDecodingorPatternin the config, the agent loop should instantiateSpeculationEnginefromSpeculativeConfigand pass it through to tool dispatch so speculative execution can fire.Actual Behavior
SpeculativeConfigis read from TOML but never used. All tool dispatch calls receivespeculative: falseregardless of config. TheSpeculationEnginetype has#![allow(dead_code)]suppressing warnings on the entire module.Environment
Logs / Evidence
Implementation Notes
SpeculationEngineis incrates/zeph-core/src/agent/speculative/mod.rsSpeculativeConfigis incrates/zeph-config/src/tools.rs:1060; included viaToolsConfig::speculativeat line 1263SpeculationEngineincrates/zeph-core/src/agent/builder.rsfromconfig.tools.speculative, propagate throughToolExecutionContext, and replace hardcodedfalsewith config-driven flag at the 7 call sites above