Repository navigation
fix(tools): harden fenced and embedded tool selection JSON (#115) - #120
Closed
wxai-space wants to merge 2 commits into
Closed
wxai-space wants to merge 2 commits into
wxai-space wants to merge 2 commits into
Conversation
filter_tools only stripped an exact ```json ... ``` fence before json.loads(). LLM tool-reflection output commonly wraps the payload in a plain ``` fence (no language tag) or embeds it between prose, which made the call raise ValueError and abort tool filtering. Add a best-effort _extract_json_payload() that pulls the payload out of a fenced block (with or without the json tag), or from the first JSON object, before falling back to the raw text. Truly invalid input still raises ValueError, preserving documented behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Oct 28, 2026
Collaborator
Author
Collaborator
Author
|
All fixes have now been fast-forwarded directly into the original PR #115 at 0cb40e0. Its new CI run passed all 4 checks: https://github.com/wanxingai/LightAgent/actions/runs/40616538629 . Closing this supplemental PR as redundant, without merging or deleting its branch. Continue review in #115; main is unchanged. |
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
Testing
Review
This is a main-repository follow-up with contributor attribution retained. It is submitted for review only; no automatic merge or release is requested. Supersedes the unresolved review gaps in #115.