Commit 6d3cdc6
fix(openai-agents): Resolve agent from
openai-agents 0.14 refactored its run loop to pass an `AgentBindings`
dataclass (with `public_agent` and `execution_agent` fields) instead of
a raw `agent` kwarg to `run_single_turn` / `run_single_turn_streamed`,
and renamed the `agent` kwarg to `public_agent` on `execute_handoffs` /
`execute_final_output`. As a result, the integration's `kwargs.get("agent")`
returned `None`, no `invoke_agent` span was created, and every
`test_agent_invocation_span*` case failed.
Resolve the agent from `bindings.public_agent` (or the `public_agent`
kwarg) with a fallback to the pre-0.14 `agent` kwarg so older pinned
versions remain supported. `public_agent` is the user-facing identity
the library itself uses for hooks and stream events, which keeps span
names stable across sandbox-prepared execution agents.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>bindings for openai-agents >= 0.141 parent e476bf5 commit 6d3cdc6
1 file changed
+30
-5
lines changedLines changed: 30 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
| |||
119 | 125 | | |
120 | 126 | | |
121 | 127 | | |
122 | | - | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
131 | 137 | | |
132 | 138 | | |
133 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
134 | 153 | | |
135 | 154 | | |
136 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
137 | 160 | | |
138 | 161 | | |
139 | 162 | | |
| |||
179 | 202 | | |
180 | 203 | | |
181 | 204 | | |
182 | | - | |
| 205 | + | |
| 206 | + | |
183 | 207 | | |
184 | 208 | | |
185 | 209 | | |
| |||
214 | 238 | | |
215 | 239 | | |
216 | 240 | | |
217 | | - | |
| 241 | + | |
| 242 | + | |
218 | 243 | | |
219 | 244 | | |
220 | 245 | | |
| |||
0 commit comments