refactor(scheduler): route DynSchedulerExecutor through DynExecutor erasure path - #6223
Merged
Merged
Conversation
…rasure path Delete the hand-maintained Arc<SchedulerExecutor> ToolExecutor wrapper, which forwarded only 9 of the trait's 13 methods and was structurally identical to the Arc<ShellExecutor> anti-pattern that caused #5985. The ACP scheduler tool executor now flows through the existing zeph_tools::DynExecutor/ErasedToolExecutor erasure path, which forwards all methods by construction instead of requiring manual per-method overrides that can silently drift out of parity. Closes #6000
bug-ops
enabled auto-merge (squash)
July 13, 2026 16:19
7 tasks
bug-ops
added a commit
that referenced
this pull request
Jul 13, 2026
Removes the hand-maintained impl ToolExecutor for Arc<ShellExecutor> in favor of the existing DynExecutor/ErasedToolExecutor adapter, mirroring the DynSchedulerExecutor migration in #6223. Removing the wrapper exposed a masked gap: ShellExecutor's ToolExecutor impl never overrode execute_confirmed, silently falling back to the no-bypass trait default for any caller reaching it through a generic/erased path. Adds the missing override so the fix applies uniformly across all dispatch paths. Closes #6224
bug-ops
added a commit
that referenced
this pull request
Jul 13, 2026
Removes the hand-maintained impl ToolExecutor for Arc<ShellExecutor> in favor of the existing DynExecutor/ErasedToolExecutor adapter, mirroring the DynSchedulerExecutor migration in #6223. Removing the wrapper exposed a masked gap: ShellExecutor's ToolExecutor impl never overrode execute_confirmed, silently falling back to the no-bypass trait default for any caller reaching it through a generic/erased path. Adds the missing override so the fix applies uniformly across all dispatch paths. Closes #6224
bug-ops
added a commit
that referenced
this pull request
Jul 13, 2026
Removes the hand-maintained impl ToolExecutor for Arc<ShellExecutor> in favor of the existing DynExecutor/ErasedToolExecutor adapter, mirroring the DynSchedulerExecutor migration in #6223. Removing the wrapper exposed a masked gap: ShellExecutor's ToolExecutor impl never overrode execute_confirmed, silently falling back to the no-bypass trait default for any caller reaching it through a generic/erased path. Adds the missing override so the fix applies uniformly across all dispatch paths. Closes #6224
bug-ops
added a commit
that referenced
this pull request
Jul 13, 2026
…th (#6230) Removes the hand-maintained impl ToolExecutor for Arc<ShellExecutor> in favor of the existing DynExecutor/ErasedToolExecutor adapter, mirroring the DynSchedulerExecutor migration in #6223. Removing the wrapper exposed a masked gap: ShellExecutor's ToolExecutor impl never overrode execute_confirmed, silently falling back to the no-bypass trait default for any caller reaching it through a generic/erased path. Adds the missing override so the fix applies uniformly across all dispatch paths. Closes #6224
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DynSchedulerExecutor(src/scheduler_executor.rs), a hand-maintainedArc<SchedulerExecutor>ToolExecutorwrapper that forwarded only 9 of the trait's 13 methods (omittingexecute_confirmed,set_skill_env,set_effective_trust,is_tool_retryable) — structurally identical to theArc<ShellExecutor>anti-pattern that caused a real bug in checkpoint_undo/redo/list never reach ShellExecutor — Arc<ShellExecutor>'s own ToolExecutor impl doesn't forward them #5985, and the 8th+ recurrence of this defect class (checkpoint_undo/redo/list not forwarded by TrustGateExecutor/PolicyGateExecutor/AdversarialPolicyGateExecutor, breaking /undo in standard production wiring #5899/checkpoint_undo/redo/list not forwarded by ScopedToolExecutor/ShadowProbeExecutor — breaks /undo even after #5899, since these sit outside the gated chain #5905/ScopedToolExecutor does not forward requires_confirmation, defaulting to false for the outermost wrapper #5906/checkpoint_undo/redo/list never reach ShellExecutor — Arc<ShellExecutor>'s own ToolExecutor impl doesn't forward them #5985).src/acp.rsto use the existingzeph_tools::DynExecutor/ErasedToolExecutorerasure adapter instead — already the standard mechanism for every other dynamically-composedToolExecutorin the codebase, forwarding all 13 methods by construction rather than requiring hand-maintained per-method overrides.dyn_executor_erasure_path_dispatches) verifying the erasure path stays live for the scheduler.DynSchedulerExecutorwaspub(crate), not part of the public API, and the 4 methods it never forwarded still resolve to the same trait defaults via the new path.Scope was deliberately kept to
DynSchedulerExecutoronly.Arc<ShellExecutor>(the #5985/#5998 fix) already forwards all 13 methods correctly and was left untouched to avoid unrelated scope creep.Closes #6000
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins— 13443 passed, 35 skippedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"DynSchedulerExecutorworkspace-widelist_taskscall through the erasure path and asserts on response content