crosscheck-mcp 0.2.12 → 0.2.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.
@@ -1242,8 +1242,21 @@ function isCreditsFailure(status, bodyText) {
1242
1242
  }
1243
1243
  return false;
1244
1244
  }
1245
- function httpFailureToProviderError(provider, status, bodyText, retryAfterS) {
1245
+ var MODEL_ACCESS_RE = /model_not_found|does not have access to model|does not exist|model[\s_]not[\s_]found|invalid model|unknown model|unsupported model/i;
1246
+ function isModelAccessFailure(status, bodyText) {
1247
+ if (status < 400 || status >= 500) return false;
1248
+ return MODEL_ACCESS_RE.test(bodyText);
1249
+ }
1250
+ function httpFailureToProviderError(provider, status, bodyText, retryAfterS, model) {
1246
1251
  const detail = bodyText.slice(0, 512);
1252
+ if (isModelAccessFailure(status, bodyText)) {
1253
+ const modelRef = model ? `"${model}"` : "the configured model";
1254
+ return new ProviderError(
1255
+ "client",
1256
+ `${provider}: your account/project doesn't have access to ${modelRef} (HTTP ${status}). This is a model-access problem, not a key problem \u2014 your ${provider} API key is fine, ${modelRef} just isn't enabled for this account/project. Fix: run \`crosscheck models set ${provider} <a-model-you-have-access-to>\` (or set ${provider.toUpperCase()}_MODEL in your .env until that's available). Detail: ${detail}`,
1257
+ { status }
1258
+ );
1259
+ }
1247
1260
  if (isCreditsFailure(status, bodyText)) {
1248
1261
  return new ProviderError(
1249
1262
  "auth",
@@ -1581,7 +1594,7 @@ async function sendAnthropic(args) {
1581
1594
  return { text, attempts: 1, usage: applyPricing(usage, args.pricing) };
1582
1595
  }
1583
1596
  const bodyText = await respLike.text().catch(() => "");
1584
- throw httpFailureToProviderError("anthropic", status, bodyText, parseRetryAfter(respLike));
1597
+ throw httpFailureToProviderError("anthropic", status, bodyText, parseRetryAfter(respLike), args.model);
1585
1598
  };
1586
1599
  await acquireRateLimit("anthropic", args.signal ? { signal: args.signal } : void 0);
1587
1600
  return sendWithRetry(attemptOnce, resolveRetryConfig(), args.signal);
@@ -1760,7 +1773,7 @@ async function sendGemini(args) {
1760
1773
  return { text, attempts: 1, usage: applyPricing2(usage, args.pricing) };
1761
1774
  }
1762
1775
  const bodyText = await respLike.text().catch(() => "");
1763
- throw httpFailureToProviderError("gemini", status, bodyText, parseRetryAfter(respLike));
1776
+ throw httpFailureToProviderError("gemini", status, bodyText, parseRetryAfter(respLike), args.model);
1764
1777
  };
1765
1778
  await acquireRateLimit("gemini", args.signal ? { signal: args.signal } : void 0);
1766
1779
  return sendWithRetry(attemptOnce, resolveRetryConfig(), args.signal);
@@ -1934,7 +1947,7 @@ async function sendOpenAICompatible(args) {
1934
1947
  return { text, attempts: 1, usage: applyPricing3(usage, args.pricing) };
1935
1948
  }
1936
1949
  const bodyText = await respLike.text().catch(() => "");
1937
- throw httpFailureToProviderError(args.provider, status, bodyText, parseRetryAfter(respLike));
1950
+ throw httpFailureToProviderError(args.provider, status, bodyText, parseRetryAfter(respLike), args.model);
1938
1951
  };
1939
1952
  await acquireRateLimit(args.provider, args.signal ? { signal: args.signal } : void 0);
1940
1953
  return sendWithRetry(attemptOnce, resolveRetryConfig(), args.signal);
@@ -1943,7 +1956,10 @@ async function sendOpenAICompatible(args) {
1943
1956
  // src/providers/registry.ts
1944
1957
  var DEFAULT_MODELS = {
1945
1958
  anthropic: "claude-opus-5",
1946
- openai: "gpt-5.5",
1959
+ // gpt-5.5 is not enabled on every OpenAI account/project (some are still
1960
+ // capped at gpt-5) — gpt-5 is the safer, more broadly available default
1961
+ // until a user/org explicitly opts into 5.5 via `crosscheck models set`.
1962
+ openai: "gpt-5",
1947
1963
  xai: "grok-4-latest",
1948
1964
  mistral: "mistral-large-latest",
1949
1965
  groq: "llama-3.3-70b-versatile",
@@ -1952,6 +1968,28 @@ var DEFAULT_MODELS = {
1952
1968
  kimi: "kimi-k3",
1953
1969
  qwen: "qwen3.8-max"
1954
1970
  };
1971
+ var MODEL_ENV_VARS = {
1972
+ anthropic: "ANTHROPIC_MODEL",
1973
+ openai: "OPENAI_MODEL",
1974
+ xai: "XAI_MODEL",
1975
+ mistral: "MISTRAL_MODEL",
1976
+ groq: "GROQ_MODEL",
1977
+ deepseek: "DEEPSEEK_MODEL",
1978
+ gemini: "GEMINI_MODEL",
1979
+ kimi: "KIMI_MODEL",
1980
+ qwen: "QWEN_MODEL"
1981
+ };
1982
+ function detectStalePins(env) {
1983
+ const out = [];
1984
+ for (const [provider, envVar] of Object.entries(MODEL_ENV_VARS)) {
1985
+ const pinned = env[envVar];
1986
+ const current = DEFAULT_MODELS[provider];
1987
+ if (pinned && current && pinned !== current) {
1988
+ out.push({ provider, envVar, pinned, current });
1989
+ }
1990
+ }
1991
+ return out;
1992
+ }
1955
1993
  function buildProviders(opts) {
1956
1994
  const out = {};
1957
1995
  const anthropicKey = opts.env["ANTHROPIC_API_KEY"];
@@ -2170,7 +2208,7 @@ import { z } from "zod";
2170
2208
  // src/server-meta.ts
2171
2209
  init_esm_shims();
2172
2210
  var SERVER_NAME = "crosscheck-agent";
2173
- var SERVER_VERSION = true ? "0.2.12" : "0.0.0-dev";
2211
+ var SERVER_VERSION = true ? "0.2.14" : "0.0.0-dev";
2174
2212
 
2175
2213
  // src/tools/audit.ts
2176
2214
  init_esm_shims();
@@ -12481,7 +12519,7 @@ var CHECK_INTERVAL_SECONDS = 3 * 24 * 60 * 60;
12481
12519
  var DEFAULT_PACKAGE = "crosscheck-cli";
12482
12520
  var FETCH_TIMEOUT_MS = 3e3;
12483
12521
  function engineVersion() {
12484
- return true ? "0.2.12" : "0.0.0-dev";
12522
+ return true ? "0.2.14" : "0.0.0-dev";
12485
12523
  }
12486
12524
  function defaultUpdateCachePath() {
12487
12525
  const base = process.env["CROSSCHECK_DATA_DIR"] || path10.join(os.homedir() || os.tmpdir(), ".crosscheck");
@@ -14775,6 +14813,13 @@ async function main() {
14775
14813
  if (Object.keys(providers).length > 0) {
14776
14814
  process.stderr.write(
14777
14815
  `crosscheck-agent: native providers loaded: ${Object.keys(providers).sort().join(", ")}
14816
+ `
14817
+ );
14818
+ }
14819
+ for (const stale of detectStalePins(process.env)) {
14820
+ if (!(stale.provider in providers)) continue;
14821
+ process.stderr.write(
14822
+ `crosscheck-agent: ${stale.provider} is pinned to "${stale.pinned}" via ${stale.envVar}, but the current default is "${stale.current}". If that wasn't intentional, update or remove ${stale.envVar} in your .env.
14778
14823
  `
14779
14824
  );
14780
14825
  }