Skip to content

fix: bound non-finite shell output limits - #4547

Closed
hsusul wants to merge 1 commit into
openai:mainfrom
hsusul:fix/shell-output-length-nonfinite
Closed

fix: bound non-finite shell output limits#4547
hsusul wants to merge 1 commit into
openai:mainfrom
hsusul:fix/shell-output-length-nonfinite

Conversation

@hsusul

@hsusul hsusul commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Malformed shell tool payloads with non-finite max_output_length values (NaN or infinities) previously escaped coercion as ValueError/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

  • Added focused regressions for NaN, positive/negative infinity, and a 400-digit integer.
  • tests/test_shell_call_serialization.py and tests/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

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

@seratch

seratch commented Aug 21, 2026

Copy link
Copy Markdown
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.

@seratch seratch closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants