fix(deps): update openai agents sdk to ^0.15.0 - #150
Conversation
dawsontoth
left a comment
There was a problem hiding this comment.
Green CI, broken build — @openai/agents-extensions@0.15 breaks npm run build
CI is fully green here, but that's the known blind spot: this repo has no build job (checks are Format, Lint, Test, commitlint, renovate/stability-days). npm run build fails on this branch, and since prepublishOnly runs npm run build, this would fail at publish time rather than in CI.
$ npm run build
ESM ⚡️ Build success in 44ms
DTS Build start
agent/AgentManager.ts(34,4): error TS2322: Type 'string | AiSdkModel' is not assignable to type 'string | Model'.
Type 'AiSdkModel' is not assignable to type 'Model'.
The types returned by 'getResponse(...)' are incompatible between these types.
... Type '{ readonly rawUsage?: Record<string, unknown> | undefined; ... }' is not assignable
to type 'ModelResponse' with 'exactOptionalPropertyTypes: true'.
Types of property 'rawUsage' are incompatible.
Type 'Record<string, unknown> | undefined' is not assignable to type 'Record<string, unknown>'.
Error: error occurred in dts build
Confirmed a regression: main (@openai/agents*@0.14.0) builds clean, this branch (0.15.0) does not. The ESM bundle builds fine either way — only declaration generation breaks.
Root cause: an upstream exactOptionalPropertyTypes hole in 0.15
0.15 added a rawUsage field, and the two packages disagree about its optionality.
@openai/agents-core@0.15.0 — dist/model.d.ts:521, optional without | undefined:
rawUsage?: Record<string, unknown>;@openai/agents-extensions@0.15.0 — dist/ai-sdk/index.d.ts:101, an inferred and emitted return type that includes | undefined explicitly:
export declare class AiSdkModel implements Model {
getResponse(request: ModelRequest): Promise<{
readonly rawUsage?: Record<string, unknown> | undefined; // <-- explicit undefined
readonly responseId: any;
readonly usage: Usage;
readonly output: import("@openai/agents").AgentOutputItem[];
readonly providerData: any;
}>;
}Under exactOptionalPropertyTypes: true (which this repo sets, tsconfig.json:25), rawUsage?: X | undefined is not assignable to rawUsage?: X. So AiSdkModel fails to structurally satisfy Model, and the failure surfaces at the model: assignment in AgentManager.ts:34:
model: isOpenAIModel(trackedState.model) ? trackedState.model : getModel(trackedState.model),getModel() returns AiSdkModel, so every non-OpenAI provider path goes through this.
Two things confirm the diagnosis:
- 0.14 has no
rawUsageat all in either package — the field is new in 0.15, so this is a 0.15 regression rather than a latent issue. - Flipping
exactOptionalPropertyTypestofalseand rebuilding givesDTS ⚡️ Build success, with nothing else changed. (Tested and reverted; not proposing that as the fix — the flag is load-bearing elsewhere.)
AiSdkModel implements Model compiles inside agents-extensions because that package doesn't build under exactOptionalPropertyTypes; the emitted .d.ts is what's wrong for consumers that do.
Everything else on this branch is fine
npm ci # exit 0
npm run lint # exit 0
npm run format # exit 0
npm run test # exit 0 53 files, 345 tests passing
npm run build # exit 1 <-- above
The aisdk() spec-version bridge is also unaffected: extensions 0.15 still accepts provider spec v2/v3/v4, and an end-to-end new Agent({ model: aisdk(anthropic(...)) }) + run() probe (with OPENAI_AGENTS_DISABLE_TRACING=1) reaches the provider and returns APICallError: invalid x-api-key, which is the pass signal. So this is purely a type-declaration break, not a runtime one.
Suggested path
Hold at 0.14.0 until upstream fixes the emitted declaration. The clean upstream fix is for agents-extensions to annotate getResponse's return as Promise<ModelResponse> instead of leaking an inferred object type — worth an issue against openai/openai-agents-js if one isn't already open.
A local as unknown as Model cast at AgentManager.ts:34 would unblock the build, but it would silently suppress any real future Model mismatch on the one line that bridges every non-OpenAI provider, so I'd rather not paper over it for a patch-level convenience.
Separately, this repo would benefit from a build job in CI — this is the second dependency PR whose breakage was invisible to green checks (agent#145 / typescript v7 was the first). A npm run build step would have caught both.
Requesting changes. Not pushing to the branch, so Renovate keeps its normal rebase loop.
🤖 Verified locally by Claude Opus 5 via scheduled Renovate triage
3572caf to
58cf058
Compare
|
Superseded by #152, which takes over this SDK bump: it regenerates the lockfile against current |
Renovate Ignore NotificationBecause you closed this PR without merging, Renovate will ignore this update ( If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR. |
Bumps @openai/agents and @openai/agents-extensions from ^0.14.0 to ^0.15.0 (supersedes the Renovate PR #150, resolving its lockfile conflict by regenerating against current main). 0.15.0 adds an optional rawUsage field to core's ModelResponse. The AiSdkModel wrapper from @openai/agents-extensions declares its getResponse rawUsage as `Record<string, unknown> | undefined`, which is not assignable to core's `rawUsage?: Record<string, unknown>` under this repo's exactOptionalPropertyTypes. Have getModel return the core `Model` type and bridge that upstream declaration mismatch with a single cast so the --dts build type-checks again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Bumps @openai/agents and @openai/agents-extensions from ^0.14.0 to ^0.15.0 (supersedes the Renovate PR #150, resolving its lockfile conflict by regenerating against current main). 0.15.0 adds an optional rawUsage field to core's ModelResponse. The AiSdkModel wrapper from @openai/agents-extensions declares its getResponse rawUsage as `Record<string, unknown> | undefined`, which is not assignable to core's `rawUsage?: Record<string, unknown>` under this repo's exactOptionalPropertyTypes. Have getModel return the core `Model` type and bridge that upstream declaration mismatch with a single cast so the --dts build type-checks again. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This PR contains the following updates:
^0.14.0→^0.15.0^0.14.0→^0.15.0Release Notes
openai/openai-agents-js (@openai/agents)
v0.15.0Compare Source
Key Changes
OpenAI client compatibility and the new default model
This release requires
openai7.2 or later for applications that supply their own OpenAI client. Agents without an explicit model now usegpt-5.6-lunawithreasoning.effort: "none"andtext.verbosity: "low". Configure an explicit model or setOPENAI_DEFAULT_MODELwhen an application needs a different default.MCP v2 negotiation with legacy server support
Local MCP connections now use the MCP TypeScript SDK v2 client and negotiate the 2026-07-28 protocol where available, with compatible fallback for existing v1 servers. Applications using
MCPServerStdio,MCPServerStreamableHttp, orMCPServerSSEdo not need to bridge the v1 and v2 SDK packages themselves.Durable input, tool output, and retry state
RunState.addInput()can stage new input while a run is paused, andpendingInputsurvives serialization until the next safe model request. JSON-compatible tool return values retain their structure acrossRunStateserialization, while canonical invocation evidence prevents approved or completed local tool calls from being rebound incorrectly. Applications may explicitly approve an otherwise unsafe non-streaming model replay withapproveUnsafeReplay: true.Safer sandbox mount credentials
Credential-bearing in-container mounts now fail closed unless the application acknowledges the exact effective mount path with
Manifest.withInContainerMountCredentialExposureAcknowledged()or, for ambient and external authority,Manifest.withInContainerMountBroadCredentialExposureAcknowledged(). Serialized credentials and unsafe mount authority are never trusted on resume. The deprecated VercelallowS3CredentialExposure: trueoption remains available for released inline S3 configurations.React Native and Realtime improvements
Core and Realtime packages now publish React Native conditions for portable shims. React Native applications provide an app-owned native WebRTC transport and retain responsibility for permissions, audio routing, and transport lifecycle. Realtime configuration also supports GA transcription models and context options, while closing browser WebRTC transports no longer stops caller-owned media streams.
More faithful provider and adapter results
The OpenAI and AI SDK adapters now preserve additional provider behavior across streaming and non-streaming runs, including Chat Completions audio, citations and request IDs, optional raw usage, AI SDK PDF inputs and prompt-cache retention, conversation program item IDs, apply-patch move destinations, and complete interleaved output ordering.
What's Changed
Documentation & Other Changes
New Contributors
Full Changelog: openai/openai-agents-js@v0.14.3...v0.15.0
Configuration
📅 Schedule: (in timezone America/New_York)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.