Skip to content

fix(tools)+feat(core): DynExecutor confirmation delegation and speculative ToolStartEvent wiring#3651

Merged
bug-ops merged 2 commits intomainfrom
3650-requires-confirmation-delegation
May 6, 2026
Merged

fix(tools)+feat(core): DynExecutor confirmation delegation and speculative ToolStartEvent wiring#3651
bug-ops merged 2 commits intomainfrom
3650-requires-confirmation-delegation

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented May 6, 2026

Summary

Changes

  • crates/zeph-tools/src/executor.rs: add DynExecutor::requires_confirmation delegation + 2 tests
  • crates/zeph-core/src/agent/tool_execution/native.rs: add commit_speculative_tier, update tier loop

Test plan

  • cargo nextest run -p zeph-tools --lib — 1132 tests pass
  • cargo nextest run -p zeph-core --lib — 1353 tests pass
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • New tests: dyn_executor_requires_confirmation_delegates, dyn_executor_requires_confirmation_default_false

Follow-up

  • (P3) Unit tests for commit_speculative_tier (4 cases: engine=None, no commits, Ok commit, Err commit)
  • (P3) debug_assert! in commit_speculative_tier guarding against ConfirmationRequired in committed Err results

Closes #3650
Closes #3643

@github-actions github-actions Bot added rust Rust code changes core zeph-core crate bug Something isn't working size/M Medium PR (51-200 lines) labels May 6, 2026
@bug-ops bug-ops enabled auto-merge (squash) May 6, 2026 11:57
bug-ops added 2 commits May 6, 2026 13:57
DynExecutor was missing the requires_confirmation method, causing it to
fall through to the ToolExecutor trait default (false) and silently
ignore the inner executor's confirmation policy.

Adds the delegation method and two unit tests covering both the true
and false paths, consistent with the existing is_tool_retryable and
is_tool_speculatable delegation pattern.

Closes #3650
When SpeculationEngine::try_commit returns a cached result for a tool
call, emit ToolStartEvent{speculative:true} and inject the result as a
ready future, bypassing normal dispatch for that index.

Changes:
- Clone speculation_engine Arc before the tier loop to avoid borrow
  conflicts across await points
- Add commit_speculative_tier: pre-scans tier indices via try_commit,
  stamps tool_started_ats for committed calls, warns on Err results,
  emits ToolStartEvent{speculative:true} for each committed call
- Filter committed indices out of stamp_and_send_tier_start and
  build_tier_call_futures; inject committed results as ready futures

Until #3641 (try_dispatch wiring) lands, try_commit always returns None
and this path is a no-op. The wiring is in place to activate
automatically when #3641 is implemented.

Closes #3643
@bug-ops bug-ops force-pushed the 3650-requires-confirmation-delegation branch from 4164890 to a20753c Compare May 6, 2026 11:57
@bug-ops bug-ops merged commit fb4035f into main May 6, 2026
32 checks passed
@bug-ops bug-ops deleted the 3650-requires-confirmation-delegation branch May 6, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

1 participant