Repository navigation
Fix : Applies fuzzy matching for LLM slight mis-types for metadata fields for tool calling - #2769
Open
TheeJamesLee wants to merge 8 commits into
Open
TheeJamesLee wants to merge 8 commits into
TheeJamesLee wants to merge 8 commits into
Conversation
Linked to netclaw-dev#2705 Signed-off-by: TheeJamesLee <TheeJamesLee@users.noreply.github.com>
…ies fuzzy matching against the ToolCallMeta.MetaFieldNames to avoid having to strongly type all differences with a suitable threshold. Tests ensure fuzzymatching still wired for known mis-types
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.
PR Summary — Fuzzy Matching for ToolCallMeta Field Resolution
Problem
ToolArgumentHelper.ResolveMetaFieldonly resolved keys againstNormalizedMetaFields— a precomputed exact + alias map. Misspelled or near-miss model-emitted keys (e.g.rationale,rationl,timeout-like variants) that weren't an exact or alias hit returnednull, so those args were silently dropped instead of being extracted as tool-call meta (rationale / timeout / background).Change
Kept the first-pass exact + normalized alias resolution (strongly-typed match), then added a dependency-free fuzzy fallback (
FuzzyMatcher, new in the same folder) only after that pass misses, usingFuzzyMatcher.FindBestMatchagainstToolCallMeta.MetaFieldNames:nullfor weak/empty input (never guessing).Net result: misspelled
_rationale/_timeout_seconds/_backgroundvariants are now recovered, while exact-match behavior and all existing aliases stay unchanged.Scope & Validation
src/Netclaw.Tools.Abstractions(FuzzyMatcher.csnew;ToolArgumentHelper.ResolveMetaField+FuzzyMatchUnmatched).MetaFieldResolutionTests,ToolArgumentHelperStrictTests,ToolArgumentValidatorTests.