
ExternalMessage, Ultra Reasoning, and HookMetadata Changes
We break down OpenAI Python SDK 0.154.0 for Codex, including ExternalMessage for injecting live context from CI, webhooks, and telemetry into active runs, plus the security implications of tool-level authority. The episode also covers late-attaching turn handles, ultra reasoning effort, tiered service control, HookMetadata breaking changes, selective history loading, and other upgrade notes.
Chapter 1
Injecting Live Context with ExternalMessage and Tiered Control in Python SDK 0.154.0
Maya
So, if an automated build fails halfway through an AI agent's refactoring job, how does the agent actually find out without a human jumping into the chat window?
Ethan Park
Well, until now, you kind of had to hack it or wait for a fresh turn. But in OpenAI's recent Python SDK zero point one five four point zero release for Codex, there is a brand new primitive called ExternalMessage.
Maya
ExternalMessage. What does that actually do under the hood?
Ethan Park
It lets external systems, think CI runners, webhooks, live telemetry feeds, inject data straight into an active run or turn. And here is the kicker, it joins with tool level execution authority, not user authorization.
Maya
Wait, say that again? Tool level authority?
Ethan Park
Right. So it can feed live context to the model as if a tool produced it, but it cannot pretend to be a human approving a dangerous command or granting new permissions.
Maya
Okay, but if an inbound webhook has tool level authority to push text into a running turn... isn't that a massive security surface if someone spoofs the payload?
Ethan Park
Oh, absolutely. You, you have to treat those inbound endpoints with serious discipline. Strict HMAC signatures, payload validation, the whole nine yards. Because the model will act on that incoming stream as valid tool output.
Maya
That makes sense. What happens if my monitoring code attaches to the turn handle a few seconds late? Does it catch up on what happened?
Ethan Park
Ah, that is actually a big gotcha in zero point one five four point zero. Late joining turn handles only get events from the exact moment they attach. They do not replay old events.
Maya
Wait, so if you attach late, you miss the earlier output?
Ethan Park
Exactly. If you attach after completion, it will even raise a TransportClosedError. If you need saved history, you have to read the thread explicitly instead of relying on the event handle replay.
Maya
Got it, got it. So attach early or read history. Now, what about when a turn needs massive compute, like an architectural overhaul?
Ethan Park
Yeah, they added max and ultra to the reasoning effort settings now. So alongside low, medium, and high, you can crank it all the way up to ultra for really deep logic problems.
Maya
Ultra reasoning effort. Wow. And can you adjust priority on the fly too?
Ethan Park
You can! There is a new turn service tier parameter. You can assign a higher service tier to just one critical turn, without changing your global account defaults.
Chapter 2
Navigating HookMetadata Breaking Changes and Selective History
Maya
Now, I saw there was a breaking migration in this release around hooks. What is breaking for developers upgrading today?
Ethan Park
Right, so HookMetadata got refactored. It now wraps handler fields inside a root property.
Maya
So if my code was checking hook dot command...
Ethan Park
It breaks! You need to update that to hook dot root dot command. And you should check hook dot root dot handler type first before accessing any handler specific fields.
Maya
classic zero point release breaking change. What else changed with thread history?
Ethan Park
They added include turns on resume and fork calls, plus source metadata. It lets you pull full turn history for rendering custom UI timelines without shoving all those historical turns back into the model's active context window.
Maya
Oh, that is huge for token budgets! So your front end gets the full conversation, but the model context stays lean.
Ethan Park
Precisely. And on top of that, notifications are now typed payloads instead of raw params dictionaries, and they fixed a race condition where turn completion events arriving before turn start responses were getting dropped.
Maya
Nothing like preserving completion events to keep state machines happy. Good updates overall!
Ethan Park
Yeah, solid release. Definitely check those hook migration paths before upgrading!