Skip to content

fix(tools): restore exempt_tools defaults when partial [tools.utility] TOML is parsed#3246

Merged
bug-ops merged 1 commit intomainfrom
3245-utility-exempt-tools-defaults
Apr 19, 2026
Merged

fix(tools): restore exempt_tools defaults when partial [tools.utility] TOML is parsed#3246
bug-ops merged 1 commit intomainfrom
3245-utility-exempt-tools-defaults

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 19, 2026

Summary

  • Replace #[serde(default)] on UtilityScoringConfig.exempt_tools with #[serde(default = "default_utility_exempt_tools")] so the named function (returning ["invoke_skill", "load_skill"]) is used even when [tools.utility] is partially specified in config
  • Update impl Default to call the same function instead of duplicating the literal
  • Add regression test utility_partial_toml_exempt_tools_uses_default_not_empty_vec

Root Cause

#[serde(default)] on a Vec<String> field calls Vec::default() (empty vec), not the struct-level impl Default. This caused invoke_skill and load_skill to be blocked by the utility gate whenever any [tools.utility] key was present in the config.

Test Plan

  • cargo nextest run -p zeph-tools --lib — 1054 passed
  • cargo clippy -p zeph-tools -- -D warnings — clean
  • cargo +nightly fmt --check — clean

Closes #3245

…] TOML is parsed

#[serde(default)] on a Vec<String> field calls Vec::default() (empty),
not the struct-level impl Default. Replace with a named serde default
function so invoke_skill and load_skill are always exempt regardless of
whether [tools.utility] is present or partially specified in config.

Also update impl Default to call the same function, eliminating the
duplicate literal.

Closes #3245
@github-actions github-actions Bot added rust Rust code changes bug Something isn't working size/S Small PR (11-50 lines) labels Apr 19, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 19, 2026 15:38
@bug-ops bug-ops merged commit 33b9926 into main Apr 19, 2026
32 checks passed
@bug-ops bug-ops deleted the 3245-utility-exempt-tools-defaults branch April 19, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working rust Rust code changes size/S Small PR (11-50 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(tools): UtilityScoringConfig.exempt_tools loses defaults when partial TOML is parsed

1 participant