Skip to content

feat: #2886 add convenience properties to ToolCallItem and ToolCallOutputItem#2887

Closed
DanielCufino wants to merge 1 commit intoopenai:mainfrom
DanielCufino:feat/tool-call-item-convenience-properties
Closed

feat: #2886 add convenience properties to ToolCallItem and ToolCallOutputItem#2887
DanielCufino wants to merge 1 commit intoopenai:mainfrom
DanielCufino:feat/tool-call-item-convenience-properties

Conversation

@DanielCufino
Copy link
Copy Markdown
Contributor

@DanielCufino DanielCufino commented Apr 15, 2026

Summary

ToolApprovalItem exposes tool_name and call_id as properties for easy inspection of tool calls. ToolCallItem and ToolCallOutputItem lack equivalent accessors, requiring users to reach into raw_item internals with getattr chains and isinstance checks.

This adds the same convenience properties to both classes, following the existing ToolApprovalItem patterns:

  • ToolCallItem: tool_name, call_id
  • ToolCallOutputItem: call_id

Test plan

  • make format — pass
  • make lint — pass
  • mypy src/agents/items.py — pass
  • Existing tests/test_items_helpers.py passes (31 tests, no regressions)

Issue number

Closes #2886

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 enhancement New feature or request feature:core labels Apr 15, 2026
… and ToolCallOutputItem

ToolApprovalItem already exposes tool_name and call_id as properties,
but ToolCallItem and ToolCallOutputItem require users to reach into
raw_item internals. This adds the same convenience accessors to both
classes, following the existing ToolApprovalItem patterns.

Closes openai#2886
@seratch
Copy link
Copy Markdown
Member

seratch commented Apr 26, 2026

@DanielCufino Thanks for putting this together. I'll #3027 instead because it carries the same additive API surface on current main and includes focused tests for the new helpers. I will include your credit by having Co-authored-by: in the merge commit.

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

Labels

enhancement New feature or request feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add convenience properties (tool_name, call_id) to ToolCallItem and ToolCallOutputItem

2 participants