refactor(acp): extract build_acp_agent seam and add skill-config regression test - #6227
Merged
Conversation
bug-ops
enabled auto-merge (squash)
July 13, 2026 17:18
bug-ops
force-pushed
the
fix/6221-acp-spawn-agent-test-seam
branch
2 times, most recently
from
July 13, 2026 17:19
36d199f to
50b4aab
Compare
…ession test spawn_acp_agent was the only one of the four Agent construction entry points (runner.rs, daemon.rs, acp.rs, serve/agent_factory.rs) without a real-Agent-level regression test proving with_skill_config/ with_skill_coldstart wiring reaches the built Agent — the other three got one from #5819/#5867/#5827. Its existing coverage stopped at the deps-assembly layer since spawn_acp_agent consumes the built Agent directly (runs its session loop and returns ()), leaving no seam to build through in a test. Extract the isolated Agent::new_with_registry_arc(...)... maybe_init_tool_schema_filter(...) builder chain into build_acp_agent(BuildAcpAgentParams, channel), mirroring build_daemon_agent/BuildDaemonAgentDeps in daemon.rs. Verbatim move, no behavior change: everything before (tool-executor assembly, session-persistence hydration) and after (with_acp_session, code retrieval, memory, providers, run()) stays in spawn_acp_agent. Add build_acp_agent_wires_skill_matching_config, mirroring the sibling tests: builds a real Agent through the new seam with a distinguishable confusability_threshold and asserts the value reaches Agent::handle_skills's output, closing the coverage gap. Closes #6221
bug-ops
force-pushed
the
fix/6221-acp-spawn-agent-test-seam
branch
from
July 13, 2026 17:30
50b4aab to
6407e21
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
spawn_acp_agentwas the only one of the fourAgentconstruction entry points (runner.rs,daemon.rs,acp.rs,serve/agent_factory.rs) without a real-Agent-level regression test provingwith_skill_config/with_skill_coldstartwiring reaches the builtAgent— the other three got one from runner.rs run()/run_daemon() have no test seam for Agent-construction wiring regressions #5819/skills.group_structured / support_similarity_threshold / min_injection_score never wired at agent cold start (only via hot-reload) #5867/with_semantic_scan still not wired into ACP/serve agent construction after #5823 (residual #5818 slice) #5827.Agent::new_with_registry_arc(...)...maybe_init_tool_schema_filter(...)builder chain intobuild_acp_agent(BuildAcpAgentParams, channel), mirroringbuild_daemon_agent/BuildDaemonAgentDepsindaemon.rs. Verbatim move, no behavior change.build_acp_agent_wires_skill_matching_config, mirroring the sibling tests: builds a realAgentthrough the new seam with a distinguishableconfusability_thresholdand asserts the value reachesAgent::handle_skills's output.Closes #6221
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(13444 passed, 0 failed)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"gitleaks protect --staged— no leaks