fix: bound non-finite shell output limits - #4547
Closed
hsusul wants to merge 1 commit into
Closed
Conversation
Member
|
On the current base, these values fail during normalization before the shell executor runs. This patch instead converts them to zero, executes the command, and silently discards its output, so it weakens the failure behavior rather than fixing a supported case. I am going to close this PR. If a supported provider is observed emitting this payload, please provide a sanitized real response and its provider/version. The appropriate SDK behavior would then be an actionable ModelBehaviorError before execution, not coercion to a valid zero limit. |
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
Malformed shell tool payloads with non-finite
max_output_lengthvalues (NaNor infinities) previously escaped coercion asValueError/OverflowError, and negative infinity could disable output truncation. This change bounds all non-finite numeric limits to zero while preserving integer limits, including arbitrarily large integers.Test plan
NaN, positive/negative infinity, and a 400-digit integer.tests/test_shell_call_serialization.pyandtests/test_shell_tool.py: 49 passed..agents/skills/code-change-verification/scripts/run.sh: format, lint, typecheck, and full tests passed.git diff --check: passed.Issue number
Not linked to an issue; this is a directly reproducible malformed model-payload bug.
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR