refactor(tools): migrate Arc<ShellExecutor> to DynExecutor erasure path - #6230
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 13, 2026 17:18
bug-ops
force-pushed
the
feat/issue-6224/shell-executor-dynexecutor
branch
2 times, most recently
from
July 13, 2026 17:30
eecff8e to
8f61348
Compare
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
force-pushed
the
feat/issue-6224/shell-executor-dynexecutor
branch
from
July 13, 2026 17:40
8f61348 to
57aa468
Compare
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
impl ToolExecutor for Arc<ShellExecutor>incrates/zeph-tools/src/shell/mod.rs, a bespoke forwarding wrapper structurally identical to theDynSchedulerExecutoranti-pattern removed in refactor(scheduler): route DynSchedulerExecutor through DynExecutor erasure path #6223.src/agent_setup.rs) now wraps it aszeph_tools::DynExecutor(Arc<ShellExecutor>), flowing through the existingErasedToolExecutorerasure adapter, which forwards all 13ToolExecutormethods by construction instead of by hand.impl ToolExecutor for ShellExecutoritself never overrodeexecute_confirmed(onlyexecute). The old code was accidentally correct only because the deleted wrapper's override calledself.as_ref().execute_confirmed(...), which Rust's inherent-method-priority rule silently resolved toShellExecutor's separate inherentexecute_confirmedmethod rather than the trait method. Once routed throughDynExecutor's dynamic dispatch, that accidental shadowing no longer applies, and the trait's default (self.execute(..), no confirmation bypass) would have kicked in — reintroducing CompressedExecutor/ToolFilter/Arc<ShellExecutor>-style shadow-impls have the same ToolExecutor forwarding gap as #5900/#5938/#5931 #6012. Fixed by adding an explicitexecute_confirmedoverride onShellExecutorforwarding to the sameexecute_inner(response, true)the inherent method already uses.execute_tool_call(_confirmed)path is used in production; the string-responseexecute/execute_confirmedpath is otherwise dead code. The fix is still required for the refactor's own "behaves identically" contract and closes the gap for any future/erased caller.shell_executor_handle(used only for TUI background-run metrics via the concreteShellExecutor::background_runs_snapshot()inherent method) is unaffected.crates/zeph-tools/src/shell/tests.rsrenamed fromarc_shell_executor_*todyn_executor_*and adapted to exercise the same invariants (CompressedExecutor/ToolFilter/Arc<ShellExecutor>-style shadow-impls have the same ToolExecutor forwarding gap as #5900/#5938/#5931 #6012, checkpoint_undo/redo/list never reach ShellExecutor — Arc<ShellExecutor>'s own ToolExecutor impl doesn't forward them #5985) through the newDynExecutor-wrapped path.Closes #6224
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— 13453 passed, 35 skippedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"dyn_executor_execute_confirmed_bypasses_confirmationregression test genuinely fails without theexecute_confirmedfix (reverted locally, confirmed failure, restored)Arc<ShellExecutor>production call site depends on the removed impl (only production site wasagent_setup.rs, now migrated)ToolExecutorimplementor shares the sameexecute_confirmedoverride gap