Skip to content

fix: #3330 handle string tool trimmer allowlists#3331

Merged
seratch merged 2 commits intoopenai:mainfrom
Aphroq:fix/tool-output-trimmer-string
May 10, 2026
Merged

fix: #3330 handle string tool trimmer allowlists#3331
seratch merged 2 commits intoopenai:mainfrom
Aphroq:fix/tool-output-trimmer-string

Conversation

@Aphroq
Copy link
Copy Markdown
Contributor

@Aphroq Aphroq commented May 10, 2026

Summary

  • Treat a string ToolOutputTrimmer.trimmable_tools value as one tool name instead of iterating it into characters.
  • Keep list, set, and frozenset allowlists normalized to frozenset, and reject bytes so byte strings do not become integer allowlists.
  • Add regression coverage for single-string allowlists matching the intended tool name without matching single-character tool names.

Test plan

  • uv run pytest tests/extensions/test_tool_output_trimmer.py -k "trimmable_tools or allowlist"
  • uv run mypy src/agents/extensions/tool_output_trimmer.py tests/extensions/test_tool_output_trimmer.py
  • uv run pytest tests/extensions/test_tool_output_trimmer.py
  • bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

Closes #3330

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

@github-actions github-actions Bot added bug Something isn't working feature:extensions labels May 10, 2026
@Aphroq Aphroq marked this pull request as ready for review May 10, 2026 07:44
@seratch seratch added this to the 0.17.x milestone May 10, 2026
@seratch seratch merged commit 52656a5 into openai:main May 10, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:extensions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolOutputTrimmer treats string trimmable_tools as characters

2 participants