Repository navigation
fix(deps): bump openai sdk to 2.30.0 for python 3.14 - #107918
trunk-io[bot] merged 1 commit into
Conversation
openai 1.109.1 sets __discriminator__ on a typing.Union object when it decodes a discriminated union. Python 3.14 rejects this with an AttributeError, so some Responses API stream events crash PostHog AI runs. openai 2.x does not set this attribute. langchain-openai 0.3.35 accepts openai 2.x, so it stays as is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 41e21d99-ef8f-401a-a931-8ba6bdfd9a65
|
😎 Merged successfully - details. |
There was a problem hiding this comment.
Not approved yet — waiting on the conditions below.
Re-add the stamphog label to request another review once you have addressed this.
This pull request was refused automatically by stamphog's deterministic policy gates. The deny-list gate failed on deps_toolchain, since this PR modifies pyproject.toml and uv.lock to bump the openai dependency, and dependency/toolchain pin changes are categorically excluded from automated approval. It was also flagged by the tier gate as T2-never, a fix-classified change that is never eligible for autonomous merge regardless of its small size. These are hard policy stops, not judgments on the change's correctness; a human reviewer will need to evaluate and merge this pull request manually.
Gate mechanics and policy version
| Gate | Result | |
|---|---|---|
| prerequisites | ✓ | all clear |
| deny-list | ✗ | matches: deps_toolchain |
| size | ✓ | 2L, 1F substantive, 30L/2F incl. docs/generated/snapshots — within ceiling |
| tier | ✗ | classified as T2-never: T2-never (30L, 2F, single-area, fix) |
| stamphog 2.2.0 | .stamphog/policy.yml @ unknown · reviewed head f7444f4 |
🤖 CI report
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: PostHog/posthog/.coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe pinned Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The gateway’s synchronous and asynchronous clients remain compatible with the upgraded SDK. No concrete merge-blocking regression was established; the change is ready for normal checks. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
rnegron
left a comment
There was a problem hiding this comment.
lgtm, v2 breaking change seems to be around unused logic but will defer to AI teams for merging
|
/trunk merge |

Problem
openai==1.109.1sets__discriminator__on atyping.Unionobject when it decodes a discriminated union, for example some Responses API stream events.typing.Union, so the call raisesAttributeErrorevery time. The whole graph run stops, starting fromMaxChatOpenAIinee/hogai/llm.py.Origin
fc32d80Changes
openai==1.109.1toopenai==2.30.0. This is the version thatservices/llm-gatewayalready locks.langchain-openai~=0.3.35accepts openai 2.x, so the lock resolves with no other package change.uv.lockchanges otherwise. No application code changes.Warning
This is a major SDK bump. Every backend caller of
openaigets 2.x. The repo uses only stable client, error and chat-type imports, but CI is the real check for the rest of the call sites.How did you test this code?
_build_discriminated_union_metaonResponseStreamEventon Python 3.14.7: 1.109.1 raises the reportedAttributeError, 2.30.0 returns the discriminator details.hogli test ee/hogai/test/test_llm.pylocally on 2.30.0. It passes.Release status
Automatic notifications
Docs update
None.
🤖 Agent context
Autonomy: Fully autonomous
Agent: PostHog Desktop (Claude Code), claude-opus-5-5
openaifound no other SDK bump.services/llm-gatewayalready uses, not the minimum fixed version (2.7.2), to keep one openai version across the repo.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code