Skip to content

Validate tool output trimmer allowlist entries#3695

Open
CodingFeng101 wants to merge 1 commit into
openai:mainfrom
CodingFeng101:codex/agent-small-fix
Open

Validate tool output trimmer allowlist entries#3695
CodingFeng101 wants to merge 1 commit into
openai:mainfrom
CodingFeng101:codex/agent-small-fix

Conversation

@CodingFeng101

Copy link
Copy Markdown

Summary

  • Validate every trimmable_tools iterable member is a string
  • Add a focused regression test for mixed-type allowlists

Why

ToolOutputTrimmer.trimmable_tools accepts a string or iterable of strings. Passing an iterable with a non-string member currently succeeds silently and stores that value in the allowlist, making configuration mistakes harder to diagnose when tool outputs are not trimmed as expected.

This keeps valid string and iterable configurations unchanged, but fails fast for invalid mixed-type iterables.

Validation

  • python -m pytest tests/extensions/test_tool_output_trimmer.py -q
  • python -m ruff check src/agents/extensions/tool_output_trimmer.py tests/extensions/test_tool_output_trimmer.py
  • python -m ruff format --check src/agents/extensions/tool_output_trimmer.py tests/extensions/test_tool_output_trimmer.py
  • git diff --check

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.

1 participant