pi-openai-toolkit 0.17.2 → 0.17.3
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
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { ASTRA_MODEL_ID } from "../types";
|
|
3
|
-
import { CODEX_CLIENT_VERSION } from "../responses-headers";
|
|
4
3
|
import {
|
|
5
4
|
getEffortControlState,
|
|
6
5
|
planStableEffort,
|
|
@@ -101,20 +100,6 @@ export function registerCodexAstraExtension(pi: ExtensionAPI): void {
|
|
|
101
100
|
return undefined;
|
|
102
101
|
}
|
|
103
102
|
});
|
|
104
|
-
|
|
105
|
-
pi.on("before_provider_headers", (event, ctx) => {
|
|
106
|
-
try {
|
|
107
|
-
const model = ctx.model;
|
|
108
|
-
if (!model || model.api !== "openai-codex-responses") return;
|
|
109
|
-
// Live requests need the same backend version gate as our synthetic
|
|
110
|
-
// ones: an old or missing `version` never reaches gated SKUs.
|
|
111
|
-
if (!event.headers.version) {
|
|
112
|
-
event.headers.version = CODEX_CLIENT_VERSION;
|
|
113
|
-
}
|
|
114
|
-
} catch {
|
|
115
|
-
// Header injection is best-effort.
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
103
|
}
|
|
119
104
|
|
|
120
105
|
export default function codexAstraExtension(pi: ExtensionAPI): void {
|
|
@@ -146,7 +146,6 @@ export function codexContextProviderHeaders(
|
|
|
146
146
|
headers.set("ChatGPT-Account-ID", provider.accountId);
|
|
147
147
|
headers.set("originator", CODEX_TOOL_ORIGINATOR);
|
|
148
148
|
headers.set("User-Agent", userAgent(CODEX_TOOL_VERSION));
|
|
149
|
-
headers.set("version", CODEX_TOOL_VERSION);
|
|
150
149
|
} else {
|
|
151
150
|
headers.set("Authorization", `Bearer ${provider.apiKey}`);
|
|
152
151
|
headers.delete("ChatGPT-Account-ID");
|
package/src/responses-headers.ts
CHANGED
|
@@ -90,11 +90,9 @@ export function buildCodexCliUserAgent(version: string): string {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
* requests that name it. Keep this in sync with the newest gate Oh My Pi pins
|
|
97
|
-
* in @oh-my-pi/pi-wire/codex (`CODEX_CLIENT_VERSION`).
|
|
93
|
+
* Codex client identity used by synthetic gateway requests in their User-Agent.
|
|
94
|
+
* Native live and context-management requests do not generate a `version`
|
|
95
|
+
* header; explicitly configured provider values remain caller-owned.
|
|
98
96
|
*/
|
|
99
97
|
export const CODEX_CLIENT_VERSION = "0.153.0";
|
|
100
98
|
|
|
@@ -148,8 +146,6 @@ export function buildResponsesRequestHeaders(
|
|
|
148
146
|
headers.set("originator", "pi");
|
|
149
147
|
headers.set("user-agent", buildCodexUserAgent());
|
|
150
148
|
headers.set("openai-beta", "responses=experimental");
|
|
151
|
-
// Preserve the existing native Codex compatibility pin.
|
|
152
|
-
headers.set("version", CODEX_CLIENT_VERSION);
|
|
153
149
|
}
|
|
154
150
|
// Gateways own their version policy. Explicit versions still pass through
|
|
155
151
|
// the header merge and allowlist, but Toolkit does not generate one.
|