fix(acp,daemon,serve): wire SelfCheckPipeline, TrajectorySentinel, and SkillInvokeExecutor into all entry points#6047
Merged
Conversation
…d SkillInvokeExecutor into all entry points SelfCheckPipeline (config.quality.self_check), TrajectorySentinel (config.security.trajectory, spec-050), and SkillInvokeExecutor (invoke_skill tool) were each constructed and wired into the Agent only in src/runner.rs (CLI/TUI entrypoint) -- another instance of the recurring wire-X-into-ACP/daemon/serve defect class. - Extract agent_setup::build_quality_pipeline as a shared helper used by all four entry points (runner.rs, acp.rs, daemon.rs, serve), closing a future-divergence risk. - Wire TrajectorySentinel config plus the paired PolicyGateExecutor and ScopedToolExecutor signal-queue plumbing into acp.rs (per session), daemon.rs (process-wide), and serve/agent_factory.rs (per session). Serve's shared ScopedToolExecutor cannot safely receive a per-session signal queue without leaking signals across sessions; this is documented as a known limitation, not fixed here. - Construct and register SkillInvokeExecutor in the ACP and daemon composite tool chains, sharing a trust_snapshot Arc with the Agent. Serve does not wire skill_loader/memory/overflow at all (separate pre-existing gap) and is correctly out of scope. - Add regression tests covering reachability of each fix through the real production composite chains in acp.rs, daemon.rs, and serve/agent_factory.rs. Refs #5951 Refs #5958 Refs #5975
bug-ops
enabled auto-merge (squash)
July 11, 2026 15:44
This was referenced Jul 11, 2026
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
SelfCheckPipeline(config.quality.self_check),TrajectorySentinel(config.security.trajectory, spec-050), andSkillInvokeExecutor(invoke_skilltool) were each constructed and wired into theAgentonly insrc/runner.rs(CLI/TUI entrypoint) — another instance of the recurring "wire-X-into-ACP/daemon/serve" defect class (18+ prior confirmed instances in this codebase).agent_setup::build_quality_pipelineas a shared helper used by all four entry points (runner.rs,acp.rs,daemon.rs,serve), closing a future-divergence risk.TrajectorySentinelconfig plus the pairedPolicyGateExecutor/ScopedToolExecutorsignal-queue plumbing intoacp.rs(per-session),daemon.rs(process-wide), andserve/agent_factory.rs(per-session).SkillInvokeExecutorin the ACP and daemon composite tool chains, sharing atrust_snapshotArc with theAgent. Serve does not wireskill_loader/memory/overflowat all (separate pre-existing gap, tracked in serve /sessions* never wires skill_loader, memory, or overflow tools — confirmed pre-existing gap #6046) and is correctly out of scope for this fix.acp.rs,daemon.rs, andserve/agent_factory.rs.Known limitation (not fixed here)
Serve's
ScopedToolExecutor([security.capability_scopes]wrap) is built once, eagerly, and shared across every concurrent/sessions*agent — before any per-session trajectory signal queue exists. Attaching a per-session queue there would leak one session'sOutOfScopesignals into every other session sharing that executor. This is documented in code (gate_serve_session_executor's doc comment) and tracked as a follow-up in #6045. It is a bounded defense-in-depth gap, not a control bypass or a regression from baseline (serve had zero trajectory wiring before this PR).Follow-up issues filed
ScopedToolExecutorcapability-scope denials never reachTrajectorySentinelsignal queue (tracks the known limitation above)/sessions*never wiresskill_loader,memory, oroverflowtools at all (confirmed pre-existing gap, broader than justinvoke_skill)Closes #5951
Closes #5975
Refs #5958
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— 12817 passed, 0 failed, 35 skippedRUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler".local/testing/playbooks/andcoverage-status.mdupdated (main repo path)