Description
ToolStartEvent has a speculative: bool field used by the TUI to render [spec] prefix. In PR #3640 (#3636) all production call sites correctly keep speculative: false for normal dispatch. The speculative: true path needs to be wired when the speculation engine commits a cached result via try_commit.
Scope
- File:
crates/zeph-core/src/agent/tool_execution/native.rs — build_tier_call_futures (around line 2509 per critic analysis)
- Before normal dispatch, call
engine.try_commit(&tool_call) — if it returns Some(result), use the cached result and emit ToolStartEvent { speculative: true, .. }
- If
try_commit returns None, proceed with normal dispatch (keep speculative: false)
- The
ToolStartEvent ordering concern (critic I3): suppress or defer stamp_and_send_tier_start for indices where a speculative commit fires
Acceptance
- TUI shows
[spec] prefix on committed speculative tool calls
SpeculativeMetrics.committed increments
speculative: false path unchanged for normal dispatch
Depends on
#3636 (merged), #3641 (try_dispatch wired — needed to have results to commit)
Description
ToolStartEventhas aspeculative: boolfield used by the TUI to render[spec]prefix. In PR #3640 (#3636) all production call sites correctly keepspeculative: falsefor normal dispatch. Thespeculative: truepath needs to be wired when the speculation engine commits a cached result viatry_commit.Scope
crates/zeph-core/src/agent/tool_execution/native.rs—build_tier_call_futures(around line 2509 per critic analysis)engine.try_commit(&tool_call)— if it returnsSome(result), use the cached result and emitToolStartEvent { speculative: true, .. }try_commitreturnsNone, proceed with normal dispatch (keepspeculative: false)ToolStartEventordering concern (critic I3): suppress or deferstamp_and_send_tier_startfor indices where a speculative commit firesAcceptance
[spec]prefix on committed speculative tool callsSpeculativeMetrics.committedincrementsspeculative: falsepath unchanged for normal dispatchDepends on
#3636 (merged), #3641 (try_dispatch wired — needed to have results to commit)