Repository navigation
fix(adk): handle Ollama options written as strings - #3279
Open
piyush182004 wants to merge 2 commits into
Open
piyush182004 wants to merge 2 commits into
piyush182004 wants to merge 2 commits into
Conversation
Options come from the CRD as strings, but the coercion was too strict. num_ctx: "2048.0" crashed the agent with a ValueError, and booleans only worked when spelled exactly "true" — "1" or "yes" silently turned off. Now int options accept "2048.0", bools accept the usual 1/0, yes/no, on/off, and a value we can't parse is passed through with a warning instead of crashing. Signed-off-by: Piyush Mondal <piyushmondal182004@gmail.com>
moezdil
reviewed
Oct 19, 2026
moezdil
reviewed
Oct 19, 2026
Address review: int(float(value)) truncated "2048.5" to 2048 and raised an uncaught OverflowError on "inf"/"1e400". Only accept a plain integer or an exactly-integral finite float; forward anything else with a warning. Signed-off-by: Piyush Mondal <piyushmondal182004@gmail.com>
Author
|
Thank you @moezdil for the review, replaced int(float(value)) with a helper that only accepts a plain integer or an exactly integral finite float — "2048.5" is now forwarded instead of truncated, and "inf"/"nan"/"1e400" no longer raise OverflowError. Added tests for all of these. Pushed the fixes,please check once again. |
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.
Options come from the CRD as strings, but the coercion was too strict. num_ctx: "2048.0" crashed the agent with a ValueError, and booleans only worked when spelled exactly "true" — "1" or "yes" silently turned off.
Now int options accept "2048.0", bools accept the usual 1/0, yes/no, on/off, and a value we can't parse is passed through with a warning instead of crashing.
ISSUE FIX #3245