@opengeni/codex 0.2.29 → 0.2.30-canary.36927100590001

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,6 @@
1
1
  {
2
2
  "name": "@opengeni/codex",
3
- "version": "0.2.29",
3
+ "version": "0.2.30-canary.36927100590001",
4
4
  "description": "ChatGPT/Codex subscription auth + transport: device-code login, token refresh, and the Responses-backend fetch. Pure HTTP + transforms; no database dependency.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "prepublishOnly": "bash ../../scripts/prepublish-guard"
42
42
  },
43
43
  "dependencies": {
44
- "@opengeni/contracts": "^5.4.0",
45
- "@opengeni/network": "^0.3.1",
44
+ "@opengeni/contracts": "^5.5.0-canary.36927100590001",
45
+ "@opengeni/network": "^0.3.1-canary.36927100590001",
46
46
  "zod": "^4.2.1"
47
47
  },
48
48
  "engines": {
package/src/fetch.ts CHANGED
@@ -983,8 +983,14 @@ async function bufferCodexErrorResponse(res: Response): Promise<Response> {
983
983
  let errorType: string | undefined;
984
984
  let responseBody = bodyText;
985
985
  try {
986
- const parsed = JSON.parse(bodyText) as { error?: { type?: unknown } };
986
+ const parsed = JSON.parse(bodyText) as { error?: { type?: unknown }; detail?: unknown };
987
987
  errorType = typeof parsed.error?.type === "string" ? parsed.error.type : undefined;
988
+ // Codex also returns FastAPI's { detail: string } envelope. The OpenAI SDK
989
+ // reads only error.message, otherwise replacing this useful explanation
990
+ // with "status code (no body)". Retain the original fields and exact text.
991
+ if (parsed.error === undefined && typeof parsed.detail === "string") {
992
+ responseBody = JSON.stringify({ ...parsed, error: { message: parsed.detail } });
993
+ }
988
994
  } catch {
989
995
  /* non-JSON error body — leave as-is, no retry-header override */
990
996
  }