pi-openai-toolkit 0.17.0 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -153,7 +153,8 @@ export function codexContextProviderHeaders(
|
|
|
153
153
|
headers.delete("Cookie");
|
|
154
154
|
headers.set("originator", CODEX_GATEWAY_ORIGINATOR);
|
|
155
155
|
headers.set("User-Agent", userAgent(CODEX_CLIENT_VERSION));
|
|
156
|
-
|
|
156
|
+
// Let the gateway own its version policy; preserve an explicitly configured
|
|
157
|
+
// version already copied from provider.headers above.
|
|
157
158
|
headers.set("X-Codex-Affinity-Scope", CODEX_AFFINITY_SCOPE);
|
|
158
159
|
headers.set("X-Codex-Model", provider.model);
|
|
159
160
|
}
|
package/src/extension-runtime.ts
CHANGED
|
@@ -1378,11 +1378,12 @@ export default function registerCompactionExtension(
|
|
|
1378
1378
|
for (const existing of Object.keys(event.headers)) {
|
|
1379
1379
|
if (!allowedGatewayHeaders.has(existing.toLowerCase())) delete event.headers[existing];
|
|
1380
1380
|
}
|
|
1381
|
+
// Keep any caller-supplied version without forcing a Toolkit pin.
|
|
1382
|
+
// The gateway allowlist above already permits it.
|
|
1381
1383
|
for (const name of [
|
|
1382
1384
|
"authorization",
|
|
1383
1385
|
"originator",
|
|
1384
1386
|
"user-agent",
|
|
1385
|
-
"version",
|
|
1386
1387
|
"session-id",
|
|
1387
1388
|
"x-client-request-id",
|
|
1388
1389
|
"x-codex-affinity-scope",
|
package/src/responses-headers.ts
CHANGED
|
@@ -148,10 +148,11 @@ export function buildResponsesRequestHeaders(
|
|
|
148
148
|
headers.set("originator", "pi");
|
|
149
149
|
headers.set("user-agent", buildCodexUserAgent());
|
|
150
150
|
headers.set("openai-beta", "responses=experimental");
|
|
151
|
+
// Preserve the existing native Codex compatibility pin.
|
|
152
|
+
headers.set("version", CODEX_CLIENT_VERSION);
|
|
151
153
|
}
|
|
152
|
-
//
|
|
153
|
-
//
|
|
154
|
-
headers.set("version", CODEX_CLIENT_VERSION);
|
|
154
|
+
// Gateways own their version policy. Explicit versions still pass through
|
|
155
|
+
// the header merge and allowlist, but Toolkit does not generate one.
|
|
155
156
|
// Prompt-cache/session affinity rides on the conversation identity. The
|
|
156
157
|
// gateway path also uses the bare model hint above so NEWapi can route
|
|
157
158
|
// context/compact requests without inspecting their body.
|