deps: Bump the npm-minor-patch group across 1 directory with 6 updates (#4621)

Update the TypeScript SDK's development peer matrix to versions that
preserve Anthropic JSON final answers and support async OpenAI
credential callbacks through Headroom's existing adapters. With the old
locked Anthropic provider, a model in JSON-tool mode that returns final
text without calling the tool produces an empty SDK answer. With the old
OpenAI provider, an async API-key callback is rejected as a non-string.
Both behaviors were reproduced with the actual old packages, the real
Headroom middleware and compression HTTP endpoint, and a loopback
provider response.

## Dependency assessment

- **@ai-sdk/anthropic 4.0.87 -> 4.0.94:** includes the final-text
preservation fix
[e10aebb](https://github.com/vercel/ai/commit/e10aebbad661c641a5463c645272168d03a5c2f2).
Headroom must preserve assistant output rather than allowing the peer
provider to discard it in JSON mode/manual thinking. The new proof fails
on the old locked provider with `actual ''` versus `expected
'{"name":"Ada"}'`, and passes with this version. It also includes schema
handling fixes for newer Claude models; those additional models are not
claimed tested here.
- **@ai-sdk/openai 4.0.101 -> 4.0.106:** includes per-request resolution
of async credential settings
([v4.0.106](https://github.com/vercel/ai/releases/tag/%40ai-sdk%2Fopenai%404.0.106)).
The new proof calls the wrapped provider twice and observes a different
resolved bearer value each time, after passing through Headroom. The old
locked provider fails with `AI_LoadAPIKeyError: OpenAI API key must be a
string.` This qualifies the new credential functionality for the
existing middleware without adding an authentication mechanism to
Headroom.
- **@ai-sdk/provider 4.0.33 -> 4.0.35** is the shared contract used by
the updated providers. **ai 7.0.152 -> 7.0.159** is the actual
wrapLanguageModel peer used by Headroom's convenience wrapper. Qualify
that provider/AI combination together instead of treating compilation of
isolated provider packages as compatibility evidence.
- **openai 7.43.0 -> 7.46.0** and **@types/node 26.6.5 -> 26.6.6** are
retained as required current-peer compatibility coverage for Headroom,
alongside the provider fixes. The real native OpenAI chat client has a
transport check through the native Headroom adapter; the Node
declarations are checked by the SDK typecheck. These are deliberate
qualification targets for the supported peer matrix, rather than claims
that either package fixes the Vercel defects. The native client's
independent new API surfaces and Node 26 runtime behavior are not
covered by the chat/typecheck proof.
- **Maintenance/security:** Vercel maintains ai and the provider
packages, OpenAI maintains the native client, and DefinitelyTyped
maintains @types/node. The linked provider releases/source fixes and
OpenAI's 7.46.0 release were reviewed; active upstream release history
does not imply a spotless security record. Fresh SDK audit reports zero
vulnerabilities.
- **Install/runtime surface:** all six are development dependencies,
used to build/test optional peer integrations. This PR does not change
published runtime dependency or peer ranges, so consumers do not
automatically receive the provider fixes merely by installing a new
Headroom package. Compared with the prior lock, no package paths are
added/removed, no new install-script flags appear, and all resolved
tarballs remain on registry.npmjs.org. Existing esbuild/native build
tooling remains part of SDK development. The existing Vercel peer
toolchain already requires Node 22; these patches do not newly establish
that floor. Node type declarations are not shipped runtime code. OpenAI
widens the optional google-auth-library peer upper bound, but this
install does not add that optional peer. Registry installs and provider
API traffic remain network surfaces; the proof uses no real credential
and contacts no cloud model.

## Real behavior proof

Windows, Node 22.22.0, Python 3.12.13, the actual PR's package-lock
install, and the real Headroom proxy source. The local run reused an
existing native Headroom extension; it does not claim a fresh local Rust
build. The proof runs the proxy with isolated temporary workspace/config
paths, stateless storage, subscription tracking disabled, and upstream
discovery skipped. A loopback HTTP provider fixture deliberately
supplies valid API responses; it is not a live model.

```powershell
cd sdk/typescript
npm ci --ignore-scripts --no-audit --no-fund
npm run build
cd ../..
python scripts/verify_sdk_provider_peers.py
```

Observed, exit 0:

```text
PASS: real provider + Headroom middleware + real compression HTTP path preserve final JSON text without a tool call
PASS: real OpenAI provider resolves async credentials separately for both wrapped requests
PASS: native OpenAI SDK chat client completes a real HTTP request through the Headroom adapter
Real Headroom /v1/compress response: [200, 200, 200, 200]
```

The same Anthropic case on main's old lock drops the final JSON text.
Running the proof with `openai-only` against a separate old-lock
checkout reproduces the old async-credential error. No
client/model/compress function is replaced; the actual SDKs make the
HTTP requests, and all four calls pass through Headroom's real
/v1/compress endpoint with fallback disabled. The short prompts do not
trigger token reduction, so this is transport/response preservation
proof, not a compression-ratio benchmark.

Additional validation: SDK tests **406 passed, 33 skipped**; typecheck
and ESM/CJS/declaration build pass; `npm audit --json` reports zero
vulnerabilities. The Python proof passes Ruff lint/format, the Node
proof passes `node --check`, and whitespace checks pass.

Untested: live vendor credentials/models, streaming responses, async
credential failures/refresh races, actual token reduction on long
inputs, browser environments, other platforms, new native OpenAI
agent/image/organization APIs, and the 33 skipped tests. Current-head
hosted CI remains required.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JerrettDavis <mxjerrett@gmail.com>
This commit is contained in:
dependabot[bot]
2026-11-02 22:07:30 -06:00
committed by GitHub
co-authored by JerrettDavis
parent 08ed419515
commit 5e4827de12
4 changed files with 218 additions and 47 deletions
+96
View File
@@ -0,0 +1,96 @@
import assert from 'node:assert/strict';
import { createServer } from 'node:http';
import { createRequire } from 'node:module';
import { pathToFileURL } from 'node:url';
import path from 'node:path';
const sdk = path.resolve(process.argv[2]);
const require = createRequire(path.join(sdk, 'package.json'));
const { createAnthropic } = require('@ai-sdk/anthropic');
const { createOpenAI } = require('@ai-sdk/openai');
const OpenAI = require('openai').default;
const { withHeadroom } = await import(pathToFileURL(path.join(sdk, 'dist/adapters/vercel-ai.js')));
const { withHeadroom: withOpenAIHeadroom } = await import(pathToFileURL(path.join(sdk, 'dist/adapters/openai.js')));
assert.ok(['localhost', '127.0.0.1'].includes(new URL(process.env.HEADROOM_BASE_URL).hostname));
const calls = [];
const server = createServer(async (request, response) => {
const chunks = [];
for await (const chunk of request) chunks.push(chunk);
const body = JSON.parse(Buffer.concat(chunks).toString());
calls.push({ body, url: request.url, authorization: request.headers.authorization });
response.writeHead(200, { 'content-type': 'application/json' });
if (request.url.endsWith('/chat/completions')) {
response.end(JSON.stringify({
id: 'chatcmpl-local', object: 'chat.completion', created: 1, model: 'gpt-4o',
choices: [{ index: 0, message: { role: 'assistant', content: 'fixture answer' }, finish_reason: 'stop' }],
usage: { prompt_tokens: 12, completion_tokens: 2, total_tokens: 14 },
}));
return;
}
response.end(JSON.stringify({
id: 'msg-local-structured-proof', type: 'message', role: 'assistant',
model: 'claude-3-7-sonnet-20250219',
content: [{ type: 'text', text: '{"name":"Ada"}' }],
stop_reason: 'end_turn', stop_sequence: null,
usage: { input_tokens: 12, output_tokens: 8 },
}));
});
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
try {
if (process.argv[3] !== 'openai-only') {
const provider = createAnthropic({
apiKey: 'local-fixture-only',
baseURL: `http://127.0.0.1:${server.address().port}/v1`,
});
const model = withHeadroom(provider('claude-3-7-sonnet-20250219'), {
baseUrl: process.env.HEADROOM_BASE_URL, fallback: false, retries: 0,
model: 'claude-3-7-sonnet-20250219',
});
const result = await model.doGenerate({
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Return the name Ada as JSON.' }] }],
maxOutputTokens: 2048,
responseFormat: { type: 'json', schema: {
type: 'object', properties: { name: { type: 'string' } },
required: ['name'], additionalProperties: false,
} },
providerOptions: { anthropic: { thinking: { type: 'enabled', budgetTokens: 1024 } } },
});
assert.equal(calls.length, 1);
assert.equal(calls[0].body.thinking.type, 'enabled');
assert.ok(calls[0].body.tools?.some(tool => tool.name === 'json'));
const text = result.content.filter(part => part.type === 'text').map(part => part.text).join('');
assert.equal(text, '{"name":"Ada"}');
console.log('PASS: real provider + Headroom middleware + real compression HTTP path preserve final JSON text without a tool call');
}
const beforeOpenAI = calls.length;
let credentialCalls = 0;
const openai = createOpenAI({
apiKey: async () => `local-fixture-${++credentialCalls}`,
baseURL: `http://127.0.0.1:${server.address().port}/v1`,
});
const wrapped = withHeadroom(openai.chat('gpt-4o'), {
baseUrl: process.env.HEADROOM_BASE_URL, fallback: false, retries: 0,
});
for (let index = 1; index <= 2; index++) {
const result = await wrapped.doGenerate({
prompt: [{ role: 'user', content: [{ type: 'text', text: 'Say hello.' }] }],
maxOutputTokens: 128,
});
assert.equal(result.content.find(part => part.type === 'text').text, 'fixture answer');
assert.equal(calls[beforeOpenAI + index - 1].authorization, `Bearer local-fixture-${index}`);
}
assert.equal(credentialCalls, 2);
console.log('PASS: real OpenAI provider resolves async credentials separately for both wrapped requests');
const native = withOpenAIHeadroom(new OpenAI({
apiKey: 'local-native-fixture', baseURL: `http://127.0.0.1:${server.address().port}/v1`,
}), { baseUrl: process.env.HEADROOM_BASE_URL, fallback: false, retries: 0 });
const completion = await native.chat.completions.create({
model: 'gpt-4o', messages: [{ role: 'user', content: 'Say hello.' }],
});
assert.equal(completion.choices[0].message.content, 'fixture answer');
assert.equal(calls.length, beforeOpenAI + 3);
console.log('PASS: native OpenAI SDK chat client completes a real HTTP request through the Headroom adapter');
} finally {
server.closeAllConnections();
await new Promise(resolve => server.close(resolve));
}
+75
View File
@@ -0,0 +1,75 @@
import os
import socket
import subprocess
import sys
import tempfile
import threading
import time
from pathlib import Path
os.environ["HEADROOM_SKIP_UPSTREAM_CHECK"] = "1"
os.environ["HEADROOM_DISTRIBUTION"] = "local"
os.environ["HF_HUB_DISABLE_TELEMETRY"] = "1"
root = Path(sys.argv[1]) if len(sys.argv) > 1 else Path(__file__).resolve().parents[1]
state = tempfile.TemporaryDirectory(prefix="headroom-sdk-proof-")
os.environ["HEADROOM_WORKSPACE_DIR"] = state.name
os.environ["HEADROOM_CONFIG_DIR"] = str(Path(state.name) / "config")
sys.path.insert(0, str(root))
import uvicorn
from headroom.proxy.server import ProxyConfig, create_app
app = create_app(
ProxyConfig(
optimize=True,
cache_enabled=False,
rate_limit_enabled=False,
cost_tracking_enabled=False,
log_requests=False,
ccr_inject_tool=False,
ccr_handle_responses=False,
ccr_context_tracking=False,
image_optimize=False,
disable_kompress=True,
subscription_tracking_enabled=False,
stateless=True,
)
)
seen = []
@app.middleware("http")
async def count_compress(request, call_next):
response = await call_next(request)
if request.url.path == "/v1/compress":
seen.append(response.status_code)
return response
listener = socket.socket()
listener.bind(("127.0.0.1", 0))
port = listener.getsockname()[1]
server = uvicorn.Server(uvicorn.Config(app, log_level="warning"))
thread = threading.Thread(target=server.run, kwargs={"sockets": [listener]}, daemon=True)
thread.start()
try:
for _ in range(300):
if server.started:
break
if not thread.is_alive():
raise RuntimeError("proxy stopped before startup")
time.sleep(0.1)
assert server.started
env = dict(os.environ, HEADROOM_BASE_URL=f"http://127.0.0.1:{port}")
command = ["node", str(Path(__file__).with_suffix(".mjs")), str(root / "sdk/typescript")]
if len(sys.argv) > 2:
command.append(sys.argv[2])
result = subprocess.run(command, env=env)
assert seen and all(status == 200 for status in seen), seen
print("Real Headroom /v1/compress response:", seen, flush=True)
raise SystemExit(result.returncode)
finally:
server.should_exit = True
thread.join(timeout=15)
listener.close()
state.cleanup()
+41 -41
View File
@@ -9,14 +9,14 @@
"version": "0.42.0",
"license": "Apache-2.0",
"devDependencies": {
"@ai-sdk/anthropic": "^4.0.53",
"@ai-sdk/openai": "^4.0.60",
"@ai-sdk/provider": "^4.0.14",
"@ai-sdk/anthropic": "^4.0.94",
"@ai-sdk/openai": "^4.0.106",
"@ai-sdk/provider": "^4.0.35",
"@anthropic-ai/sdk": "^0.133.0",
"@types/node": "^26.5.0",
"ai": "^7.0.59",
"@types/node": "^26.6.6",
"ai": "^7.0.159",
"dotenv": "^18.0.1",
"openai": "^7.10.0",
"openai": "^7.46.0",
"tsup": "^8.0.0",
"typescript": "^6.0.3",
"vitest": "^5.0.0"
@@ -46,14 +46,14 @@
}
},
"node_modules/@ai-sdk/anthropic": {
"version": "4.0.87",
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.87.tgz",
"integrity": "sha512-x55N7G47mh9p38C2a6qMAzmUxlgKDCXoE9ohRaF4D3hcOGQrYIOZZ/9Iv4Uf9/OxlNDog9Yz4YPX2GL1+otGlg==",
"version": "4.0.94",
"resolved": "https://registry.npmjs.org/@ai-sdk/anthropic/-/anthropic-4.0.94.tgz",
"integrity": "sha512-gD0KmsUZTRuhiYleM2SdMrY0c7m+VeRckLX2VVPnEAlQmaKqSw8+noHiK5ED+SHy4tuDf9VQqcHxlGeObzMNyw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "4.0.33",
"@ai-sdk/provider-utils": "5.0.67"
"@ai-sdk/provider": "4.0.35",
"@ai-sdk/provider-utils": "5.0.72"
},
"engines": {
"node": ">=22"
@@ -63,14 +63,14 @@
}
},
"node_modules/@ai-sdk/gateway": {
"version": "4.0.125",
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.125.tgz",
"integrity": "sha512-9raNdkENebDxVl4piGntpQgOBHB62K1rC87KceV8kkGOc/g7s6lwbxN7C6QTqXYJaM+h1Lnm64MDgnHAmzUApg==",
"version": "4.0.132",
"resolved": "https://registry.npmjs.org/@ai-sdk/gateway/-/gateway-4.0.132.tgz",
"integrity": "sha512-ppStDEz96g+JEuxGiVTP29OKBjPyYZXRxs38wnq3427U2QbZtxe6TukrgSAAq0n4yaHvSvVAWJY9kBlW8XudYg==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "4.0.33",
"@ai-sdk/provider-utils": "5.0.67",
"@ai-sdk/provider": "4.0.35",
"@ai-sdk/provider-utils": "5.0.72",
"@vercel/oidc": "3.2.0"
},
"engines": {
@@ -81,14 +81,14 @@
}
},
"node_modules/@ai-sdk/openai": {
"version": "4.0.101",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.101.tgz",
"integrity": "sha512-GZ57KdfEfdHcM+Kkf1KsXq8T2KM2uG6BwPvWzL25F5uKjozpflol6hjxveKEf9v9YtbaKYi+t1PeaQ1g0jOThw==",
"version": "4.0.106",
"resolved": "https://registry.npmjs.org/@ai-sdk/openai/-/openai-4.0.106.tgz",
"integrity": "sha512-xBhSJCrgeTMZ4kCKABX8BJFtp5ZIJSS2qxvGMALA34TMyR6OVMe93cpU0mGWPFaVwPsWy2DWKb5+x7gkJ9SJ8w==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "4.0.33",
"@ai-sdk/provider-utils": "5.0.67"
"@ai-sdk/provider": "4.0.35",
"@ai-sdk/provider-utils": "5.0.72"
},
"engines": {
"node": ">=22"
@@ -98,9 +98,9 @@
}
},
"node_modules/@ai-sdk/provider": {
"version": "4.0.33",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.33.tgz",
"integrity": "sha512-C6ylMuAXjgqKJllp6ODIJwUltK/tm3ZmIj4V2fqENP3Y8gif2DyeJSsTcDwFrXppgEKcrBisi/BWx2tYeoeCAw==",
"version": "4.0.35",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider/-/provider-4.0.35.tgz",
"integrity": "sha512-yBz6fmLS8MSCIzy7NiHEUAq56ZLD4ZA1GR6bpXBxgbwUacP1La7LuwAr/xy9jSzthem4F8Xu2OrhvU/JrE9fYA==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
@@ -111,13 +111,13 @@
}
},
"node_modules/@ai-sdk/provider-utils": {
"version": "5.0.67",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.67.tgz",
"integrity": "sha512-EUzV6GXutGcesWKOY8tRKgijfuv1LUBpqAquMh5k0n74NCjDbca5d5ZG12qhVtM2X5UwM4B2ZMP2XpnAwZlA8Q==",
"version": "5.0.72",
"resolved": "https://registry.npmjs.org/@ai-sdk/provider-utils/-/provider-utils-5.0.72.tgz",
"integrity": "sha512-M6QAztI84jWumQSvKcGOL91DxhChsWxn3D3gYtV0/7E1TPQg9BmLdIerOolUC/jghQbMlQrHyzp0hqdIhUZ2Rw==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/provider": "4.0.33",
"@ai-sdk/provider": "4.0.35",
"@standard-schema/spec": "^1.1.0",
"@workflow/serde": "4.1.0",
"eventsource-parser": "^3.0.8",
@@ -1340,9 +1340,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "26.6.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.5.tgz",
"integrity": "sha512-uMzsv9stDdofIZBx4UGh4Z9ZgXnGC9seRDscilBcTHAeOFk67MZg/k9bWVfO+bk4qZmG+l52hRnLwUiH2LnJTg==",
"version": "26.6.6",
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.6.tgz",
"integrity": "sha512-MzQj+8Kx3XI40OmUAE6Qoh58ZMNstNNMwn2nfd3qWsfe7nDNSqJNzes4njhz6AHwrSHOffSLwXU6yb474Q4aog==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1428,15 +1428,15 @@
}
},
"node_modules/ai": {
"version": "7.0.152",
"resolved": "https://registry.npmjs.org/ai/-/ai-7.0.152.tgz",
"integrity": "sha512-cxQaE/17qhgqJcLCespbnyaN3c4IkGuNUtBXKSX1yTvlSsQ7ERV2ygFADMG7d+IWCUuvi7R8DrqAy9DGj0cgkg==",
"version": "7.0.159",
"resolved": "https://registry.npmjs.org/ai/-/ai-7.0.159.tgz",
"integrity": "sha512-4e/BwDoKJlMNYZaqERcTbGte+4TwroN9qKnCprog/XVfD9InzVPlhCviDhN452JIRrRsYg9BT0WsQ2C3Ds2mVQ==",
"dev": true,
"license": "Apache-2.0",
"dependencies": {
"@ai-sdk/gateway": "4.0.125",
"@ai-sdk/provider": "4.0.33",
"@ai-sdk/provider-utils": "5.0.67"
"@ai-sdk/gateway": "4.0.132",
"@ai-sdk/provider": "4.0.35",
"@ai-sdk/provider-utils": "5.0.72"
},
"engines": {
"node": ">=22"
@@ -2150,9 +2150,9 @@
}
},
"node_modules/openai": {
"version": "7.43.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-7.43.0.tgz",
"integrity": "sha512-fBjKaDFG8AVfkGYoIo/E+xNRlNk7nx2nQ9GoQtXfePzPjg4QcT6nejkhXayJnEwSpFGfthOrAPI2KXj5yAqg9A==",
"version": "7.46.0",
"resolved": "https://registry.npmjs.org/openai/-/openai-7.46.0.tgz",
"integrity": "sha512-FmbPcDtc0BTCN7ZQ5SBEnC4lPNMEUjA6w/lRkbh7l9IzWx1Mue6P7OEU2cayp5S5YjLuc7VEUfBCYqoQpb6+1w==",
"dev": true,
"license": "Apache-2.0",
"engines": {
@@ -2162,7 +2162,7 @@
"@aws-sdk/credential-provider-node": ">=3.972.0 <4",
"@smithy/hash-node": ">=4.3.0 <5",
"@smithy/signature-v4": ">=5.4.0 <6",
"google-auth-library": ">=9.15.1 <11",
"google-auth-library": ">=9.15.1 <12",
"undici": ">=5 <9",
"ws": "^8.21.0",
"zod": "^3.25 || ^4.0"
+6 -6
View File
@@ -120,14 +120,14 @@
}
},
"devDependencies": {
"@ai-sdk/anthropic": "^4.0.53",
"@ai-sdk/openai": "^4.0.60",
"@ai-sdk/provider": "^4.0.14",
"@ai-sdk/anthropic": "^4.0.94",
"@ai-sdk/openai": "^4.0.106",
"@ai-sdk/provider": "^4.0.35",
"@anthropic-ai/sdk": "^0.133.0",
"@types/node": "^26.5.0",
"ai": "^7.0.59",
"@types/node": "^26.6.6",
"ai": "^7.0.159",
"dotenv": "^18.0.1",
"openai": "^7.10.0",
"openai": "^7.46.0",
"tsup": "^8.0.0",
"typescript": "^6.0.3",
"vitest": "^5.0.0"