@opengeni/codex 0.2.1 → 0.2.2

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/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 Cloudgeni-ai
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -12,13 +12,17 @@ var CODEX_ID_TOKEN_AUTH_CLAIM = "https://api.openai.com/auth";
12
12
  var CODEX_PROVIDER_ID = "codex-subscription";
13
13
  var CODEX_PROVIDER_BASE_URL = "https://chatgpt.com/backend-api";
14
14
  var CODEX_MODEL_ID_PREFIX = "codex/";
15
- var CODEX_FALLBACK_MODEL_SLUGS = [
16
- "gpt-5.5",
17
- "gpt-5.4",
18
- "gpt-5.4-mini",
19
- "gpt-5.3-codex-spark"
20
- ];
21
- var CODEX_CLIENT_VERSION = "0.142.4";
15
+ var CODEX_FALLBACK_MODEL_SLUGS = ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"];
16
+ var CODEX_MODEL_CONTEXT_WINDOW_TOKENS = 272e3;
17
+ var CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT = 95;
18
+ var CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS = Math.floor(
19
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS * CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT / 100
20
+ );
21
+ var CODEX_AUTO_COMPACTION_PERCENT = 90;
22
+ var CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT = Math.floor(
23
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS * CODEX_AUTO_COMPACTION_PERCENT / 100
24
+ );
25
+ var CODEX_CLIENT_VERSION = "0.144.4";
22
26
  var CODEX_REFRESH_WINDOW_MS = 5 * 60 * 1e3;
23
27
  var CODEX_REFRESH_FALLBACK_MS = 8 * 24 * 60 * 60 * 1e3;
24
28
  var CODEX_APPS_MCP_SERVER_ID = "codex_apps";
