---
type: email
from: "chatgpt-codex-connector[bot]" <notifications@github.com>
subject: Re: [openai/openai-agents-python] feat: expose immutable agent tool

 invocation metadata on run results (ref #2575) (PR #2576)
received: 2026-03-05 11:10:28
priority: high
status: awaiting_approval
---

## Email Content
@chatgpt-codex-connector[bot] commented on this pull request.







> +    def agent_tool_invocation(self) -> AgentToolInvocation | None:

+        """Immutable metadata for results produced by `Agent.as_tool()`.

+

+        Returns `None` for ordinary top-level runs.

+        """

         from .tool_context import ToolContext

 

-        if isinstance(self.context_wrapper, ToolContext):

-            return self.context_wrapper

-        return None

+        if not isinstance(self.context_wrapper, ToolContext):

+            return None

+

+        return AgentToolInvocation(

+            tool_name=self.context_wrapper.tool_name,

+            tool_call_id=self.context_wrapper.tool_call_id,

+            tool_arguments=self.context_wrapper.tool_arguments,

+        )



Codex Revi...

## Suggested Actions
- [ ] Reply
- [ ] Archive
- [ ] Flag for review
