Skip to content

fix(tools): forward checkpoint and confirmation methods through executor wrappers - #5930

Merged
bug-ops merged 1 commit into
mainfrom
fix/5899-checkpoint-confirm-forwarding
Jul 10, 2026
Merged

fix(tools): forward checkpoint and confirmation methods through executor wrappers#5930
bug-ops merged 1 commit into
mainfrom
fix/5899-checkpoint-confirm-forwarding

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • TrustGateExecutor, PolicyGateExecutor, and AdversarialPolicyGateExecutor never overrode checkpoint_undo/checkpoint_redo/checkpoint_list, so calls fell through to the ToolExecutor trait's no-op default instead of reaching ShellExecutor. ScopedToolExecutor and ShadowProbeExecutor had the same gap on the outer wrapper layers. Net effect: /undo, /redo, and /undo list always reported checkpoints as unsupported whenever trust/policy/adversarial gating, capability_scopes, or shadow_sentinel wrapped the executor chain — the standard, default-recommended production configuration — even with checkpoints_enabled = true set.
  • ScopedToolExecutor also never overrode requires_confirmation, defaulting to false regardless of the real policy underneath, which would silently disable the speculative-dispatch engine's confirmation gate once any tool opts into speculative execution.
  • Adds one-line self.inner.<method>(...) forwards to all five wrapper files, mirroring each file's existing pass-through style for is_tool_retryable/set_skill_env. Adds 6 regression tests (one per file, scope.rs has 2) using local stub inner executors that return distinguishable non-default values, including an argument round-trip check on checkpoint_undo's n parameter.

Closes #5899, #5905, #5906

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 — 12579 passed, 0 failed, 35 skipped
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • Reviewer mutation-tested the fix: hand-patched checkpoint_undo to hardcode the forwarded n, confirmed the new test fails, then confirmed the file was restored byte-identical
  • .local/testing/coverage-status.md and .local/testing/playbooks/undo-redo.md updated with a new regression scenario for gate/scope wrapper transparency

Note: local cargo build/rustdoc runs on this machine require CARGO_BUILD_WARNINGS=allow due to pre-existing, unrelated issues (#5894, #5895) from the build.warnings migration in #5891 — not touched by this PR.

@github-actions github-actions Bot added bug Something isn't working size/L Large PR (201-500 lines) documentation Improvements or additions to documentation rust Rust code changes labels Jul 10, 2026
…tor wrappers

TrustGateExecutor, PolicyGateExecutor, and AdversarialPolicyGateExecutor never
overrode checkpoint_undo/checkpoint_redo/checkpoint_list, so calls fell through
to the ToolExecutor trait's no-op default instead of reaching ShellExecutor.
ScopedToolExecutor and ShadowProbeExecutor had the same gap on the outer layers
of the production wrapper chain. As a result, /undo, /redo, and /undo list
always reported checkpoints as unsupported whenever trust/policy/adversarial
gating, capability_scopes, or shadow_sentinel wrapped the executor chain, even
with checkpoints_enabled = true set.

ScopedToolExecutor also never overrode requires_confirmation, defaulting to
false regardless of the real policy underneath, which would silently disable
the speculative-dispatch engine's confirmation gate once any tool opts into
speculative execution.

Add one-line forwards to self.inner in all five wrapper files, mirroring the
existing pass-through style used for is_tool_retryable/set_skill_env. Add
regression tests per file proving delegation with distinguishable non-default
return values, including an argument round-trip check on checkpoint_undo.

Closes #5899, #5905, #5906
@bug-ops
bug-ops force-pushed the fix/5899-checkpoint-confirm-forwarding branch from d9cdec9 to 72ca18f Compare July 10, 2026 21:31
@bug-ops
bug-ops enabled auto-merge (squash) July 10, 2026 21:32
@bug-ops
bug-ops merged commit 38ff590 into main Jul 10, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/5899-checkpoint-confirm-forwarding branch July 10, 2026 21:40
bug-ops added a commit that referenced this pull request Jul 11, 2026
…e_tool_call_confirmed through remaining ToolExecutor wrappers (#6011)

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
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