@@ -42,6 +46,11 @@ export {
42
46
  CODEX_PROVIDER_BASE_URL,
43
47
  CODEX_MODEL_ID_PREFIX,
44
48
  CODEX_FALLBACK_MODEL_SLUGS,
49
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS,
50
+ CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT,
51
+ CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS,
52
+ CODEX_AUTO_COMPACTION_PERCENT,
53
+ CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT,
45
54
  CODEX_CLIENT_VERSION,
46
55
  CODEX_REFRESH_WINDOW_MS,
47
56
  CODEX_REFRESH_FALLBACK_MS,
@@ -51,4 +60,4 @@ export {
51
60
  CODEX_APPS_STARTUP_TIMEOUT_MS,
52
61
  CODEX_APPS_REQUIRED_SCOPES
53
62
  };
54
- //# sourceMappingURL=chunk-2ESTGQ57.js.map
63
+ //# sourceMappingURL=chunk-KKKJKW6M.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts"],"sourcesContent":["// Wire constants for the ChatGPT/Codex subscription backend.\n// Source: CODEX-SUBSCRIPTION-SPEC.md (verified against openai/codex codex-rs).\n\nexport const CODEX_ISSUER = \"https://auth.openai.com\";\nexport const CODEX_CLIENT_ID = \"app_EMoamEEZ73f0CkXaXp7hrann\"; // spec §1.1 (manager.rs:1444)\nexport const CODEX_AUTH_BASE = `${CODEX_ISSUER}/api/accounts`; // device endpoints (device_code_auth.rs:164)\nexport const CODEX_TOKEN_URL = `${CODEX_ISSUER}/oauth/token`; // exchange (form) + refresh (json)\nexport const CODEX_DEVICE_VERIFICATION_URL = `${CODEX_ISSUER}/codex/device`;\nexport const CODEX_DEVICE_REDIRECT_URI = `${CODEX_ISSUER}/deviceauth/callback`;\n\n// Model requests: base already includes /codex; client appends /responses, /models.\nexport const CODEX_RESPONSES_BASE = \"https://chatgpt.com/backend-api/codex\";\n// Usage lives on the WHAM base — NOT under /codex (verified, spec §1.8a).\nexport const CODEX_WHAM_BASE = \"https://chatgpt.com/backend-api\";\n\nexport const CODEX_ORIGINATOR = \"codex_cli_rs\"; // whitelisted originator (spec §1.2)\nexport const CODEX_ID_TOKEN_AUTH_CLAIM = \"https://api.openai.com/auth\";\n\n// Synthetic registry-provider identity. The provider's baseURL is the bare\n// /backend-api (NOT /codex) — codexSubscriptionFetch rewrites /responses ->\n// /codex/responses. Codex model ids are namespaced `codex/<slug>` so they never\n// collide with the built-in OpenAI provider's model ids; the fetch's resolveModel\n// strips the prefix before the slug reaches the backend.\nexport const CODEX_PROVIDER_ID = \"codex-subscription\";\nexport const CODEX_PROVIDER_BASE_URL = \"https://chatgpt.com/backend-api\";\nexport const CODEX_MODEL_ID_PREFIX = \"codex/\";\n\n// The only Codex subscription models OpenGeni exposes. The live GET /models\n// catalog must contain every exact slug; older or internal models never broaden\n// this product allowlist.\nexport const CODEX_FALLBACK_MODEL_SLUGS = [\"gpt-5.6-sol\", \"gpt-5.6-terra\", \"gpt-5.6-luna\"] as const;\n\n// Live Codex model-catalog values for every exposed gpt-5.6 subscription slug.\n// Verified 2026-07-14 against Codex CLI 0.144.4's freshly fetched\n// ~/.codex/models_cache.json and the matching openai/codex core derivations:\n// raw context window = 272,000\n// effective input window (95%) = 258,400\n// automatic compaction limit (90%) = 244,800\n// Keep all three explicit: the effective ceiling is a hard input guard while\n// the lower auto-compact limit is the proactive checkpoint trigger.\nexport const CODEX_MODEL_CONTEXT_WINDOW_TOKENS = 272_000;\nexport const CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT = 95;\nexport const CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS = Math.floor(\n (CODEX_MODEL_CONTEXT_WINDOW_TOKENS * CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT) / 100,\n);\nexport const CODEX_AUTO_COMPACTION_PERCENT = 90;\nexport const CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT = Math.floor(\n (CODEX_MODEL_CONTEXT_WINDOW_TOKENS * CODEX_AUTO_COMPACTION_PERCENT) / 100,\n);\n\n// Sent as the `version` header and inside the User-Agent. Staging-proven on\n// 2026-07-09: 0.142.4 filtered every GPT-5.6 slug out of GET /models, while the\n// official Codex 0.144.0+ releases return all three exact slugs above. Keep\n// this pinned to the latest stable Codex release we have verified end-to-end.\nexport const CODEX_CLIENT_VERSION = \"0.144.4\";\n\nexport const CODEX_REFRESH_WINDOW_MS = 5 * 60 * 1000; // proactive refresh when within 5 min of exp (spec §1.1)\nexport const CODEX_REFRESH_FALLBACK_MS = 8 * 24 * 60 * 60 * 1000; // 8 days when exp is unparseable\n\n// ── Apps / connectors MCP (spec §1.10, §E) ───────────────────────────────────\n// One server-side MCP exposes ALL the user's ChatGPT/Codex connectors\n// (gmail/github/linear/slack/sentry/drive/calendar/…). Streamable HTTP, always.\nexport const CODEX_APPS_MCP_SERVER_ID = \"codex_apps\"; // tools surface as mcp__codex_apps__<tool>\nexport const CODEX_APPS_MCP_SERVER_NAME = \"codex_apps\"; // MCP `name` — MUST equal the id so the SDK namespaces tools as mcp__codex_apps__*\nexport const CODEX_APPS_MCP_URL = \"https://chatgpt.com/backend-api/ps/mcp\"; // live URL (NOT /codex, NOT the legacy /wham/apps)\nexport const CODEX_APPS_STARTUP_TIMEOUT_MS = 30_000; // startup_timeout 30s (spec §1.10) — maps to timeoutMs on this server only\n// Connector scopes that the apps MCP requires. Present ONLY when granted at\n// browser-authorize time; the device-code path CANNOT be confirmed to grant\n// them, so treat connector availability as runtime-discovered (spec §1.10 / §E).\nexport const CODEX_APPS_REQUIRED_SCOPES = [\"api.connectors.read\", \"api.connectors.invoke\"] as const;\n"],"mappings":";AAGO,IAAM,eAAe;AACrB,IAAM,kBAAkB;AACxB,IAAM,kBAAkB,GAAG,YAAY;AACvC,IAAM,kBAAkB,GAAG,YAAY;AACvC,IAAM,gCAAgC,GAAG,YAAY;AACrD,IAAM,4BAA4B,GAAG,YAAY;AAGjD,IAAM,uBAAuB;AAE7B,IAAM,kBAAkB;AAExB,IAAM,mBAAmB;AACzB,IAAM,4BAA4B;AAOlC,IAAM,oBAAoB;AAC1B,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAK9B,IAAM,6BAA6B,CAAC,eAAe,iBAAiB,cAAc;AAUlF,IAAM,oCAAoC;AAC1C,IAAM,yCAAyC;AAC/C,IAAM,8CAA8C,KAAK;AAAA,EAC7D,oCAAoC,yCAA0C;AACjF;AACO,IAAM,gCAAgC;AACtC,IAAM,uCAAuC,KAAK;AAAA,EACtD,oCAAoC,gCAAiC;AACxE;AAMO,IAAM,uBAAuB;AAE7B,IAAM,0BAA0B,IAAI,KAAK;AACzC,IAAM,4BAA4B,IAAI,KAAK,KAAK,KAAK;AAKrD,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,qBAAqB;AAC3B,IAAM,gCAAgC;AAItC,IAAM,6BAA6B,CAAC,uBAAuB,uBAAuB;","names":[]}
@@ -11,8 +11,13 @@ declare const CODEX_ID_TOKEN_AUTH_CLAIM = "https://api.openai.com/auth";
11
11
  declare const CODEX_PROVIDER_ID = "codex-subscription";
12
12
  declare const CODEX_PROVIDER_BASE_URL = "https://chatgpt.com/backend-api";
13
13
  declare const CODEX_MODEL_ID_PREFIX = "codex/";
14
- declare const CODEX_FALLBACK_MODEL_SLUGS: readonly ["gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.3-codex-spark"];
15
- declare const CODEX_CLIENT_VERSION = "0.142.4";
14
+ declare const CODEX_FALLBACK_MODEL_SLUGS: readonly ["gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna"];
15
+ declare const CODEX_MODEL_CONTEXT_WINDOW_TOKENS = 272000;
16
+ declare const CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT = 95;
17
+ declare const CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS: number;
18
+ declare const CODEX_AUTO_COMPACTION_PERCENT = 90;
19
+ declare const CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT: number;
20
+ declare const CODEX_CLIENT_VERSION = "0.144.4";
16
21
  declare const CODEX_REFRESH_WINDOW_MS: number;
17
22
  declare const CODEX_REFRESH_FALLBACK_MS: number;
18
23
  declare const CODEX_APPS_MCP_SERVER_ID = "codex_apps";
@@ -21,4 +26,4 @@ declare const CODEX_APPS_MCP_URL = "https://chatgpt.com/backend-api/ps/mcp";
21
26
  declare const CODEX_APPS_STARTUP_TIMEOUT_MS = 30000;
22
27
  declare const CODEX_APPS_REQUIRED_SCOPES: readonly ["api.connectors.read", "api.connectors.invoke"];
23
28
 
24
- export { CODEX_APPS_MCP_SERVER_ID, CODEX_APPS_MCP_SERVER_NAME, CODEX_APPS_MCP_URL, CODEX_APPS_REQUIRED_SCOPES, CODEX_APPS_STARTUP_TIMEOUT_MS, CODEX_AUTH_BASE, CODEX_CLIENT_ID, CODEX_CLIENT_VERSION, CODEX_DEVICE_REDIRECT_URI, CODEX_DEVICE_VERIFICATION_URL, CODEX_FALLBACK_MODEL_SLUGS, CODEX_ID_TOKEN_AUTH_CLAIM, CODEX_ISSUER, CODEX_MODEL_ID_PREFIX, CODEX_ORIGINATOR, CODEX_PROVIDER_BASE_URL, CODEX_PROVIDER_ID, CODEX_REFRESH_FALLBACK_MS, CODEX_REFRESH_WINDOW_MS, CODEX_RESPONSES_BASE, CODEX_TOKEN_URL, CODEX_WHAM_BASE };
29
+ export { CODEX_APPS_MCP_SERVER_ID, CODEX_APPS_MCP_SERVER_NAME, CODEX_APPS_MCP_URL, CODEX_APPS_REQUIRED_SCOPES, CODEX_APPS_STARTUP_TIMEOUT_MS, CODEX_AUTH_BASE, CODEX_AUTO_COMPACTION_PERCENT, CODEX_CLIENT_ID, CODEX_CLIENT_VERSION, CODEX_DEVICE_REDIRECT_URI, CODEX_DEVICE_VERIFICATION_URL, CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT, CODEX_FALLBACK_MODEL_SLUGS, CODEX_ID_TOKEN_AUTH_CLAIM, CODEX_ISSUER, CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT, CODEX_MODEL_CONTEXT_WINDOW_TOKENS, CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS, CODEX_MODEL_ID_PREFIX, CODEX_ORIGINATOR, CODEX_PROVIDER_BASE_URL, CODEX_PROVIDER_ID, CODEX_REFRESH_FALLBACK_MS, CODEX_REFRESH_WINDOW_MS, CODEX_RESPONSES_BASE, CODEX_TOKEN_URL, CODEX_WHAM_BASE };
package/dist/constants.js CHANGED
@@ -5,13 +5,18 @@ import {
5
5
  CODEX_APPS_REQUIRED_SCOPES,
6
6
  CODEX_APPS_STARTUP_TIMEOUT_MS,
7
7
  CODEX_AUTH_BASE,
8
+ CODEX_AUTO_COMPACTION_PERCENT,
8
9
  CODEX_CLIENT_ID,
9
10
  CODEX_CLIENT_VERSION,
10
11
  CODEX_DEVICE_REDIRECT_URI,
11
12
  CODEX_DEVICE_VERIFICATION_URL,
13
+ CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT,
12
14
  CODEX_FALLBACK_MODEL_SLUGS,
13
15
  CODEX_ID_TOKEN_AUTH_CLAIM,
14
16
  CODEX_ISSUER,
17
+ CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT,
18
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS,
19
+ CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS,
15
20
  CODEX_MODEL_ID_PREFIX,
16
21
  CODEX_ORIGINATOR,
17
22
  CODEX_PROVIDER_BASE_URL,
@@ -21,7 +26,7 @@ import {
21
26
  CODEX_RESPONSES_BASE,
22
27
  CODEX_TOKEN_URL,
23
28
  CODEX_WHAM_BASE
24
- } from "./chunk-2ESTGQ57.js";
29
+ } from "./chunk-KKKJKW6M.js";
25
30
  export {
26
31
  CODEX_APPS_MCP_SERVER_ID,
27
32
  CODEX_APPS_MCP_SERVER_NAME,
@@ -29,13 +34,18 @@ export {
29
34
  CODEX_APPS_REQUIRED_SCOPES,
30
35
  CODEX_APPS_STARTUP_TIMEOUT_MS,
31
36
  CODEX_AUTH_BASE,
37
+ CODEX_AUTO_COMPACTION_PERCENT,
32
38
  CODEX_CLIENT_ID,
33
39
  CODEX_CLIENT_VERSION,
34
40
  CODEX_DEVICE_REDIRECT_URI,
35
41
  CODEX_DEVICE_VERIFICATION_URL,
42
+ CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT,
36
43
  CODEX_FALLBACK_MODEL_SLUGS,
37
44
  CODEX_ID_TOKEN_AUTH_CLAIM,
38
45
  CODEX_ISSUER,
46
+ CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT,
47
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS,
48
+ CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS,
39
49
  CODEX_MODEL_ID_PREFIX,
40
50
  CODEX_ORIGINATOR,
41
51
  CODEX_PROVIDER_BASE_URL,
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { CODEX_APPS_MCP_SERVER_ID, CODEX_APPS_MCP_SERVER_NAME, CODEX_APPS_MCP_URL, CODEX_APPS_REQUIRED_SCOPES, CODEX_APPS_STARTUP_TIMEOUT_MS, CODEX_AUTH_BASE, CODEX_CLIENT_ID, CODEX_CLIENT_VERSION, CODEX_DEVICE_REDIRECT_URI, CODEX_DEVICE_VERIFICATION_URL, CODEX_FALLBACK_MODEL_SLUGS, CODEX_ID_TOKEN_AUTH_CLAIM, CODEX_ISSUER, CODEX_MODEL_ID_PREFIX, CODEX_ORIGINATOR, CODEX_PROVIDER_BASE_URL, CODEX_PROVIDER_ID, CODEX_REFRESH_FALLBACK_MS, CODEX_REFRESH_WINDOW_MS, CODEX_RESPONSES_BASE, CODEX_TOKEN_URL, CODEX_WHAM_BASE } from './constants.js';
1
+ export { CODEX_APPS_MCP_SERVER_ID, CODEX_APPS_MCP_SERVER_NAME, CODEX_APPS_MCP_URL, CODEX_APPS_REQUIRED_SCOPES, CODEX_APPS_STARTUP_TIMEOUT_MS, CODEX_AUTH_BASE, CODEX_AUTO_COMPACTION_PERCENT, CODEX_CLIENT_ID, CODEX_CLIENT_VERSION, CODEX_DEVICE_REDIRECT_URI, CODEX_DEVICE_VERIFICATION_URL, CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT, CODEX_FALLBACK_MODEL_SLUGS, CODEX_ID_TOKEN_AUTH_CLAIM, CODEX_ISSUER, CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT, CODEX_MODEL_CONTEXT_WINDOW_TOKENS, CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS, CODEX_MODEL_ID_PREFIX, CODEX_ORIGINATOR, CODEX_PROVIDER_BASE_URL, CODEX_PROVIDER_ID, CODEX_REFRESH_FALLBACK_MS, CODEX_REFRESH_WINDOW_MS, CODEX_RESPONSES_BASE, CODEX_TOKEN_URL, CODEX_WHAM_BASE } from './constants.js';
2
2
  import { AsyncLocalStorage } from 'node:async_hooks';
3
3
 
4
4
  /**
@@ -184,6 +184,19 @@ type CodexUsageHeaderSnapshot = {
184
184
  };
185
185
  type CodexRequestContext = {
186
186
  clientVersion: string;
187
+ /**
188
+ * Stable per-session affinity id, sent as the `session_id` header on every
189
+ * request. This is the backend's STICKY CACHE-ROUTING key — measured
190
+ * 2026-07-12 with byte-identical ~99k-token gpt-5.6-sol requests on one idle
191
+ * account: without the header, repeat requests hit the prompt cache ~50% of
192
+ * the time (a per-request routing lottery across cache shards; matches the
193
+ * prod fleet's 48.6%); with a stable session_id, 10/10 requests hit at the
194
+ * 99.0% ceiling — Codex CLI parity (the CLI always sends it; its own last-3d
195
+ * token-weighted rate here is 94%). `prompt_cache_key` in the body only
196
+ * influences routing and does NOT pin it. Use the SAME value as
197
+ * prompt_cache_key (the OpenGeni sessionId) so routing and cache key agree.
198
+ */
199
+ sessionId?: string;
187
200
  /** Worker-supplied: proactive refresh + single-flight + db persist. */
188
201
  getToken: () => Promise<CodexTokenSnapshot>;
189
202
  /** Forced refresh used for the 401 retry. */
@@ -201,6 +214,15 @@ type CodexRequestContext = {
201
214
  declare const codexRequestStorage: AsyncLocalStorage<CodexRequestContext>;
202
215
 
203
216
  type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
217
+ /**
218
+ * Internal provenance marker copied onto buffered non-OK Codex responses.
219
+ * OpenAI's APIError preserves response headers, which lets the worker
220
+ * distinguish a model-provider refusal from an unrelated sandbox/MCP HTTP
221
+ * error that happened during the same Codex turn.
222
+ */
223
+ declare const CODEX_TRANSPORT_ERROR_HEADER = "x-opengeni-codex-transport-error";
224
+ /** True only for an error produced from this Codex transport's non-OK response. */
225
+ declare function isCodexTransportError(error: unknown): boolean;
204
226
  /**
205
227
  * Multi-account P4 (Part A): scrape the full usage snapshot the codex backend
206
228
  * stamps on every `/codex/responses` response in `x-codex-primary-*` /
@@ -264,4 +286,4 @@ declare function remapToolCallRequestBody(body: string, mapper: ToolNameMapper):
264
286
  */
265
287
  declare function codexAppsSanitizingFetch(base?: FetchLike, namespaceSink?: Set<string>): FetchLike;
266
288
 
267
- export { CODEX_FIVE_HOUR_WINDOW_SECONDS, CODEX_USAGE_LIMIT_ERROR_TYPE, CODEX_WEEKLY_WINDOW_SECONDS, type CodexAdditionalLimit, type CodexAuthHeaders, CodexDeviceError, type CodexDeviceStart, type CodexFetch, type CodexPollResult, type CodexRefreshTokens, CodexRefreshTransient, CodexReloginRequired, type CodexRequestContext, type CodexTokenSnapshot, type CodexTokens, type CodexUsageHeaderSnapshot, type CodexUsageLimitInfo, type CodexUsagePayload, type CodexUsageStatus, type CodexUsageWindow, type FetchLike, ToolNameMapper, accessTokenExpiry, buildCodexUsageWindowFromCache, buildModelResolver, classifyCodexUsageLimitError, codexAppsSanitizingFetch, codexRequestStorage, codexSubscriptionFetch, decodeJwtPayload, exchangeDeviceCode, fetchCodexModels, fetchCodexUsage, isCodexBilledModel, normalizeCodexRequestBody, normalizeCodexUsage, parseCodexUsageHeaders, parseIdToken, pollDeviceCode, refreshCodexToken, remapToolCallRequestBody, sanitizeMcpJsonBody, sanitizeMcpSseBody, startDeviceCode };
289
+ export { CODEX_FIVE_HOUR_WINDOW_SECONDS, CODEX_TRANSPORT_ERROR_HEADER, CODEX_USAGE_LIMIT_ERROR_TYPE, CODEX_WEEKLY_WINDOW_SECONDS, type CodexAdditionalLimit, type CodexAuthHeaders, CodexDeviceError, type CodexDeviceStart, type CodexFetch, type CodexPollResult, type CodexRefreshTokens, CodexRefreshTransient, CodexReloginRequired, type CodexRequestContext, type CodexTokenSnapshot, type CodexTokens, type CodexUsageHeaderSnapshot, type CodexUsageLimitInfo, type CodexUsagePayload, type CodexUsageStatus, type CodexUsageWindow, type FetchLike, ToolNameMapper, accessTokenExpiry, buildCodexUsageWindowFromCache, buildModelResolver, classifyCodexUsageLimitError, codexAppsSanitizingFetch, codexRequestStorage, codexSubscriptionFetch, decodeJwtPayload, exchangeDeviceCode, fetchCodexModels, fetchCodexUsage, isCodexBilledModel, isCodexTransportError, normalizeCodexRequestBody, normalizeCodexUsage, parseCodexUsageHeaders, parseIdToken, pollDeviceCode, refreshCodexToken, remapToolCallRequestBody, sanitizeMcpJsonBody, sanitizeMcpSseBody, startDeviceCode };
package/dist/index.js CHANGED
@@ -5,13 +5,18 @@ import {
5
5
  CODEX_APPS_REQUIRED_SCOPES,
6
6
  CODEX_APPS_STARTUP_TIMEOUT_MS,
7
7
  CODEX_AUTH_BASE,
8
+ CODEX_AUTO_COMPACTION_PERCENT,
8
9
  CODEX_CLIENT_ID,
9
10
  CODEX_CLIENT_VERSION,
10
11
  CODEX_DEVICE_REDIRECT_URI,
11
12
  CODEX_DEVICE_VERIFICATION_URL,
13
+ CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT,
12
14
  CODEX_FALLBACK_MODEL_SLUGS,
13
15
  CODEX_ID_TOKEN_AUTH_CLAIM,
14
16
  CODEX_ISSUER,
17
+ CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT,
18
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS,
19
+ CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS,
15
20
  CODEX_MODEL_ID_PREFIX,
16
21
  CODEX_ORIGINATOR,
17
22
  CODEX_PROVIDER_BASE_URL,
@@ -21,7 +26,7 @@ import {
21
26
  CODEX_RESPONSES_BASE,
22
27
  CODEX_TOKEN_URL,
23
28
  CODEX_WHAM_BASE
24
- } from "./chunk-2ESTGQ57.js";
29
+ } from "./chunk-KKKJKW6M.js";
25
30
 
26
31
  // src/billing.ts
27
32
  function isCodexBilledModel(model) {
@@ -67,7 +72,11 @@ async function pollDeviceCode(input, fetchImpl = fetch) {
67
72
  });
68
73
  if (res.ok) {
69
74
  const body = await res.json();
70
- return { status: "authorized", authorizationCode: body.authorization_code, codeVerifier: body.code_verifier };
75
+ return {
76
+ status: "authorized",
77
+ authorizationCode: body.authorization_code,
78
+ codeVerifier: body.code_verifier
79
+ };
71
80
  }
72
81
  if (res.status === 403 || res.status === 404) {
73
82
  return { status: "pending" };
@@ -91,7 +100,11 @@ async function exchangeDeviceCode(input, fetchImpl = fetch) {
91
100
  throw new CodexDeviceError(`device code exchange failed with status ${res.status}`);
92
101
  }
93
102
  const body = await res.json();
94
- return { idToken: body.id_token, accessToken: body.access_token, refreshToken: body.refresh_token };
103
+ return {
104
+ idToken: body.id_token,
105
+ accessToken: body.access_token,
106
+ refreshToken: body.refresh_token
107
+ };
95
108
  }
96
109
 
97
110
  // src/refresh.ts
@@ -111,7 +124,11 @@ async function refreshCodexToken(refreshToken, fetchImpl = fetch) {
111
124
  const res = await fetchImpl(CODEX_TOKEN_URL, {
112
125
  method: "POST",
113
126
  headers: { "Content-Type": "application/json" },
114
- body: JSON.stringify({ client_id: CODEX_CLIENT_ID, grant_type: "refresh_token", refresh_token: refreshToken })
127
+ body: JSON.stringify({
128
+ client_id: CODEX_CLIENT_ID,
129
+ grant_type: "refresh_token",
130
+ refresh_token: refreshToken
131
+ })
115
132
  });
116
133
  const text = await res.text();
117
134
  if (!res.ok) {
@@ -121,12 +138,18 @@ async function refreshCodexToken(refreshToken, fetchImpl = fetch) {
121
138
  throw new CodexReloginRequired(msg);
122
139
  }
123
140
  if (res.status === 401) {
124
- throw new CodexReloginRequired("Your Codex session could not be refreshed. Please disconnect and sign in again.");
141
+ throw new CodexReloginRequired(
142
+ "Your Codex session could not be refreshed. Please disconnect and sign in again."
143
+ );
125
144
  }
126
145
  throw new CodexRefreshTransient(`Failed to refresh Codex token: ${res.status}`);
127
146
  }
128
147
  const body = JSON.parse(text);
129
- return { idToken: body.id_token, accessToken: body.access_token, refreshToken: body.refresh_token };
148
+ return {
149
+ idToken: body.id_token,
150
+ accessToken: body.access_token,
151
+ refreshToken: body.refresh_token
152
+ };
130
153
  }
131
154
  var PERMANENT_REFRESH_FAILURES = {
132
155
  refresh_token_expired: "Your Codex refresh token has expired. Please disconnect and sign in again.",
@@ -338,7 +361,10 @@ function pickWindows(primary, secondary) {
338
361
  let fiveHour = null;
339
362
  let weekly = null;
340
363
  const unplaced = [];
341
- for (const [slot, raw] of [["primary", primary], ["secondary", secondary]]) {
364
+ for (const [slot, raw] of [
365
+ ["primary", primary],
366
+ ["secondary", secondary]
367
+ ]) {
342
368
  const nw = normalizeWindow(raw);
343
369
  if (!nw) continue;
344
370
  if (nw.limitWindowSeconds === CODEX_WEEKLY_WINDOW_SECONDS) {
@@ -371,7 +397,10 @@ function normalizeCodexUsage(httpStatus, rawPayload) {
371
397
  return { ...base, status: "error" };
372
398
  }
373
399
  const rate = body.rate_limit ?? null;
374
- const { fiveHour, weekly } = pickWindows(rate?.primary_window ?? null, rate?.secondary_window ?? null);
400
+ const { fiveHour, weekly } = pickWindows(
401
+ rate?.primary_window ?? null,
402
+ rate?.secondary_window ?? null
403
+ );
375
404
  const limitReached = !!(rate?.limit_reached || rate?.allowed === false) || (fiveHour?.percent ?? 0) >= 100 || (weekly?.percent ?? 0) >= 100;
376
405
  const additionalLimits = body.additional_limits ? body.additional_limits.map((al) => {
377
406
  const windows = pickWindows(al.primary_window ?? null, al.secondary_window ?? null);
@@ -419,10 +448,13 @@ function subscriptionHeaders(a) {
419
448
  };
420
449
  }
421
450
  async function fetchCodexModels(a, fetchImpl = fetch) {
422
- const res = await fetchImpl(`${CODEX_RESPONSES_BASE}/models?client_version=${encodeURIComponent(a.clientVersion)}`, {
423
- method: "GET",
424
- headers: subscriptionHeaders(a)
425
- });
451
+ const res = await fetchImpl(
452
+ `${CODEX_RESPONSES_BASE}/models?client_version=${encodeURIComponent(a.clientVersion)}`,
453
+ {
454
+ method: "GET",
455
+ headers: subscriptionHeaders(a)
456
+ }
457
+ );
426
458
  if (!res.ok) {
427
459
  return { ok: false, status: res.status, slugs: [] };
428
460
  }
@@ -444,6 +476,25 @@ import { AsyncLocalStorage } from "async_hooks";
444
476
  var codexRequestStorage = new AsyncLocalStorage();
445
477
 
446
478
  // src/fetch.ts
479
+ var CODEX_TRANSPORT_ERROR_HEADER = "x-opengeni-codex-transport-error";
480
+ function headersCarryCodexTransportMarker(headers) {
481
+ if (!headers || typeof headers !== "object") return false;
482
+ const getter = headers.get;
483
+ if (typeof getter === "function") {
484
+ return getter.call(headers, CODEX_TRANSPORT_ERROR_HEADER) === "1";
485
+ }
486
+ const record = headers;
487
+ return record[CODEX_TRANSPORT_ERROR_HEADER] === "1" || record[CODEX_TRANSPORT_ERROR_HEADER.toLowerCase()] === "1";
488
+ }
489
+ function isCodexTransportError(error) {
490
+ let current = error;
491
+ for (let depth = 0; depth < 6 && current && typeof current === "object"; depth += 1) {
492
+ const value = current;
493
+ if (headersCarryCodexTransportMarker(value.headers)) return true;
494
+ current = value.cause;
495
+ }
496
+ return false;
497
+ }
447
498
  function parseIntHeader(value) {
448
499
  if (value === null) {
449
500
  return null;
@@ -471,9 +522,19 @@ function parseCodexUsageHeaders(headers) {
471
522
  const nowMs = Date.now();
472
523
  return {
473
524
  primaryUsedPercent,
474
- primaryResetAt: resolveResetAt(headers, "x-codex-primary-reset-at", "x-codex-primary-reset-after-seconds", nowMs),
525
+ primaryResetAt: resolveResetAt(
526
+ headers,
527
+ "x-codex-primary-reset-at",
528
+ "x-codex-primary-reset-after-seconds",
529
+ nowMs
530
+ ),
475
531
  secondaryUsedPercent,
476
- secondaryResetAt: resolveResetAt(headers, "x-codex-secondary-reset-at", "x-codex-secondary-reset-after-seconds", nowMs),
532
+ secondaryResetAt: resolveResetAt(
533
+ headers,
534
+ "x-codex-secondary-reset-at",
535
+ "x-codex-secondary-reset-after-seconds",
536
+ nowMs
537
+ ),
477
538
  checkedAt: new Date(nowMs)
478
539
  };
479
540
  }
@@ -496,6 +557,9 @@ function codexSubscriptionFetch(base = globalThis.fetch) {
496
557
  headers.set("version", ctx.clientVersion);
497
558
  headers.set("accept", "text/event-stream");
498
559
  headers.set("content-type", "application/json");
560
+ if (ctx.sessionId) {
561
+ headers.set("session_id", ctx.sessionId);
562
+ }
499
563
  if (auth.isFedramp) {
500
564
  headers.set("X-OpenAI-Fedramp", "true");
501
565
  }
@@ -513,7 +577,9 @@ function codexSubscriptionFetch(base = globalThis.fetch) {
513
577
  }
514
578
  if (process.env.CODEX_DEBUG) {
515
579
  const keys = typeof nextInit.body === "string" ? Object.keys(JSON.parse(nextInit.body)) : [];
516
- console.error(`[codex-debug] POST ${rewritten} stream=${callerWantsStream} bodyKeys=[${keys.join(",")}]`);
580
+ console.error(
581
+ `[codex-debug] POST ${rewritten} stream=${callerWantsStream} bodyKeys=[${keys.join(",")}]`
582
+ );
517
583
  }
518
584
  const res2 = await base(rewritten, nextInit);
519
585
  const usage = parseCodexUsageHeaders(res2.headers);
@@ -521,7 +587,9 @@ function codexSubscriptionFetch(base = globalThis.fetch) {
521
587
  ctx.onUsageHeaders?.(usage);
522
588
  }
523
589
  if (process.env.CODEX_DEBUG && !res2.ok) {
524
- console.error(`[codex-debug] <- ${res2.status} ${await res2.clone().text()}`);
590
+ console.error(
591
+ `[codex-debug] <- ${res2.status} requestId=${res2.headers.get("x-request-id") ?? "unknown"}`
592
+ );
525
593
  }
526
594
  if (!res2.ok) {
527
595
  return await bufferCodexErrorResponse(res2);
@@ -556,6 +624,7 @@ async function bufferCodexErrorResponse(res) {
556
624
  const bodyText = await res.text().catch(() => "");
557
625
  const headers = new Headers(res.headers);
558
626
  headers.set("content-type", "application/json");
627
+ headers.set(CODEX_TRANSPORT_ERROR_HEADER, "1");
559
628
  headers.delete("content-length");
560
629
  headers.delete("content-encoding");
561
630
  let errorType;
@@ -592,7 +661,9 @@ async function sseToJsonResponse(res) {
592
661
  final = { ...final, output: items };
593
662
  }
594
663
  if (process.env.CODEX_DEBUG) {
595
- console.error(`[codex-debug] sse->json items=${items.length} outputLen=${Array.isArray(final?.output) ? final.output.length : "?"}`);
664
+ console.error(
665
+ `[codex-debug] sse->json items=${items.length} outputLen=${Array.isArray(final?.output) ? final.output.length : "?"}`
666
+ );
596
667
  }
597
668
  const headers = new Headers(res.headers);
598
669
  headers.set("content-type", "application/json");
@@ -830,14 +901,19 @@ export {
830
901
  CODEX_APPS_REQUIRED_SCOPES,
831
902
  CODEX_APPS_STARTUP_TIMEOUT_MS,
832
903
  CODEX_AUTH_BASE,
904
+ CODEX_AUTO_COMPACTION_PERCENT,
833
905
  CODEX_CLIENT_ID,
834
906
  CODEX_CLIENT_VERSION,
835
907
  CODEX_DEVICE_REDIRECT_URI,
836
908
  CODEX_DEVICE_VERIFICATION_URL,
909
+ CODEX_EFFECTIVE_CONTEXT_WINDOW_PERCENT,
837
910
  CODEX_FALLBACK_MODEL_SLUGS,
838
911
  CODEX_FIVE_HOUR_WINDOW_SECONDS,
839
912
  CODEX_ID_TOKEN_AUTH_CLAIM,
840
913
  CODEX_ISSUER,
914
+ CODEX_MODEL_AUTO_COMPACT_TOKEN_LIMIT,
915
+ CODEX_MODEL_CONTEXT_WINDOW_TOKENS,
916
+ CODEX_MODEL_EFFECTIVE_CONTEXT_WINDOW_TOKENS,
841
917
  CODEX_MODEL_ID_PREFIX,
842
918
  CODEX_ORIGINATOR,
843
919
  CODEX_PROVIDER_BASE_URL,
@@ -846,6 +922,7 @@ export {
846
922
  CODEX_REFRESH_WINDOW_MS,
847
923
  CODEX_RESPONSES_BASE,
848
924
  CODEX_TOKEN_URL,
925
+ CODEX_TRANSPORT_ERROR_HEADER,
849
926
  CODEX_USAGE_LIMIT_ERROR_TYPE,
850
927
  CODEX_WEEKLY_WINDOW_SECONDS,
851
928
  CODEX_WHAM_BASE,
@@ -865,6 +942,7 @@ export {
865
942
  fetchCodexModels,
866
943
  fetchCodexUsage,
867
944
  isCodexBilledModel,
945
+ isCodexTransportError,
868
946
  normalizeCodexRequestBody,
869
947
  normalizeCodexUsage,
870
948
  parseCodexUsageHeaders,