claude-code-openai 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/cli.js +40 -7
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -188483,7 +188483,7 @@ function isAnthropicAuthEnabled() {
188483
188483
  if (process.env.ANTHROPIC_UNIX_SOCKET) {
188484
188484
  return !!process.env.CLAUDE_CODE_OAUTH_TOKEN;
188485
188485
  }
188486
- const is3P = isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY);
188486
+ const is3P = isEnvTruthy(process.env.CLAUDE_CODE_USE_BEDROCK) || isEnvTruthy(process.env.CLAUDE_CODE_USE_VERTEX) || isEnvTruthy(process.env.CLAUDE_CODE_USE_FOUNDRY) || isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENAI);
188487
188487
  const settings = getSettings_DEPRECATED() || {};
188488
188488
  const apiKeyHelper = settings.apiKeyHelper;
188489
188489
  const hasExternalAuthToken = process.env.ANTHROPIC_AUTH_TOKEN || apiKeyHelper || process.env.CLAUDE_CODE_API_KEY_FILE_DESCRIPTOR;
@@ -204208,7 +204208,7 @@ var init_metadata = __esm(() => {
204208
204208
  isClaudeAiAuth: isClaudeAISubscriber(),
204209
204209
  version: "2.1.88-rebuild",
204210
204210
  versionBase: getVersionBase(),
204211
- buildTime: "2026-04-01T08:38:53.515Z",
204211
+ buildTime: "2026-04-01T08:46:34.702Z",
204212
204212
  deploymentEnvironment: env4.detectDeploymentEnvironment(),
204213
204213
  ...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
204214
204214
  githubEventName: process.env.GITHUB_EVENT_NAME,
@@ -592576,7 +592576,7 @@ function getAnthropicEnvMetadata() {
592576
592576
  function getBuildAgeMinutes() {
592577
592577
  if (false)
592578
592578
  ;
592579
- const buildTime = new Date("2026-04-01T08:38:53.515Z").getTime();
592579
+ const buildTime = new Date("2026-04-01T08:46:34.702Z").getTime();
592580
592580
  if (isNaN(buildTime))
592581
592581
  return;
592582
592582
  return Math.floor((Date.now() - buildTime) / 60000);
@@ -594888,7 +594888,18 @@ async function* queryModelOpenAI(messages, systemPrompt, thinkingConfig, tools,
594888
594888
  delayMs = BASE_DELAY_MS4 * Math.pow(2, attempt);
594889
594889
  }
594890
594890
  logForDebugging(`[OpenAI] Retrying in ${delayMs}ms...`);
594891
- await new Promise((resolve35) => setTimeout(resolve35, delayMs));
594891
+ await new Promise((resolve35, reject2) => {
594892
+ if (signal.aborted) {
594893
+ resolve35();
594894
+ return;
594895
+ }
594896
+ const timer = setTimeout(resolve35, delayMs);
594897
+ const onAbort = () => {
594898
+ clearTimeout(timer);
594899
+ resolve35();
594900
+ };
594901
+ signal.addEventListener("abort", onAbort, { once: true });
594902
+ });
594892
594903
  }
594893
594904
  if (!response || !response.ok) {
594894
594905
  const status = lastStatus;
@@ -595274,6 +595285,7 @@ Sources:
595274
595285
  logForDebugging(`[OpenAI] Complete: ${contentBlocks.length} blocks, ${usage.input_tokens}in/${usage.output_tokens}out tokens, ${Date.now() - start}ms`);
595275
595286
  } catch (err2) {
595276
595287
  if (err2 instanceof Error && err2.name === "AbortError") {
595288
+ _lastResponseId = null;
595277
595289
  return;
595278
595290
  }
595279
595291
  const errorMsg = err2 instanceof Error ? err2.message : String(err2);
@@ -679035,7 +679047,7 @@ var init_bridge_kick = __esm(() => {
679035
679047
  var call56 = async () => {
679036
679048
  return {
679037
679049
  type: "text",
679038
- value: `${"2.1.88-rebuild"} (built ${"2026-04-01T08:38:53.515Z"})`
679050
+ value: `${"2.1.88-rebuild"} (built ${"2026-04-01T08:46:34.702Z"})`
679039
679051
  };
679040
679052
  }, version6, version_default;
679041
679053
  var init_version = __esm(() => {
@@ -698811,6 +698823,7 @@ async function verifyApiKey(apiKey, isNonInteractiveSession) {
698811
698823
  }
698812
698824
  if (getAPIProvider() === "openai") {
698813
698825
  try {
698826
+ const { resolveOpenAIModel: resolveOpenAIModel2 } = await Promise.resolve().then(() => (init_openai_query(), exports_openai_query));
698814
698827
  const client3 = await getOpenAIClient({ apiKey, maxRetries: 0 });
698815
698828
  const resp = await client3.fetch(`${client3.baseURL}/responses`, {
698816
698829
  method: "POST",
@@ -698819,7 +698832,7 @@ async function verifyApiKey(apiKey, isNonInteractiveSession) {
698819
698832
  Authorization: `Bearer ${client3.apiKey}`
698820
698833
  },
698821
698834
  body: JSON.stringify({
698822
- model: process.env.OPENAI_MODEL || "gpt-4.1-mini",
698835
+ model: resolveOpenAIModel2(getSmallFastModel()),
698823
698836
  input: "test",
698824
698837
  max_output_tokens: 1
698825
698838
  })
@@ -756334,6 +756347,25 @@ var init_useTimeout = __esm(() => {
756334
756347
 
756335
756348
  // src/utils/preflightChecks.tsx
756336
756349
  async function checkEndpoints() {
756350
+ if (getAPIProvider() === "openai") {
756351
+ try {
756352
+ const resp = await axios_default.get("https://api.openai.com/v1/models", {
756353
+ headers: { "User-Agent": getUserAgent(), Authorization: `Bearer ${process.env.OPENAI_API_KEY || "test"}` },
756354
+ validateStatus: () => true
756355
+ });
756356
+ if (resp.status > 0) {
756357
+ return { success: true };
756358
+ }
756359
+ return { success: false, error: "Failed to connect to api.openai.com" };
756360
+ } catch (error42) {
756361
+ const sslHint = getSSLErrorHint(error42);
756362
+ return {
756363
+ success: false,
756364
+ error: `Failed to connect to api.openai.com: ${error42 instanceof Error ? error42.code || error42.message : String(error42)}`,
756365
+ sslHint: sslHint ?? undefined
756366
+ };
756367
+ }
756368
+ }
756337
756369
  try {
756338
756370
  const oauthConfig = getOauthConfig();
756339
756371
  const tokenUrl = new URL(oauthConfig.TOKEN_URL);
@@ -756494,6 +756526,7 @@ var init_preflightChecks = __esm(() => {
756494
756526
  init_ink2();
756495
756527
  init_errorUtils();
756496
756528
  init_product();
756529
+ init_providers();
756497
756530
  init_http2();
756498
756531
  init_log2();
756499
756532
  import_react_compiler_runtime372 = __toESM(require_dist7(), 1);
@@ -776992,4 +777025,4 @@ async function main2() {
776992
777025
  }
776993
777026
  main2();
776994
777027
 
776995
- //# debugId=B6963C77F1D1E9E764756E2164756E21
777028
+ //# debugId=EF296FB1D976B08864756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-openai",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Claude Code CLI with OpenAI GPT-5.4 backend support",
5
5
  "type": "module",
6
6
  "bin": {