fix(core,config): wire ToolsConfig::enabled into tool-def gating#6409
Merged
Conversation
ToolsConfig::enabled ([tools] enabled = false) was deserialized but never consumed, so tool definitions were still sent to the LLM regardless of the flag. Gate tool-definition construction in both production send paths: Agent::process_response_native_tools (tier_loop.rs) and Agent::run_inline_tool_loop (scheduler_loop.rs). Also fix effective_embedding_model()'s doc comment, which claimed the global fallback default is "nomic-embed-text" when the actual default_embedding_model() returns "qwen3-embedding" (and the same stale claim in zeph-llm/README.md). Closes #6386 Closes #6385
bug-ops
enabled auto-merge (squash)
July 17, 2026 19:02
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
[tools] enabled = falsewas deserialized intoToolsConfig::enabledbut never consumed anywhere inzeph-core/zeph-tools/zeph-agent-tools, so setting it had no effect — tool definitions were still sent to the LLM and the model could still attempt tool calls.tools_enabled: booltoToolState(manualDefaultimpl defaultingtrue, since the struct previously derivedDefaultwhich would have silently defaulted the bool tofalse), anAgent::with_tools_enabled(bool)builder method, and gated tool-definition construction in both production request-building paths:Agent::process_response_native_tools(tier_loop.rs) andAgent::run_inline_tool_loop(scheduler_loop.rs, the schedulerRunInlinepath — found missing by adversarial review of the first pass). Wired.with_tools_enabled(config.tools.enabled)at everyAgentconstruction site across the workspace.LlmConfig::effective_embedding_model()claimed the global embedding-model fallback default is"nomic-embed-text", butdefault_embedding_model()actually returns"qwen3-embedding"— corrected the doc comment and an identical stale claim incrates/zeph-llm/README.md.Closes #6386
Closes #6385
Testing
--profile ci, nextest, rustdoc gate) green after rebase onto latestmain: 14160/14160 tests passed.Agent::process_response()andAgent::run_inline_tool_loop(), not internal helpers) plus aMockProvider::with_tool_recording()test-infra addition to assert on thetoolsargument sent to the provider.[tools] enabled = true(baseline): real request payload carries 24 tool definitions; model attempts a tool call.[tools] enabled = false: real request payload carries an empty tool list; model responds it has no directory-listing capability — confirming no tool defs reached the LLM. No 400/422 in either run..local/testing/playbooks/tools-enabled-gate.md(5 scenarios covering CLI, TUI, serve-sessions/ACP, and the schedulerRunInlinepath) and a newcoverage-status.mdrow.Adversarial review notes
An implementation-critique pass on the first draft found the
run_inline_tool_loopscheduler path was left ungated (scheduled/cron tool calls would have bypassed the new flag entirely). Fixed in this PR and re-verified by a delta-review before code review.