@mewbleh/purrx 1.0.13 → 1.0.14

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": "@mewbleh/purrx",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "purrx, a lightweight AI coding agent for your terminal",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/api/client.js CHANGED
@@ -1,4 +1,4 @@
1
- import { API_BASE, CHATGPT_BASE } from "../config.js";
1
+ import { API_BASE, CHATGPT_BASE, CODEX_CLI_VERSION } from "../config.js";
2
2
 
3
3
  // Models that take the Responses API reasoning fields (gpt-5 family, o-series,
4
4
  // and codex variants). The official Codex client always sends a reasoning block
@@ -26,7 +26,9 @@ function buildRequest(authInfo, sessionId) {
26
26
  Authorization: `Bearer ${authInfo.accessToken}`,
27
27
  "OpenAI-Beta": "responses=experimental",
28
28
  originator: "codex_cli_rs",
29
- "User-Agent": "codex_cli_rs/0.0.0 (purrx)",
29
+ // The codex backend requires this version header to accept the request.
30
+ version: CODEX_CLI_VERSION,
31
+ "User-Agent": `codex_cli_rs/${CODEX_CLI_VERSION} (purrx)`,
30
32
  };
31
33
  if (authInfo.accountId) {
32
34
  // Casing matches the official client (BearerAuthProvider).
package/src/config.js CHANGED
@@ -13,6 +13,12 @@ export const OAUTH_SCOPE =
13
13
  export const API_BASE = "https://api.openai.com/v1";
14
14
  export const CHATGPT_BASE = "https://chatgpt.com/backend-api/codex";
15
15
 
16
+ // The official Codex client sends a `version` header (its CLI version) on every
17
+ // request. The ChatGPT-codex backend uses it to recognize a legitimate Codex
18
+ // client; omitting it causes a generic "model not supported" rejection.
19
+ // Override with PURRX_CODEX_VERSION to match your installed Codex CLI.
20
+ export const CODEX_CLI_VERSION = process.env.PURRX_CODEX_VERSION || "0.5.0";
21
+
16
22
  // Default model. gpt-5-codex is the default Codex coding model and works on
17
23
  // both API-key and ChatGPT-account auth. Override with PURRX_MODEL.
18
24
  export const DEFAULT_MODEL = process.env.PURRX_MODEL || "gpt-5-codex";