Skip to content

fix(tools): forward requires_confirmation/is_tool_speculatable/execute_tool_call_confirmed through remaining ToolExecutor wrappers - #6011

Merged
bug-ops merged 1 commit into
mainfrom
fix/5900-confirm-forwarding-gap
Jul 11, 2026
Merged

fix(tools): forward requires_confirmation/is_tool_speculatable/execute_tool_call_confirmed through remaining ToolExecutor wrappers#6011
bug-ops merged 1 commit into
mainfrom
fix/5900-confirm-forwarding-gap

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

Same defect class as #5899/#5905/#5906, fixed by #5930 — these three wrapper layers were explicitly scoped out of that PR to keep it minimal. Confirmed via direct code read that #5905/#5906 (open on GitHub only due to a comma-separated Closes auto-link limitation) and #5985 (Arc<ShellExecutor> checkpoint forwarding) are already fixed — no duplicate work in this PR.

An adversarial critique pass (verdict: minor, non-blocking) flagged that the same latent gap exists in three sibling wrappers not covered by these three issues: CompressedExecutor (missing requires_confirmation), ToolFilter (forwards none of the cross-cutting methods), and Arc<ShellExecutor>-style shadow-impls (partial). All are confirmed dormant — TrustGateExecutor is unconditionally the outermost confirmation authority in production wiring, so nothing is exploitable today. Kept out of scope for this PR; a follow-up issue will be filed separately.

Test plan

  • cargo +nightly fmt --check clean
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings clean
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 12699/12699 passed
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" clean
  • 9 new regression tests added (composite.rs x6, adversarial_gate.rs x2, policy_gate.rs x1), each using a spy/stub inner executor returning a distinguishable non-default value; the execute_tool_call_confirmed test additionally asserts the unconfirmed path was not touched

Closes #5900, #5938, #5931

…e_tool_call_confirmed through remaining ToolExecutor wrappers

CompositeExecutor did not forward requires_confirmation or
execute_tool_call_confirmed, and AdversarialPolicyGateExecutor did not
forward is_tool_speculatable, so all three fell through to the trait's
default and silently dropped whatever the wrapped chain actually
reported. PolicyGateExecutor and AdversarialPolicyGateExecutor also
did not forward requires_confirmation, masking TrustGateExecutor's
real policy whenever tools.policy or tools.adversarial_policy is
enabled.

Add the missing forwards: OR-forwarding for requires_confirmation and
first-match-wins for execute_tool_call_confirmed in CompositeExecutor
(mirroring the existing is_tool_retryable/is_tool_speculatable and
execute_confirmed overrides), plain delegation to self.inner in the
two gate executors. Same defect class as #5899/#5905/#5906 (fixed by
#5930), scoped out of that PR to keep it minimal.

Closes #5900, #5938, #5931
@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes bug Something isn't working size/L Large PR (201-500 lines) labels Jul 11, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 11, 2026 12:43
@bug-ops
bug-ops merged commit 2f1b75f into main Jul 11, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/5900-confirm-forwarding-gap branch July 11, 2026 12:52
bug-ops added a commit that referenced this pull request Jul 11, 2026
…ckpoint drop, add checkpoint-stack tests

CompressedExecutor, ToolFilter, and Arc<ShellExecutor> now forward every
cross-cutting ToolExecutor method to their inner/wrapped executor instead of
silently falling through to trait defaults, closing the same shadow-impl
forwarding gap fixed for other wrappers in #5930 and #6011.

capture_snapshot_for no longer drops a checkpoint for a newly-created file
under a symlinked allowed_paths prefix on macOS: a new
canonicalize_or_nearest_ancestor helper resolves symlinks via the nearest
existing ancestor when the target path itself does not exist yet.

Adds regression coverage for the ShellExecutor checkpoint stack: redo
without a prior undo, checkpoint_list ordering, and multi-step undo/redo
depth bookkeeping.
bug-ops added a commit that referenced this pull request Jul 11, 2026
…ckpoint drop, add checkpoint-stack tests

CompressedExecutor, ToolFilter, and Arc<ShellExecutor> now forward every
cross-cutting ToolExecutor method to their inner/wrapped executor instead of
silently falling through to trait defaults, closing the same shadow-impl
forwarding gap fixed for other wrappers in #5930 and #6011.

capture_snapshot_for no longer drops a checkpoint for a newly-created file
under a symlinked allowed_paths prefix on macOS: a new
canonicalize_or_nearest_ancestor helper resolves symlinks via the nearest
existing ancestor when the target path itself does not exist yet.

Adds regression coverage for the ShellExecutor checkpoint stack: redo
without a prior undo, checkpoint_list ordering, and multi-step undo/redo
depth bookkeeping.
bug-ops added a commit that referenced this pull request Jul 11, 2026
…ckpoint drop, add checkpoint-stack tests (#6036)

CompressedExecutor, ToolFilter, and Arc<ShellExecutor> now forward every
cross-cutting ToolExecutor method to their inner/wrapped executor instead of
silently falling through to trait defaults, closing the same shadow-impl
forwarding gap fixed for other wrappers in #5930 and #6011.

capture_snapshot_for no longer drops a checkpoint for a newly-created file
under a symlinked allowed_paths prefix on macOS: a new
canonicalize_or_nearest_ancestor helper resolves symlinks via the nearest
existing ancestor when the target path itself does not exist yet.

Adds regression coverage for the ShellExecutor checkpoint stack: redo
without a prior undo, checkpoint_list ordering, and multi-step undo/redo
depth bookkeeping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/L Large PR (201-500 lines)

Projects

None yet

1 participant