kritya 0.8.41-beta → 0.8.42-beta
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/dist/commands/doctor.js +8 -1
- package/package.json +1 -1
package/dist/commands/doctor.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
|
-
import { BUILTIN_PROVIDERS, CONFIG_DIR, CONFIG_FILE, legacyGlobalModel, loadConfig, privacyModeFor, resolveProvider, } from "../config/config.js";
|
|
5
|
+
import { BUILTIN_PROVIDERS, CONFIG_DIR, CONFIG_FILE, legacyGlobalModel, loadConfig, loadDotEnv, privacyModeFor, resolveProvider, } from "../config/config.js";
|
|
6
6
|
import { DEFAULT_MODEL, contextWindowFor } from "../config/models.js";
|
|
7
7
|
import { retentionDaysFor } from "../config/retention.js";
|
|
8
8
|
import { assertJsonWithinLimits } from "../config/jsonSafety.js";
|
|
@@ -368,6 +368,13 @@ export async function runDoctorCli(argv, options = {}) {
|
|
|
368
368
|
const offline = argv.includes("--offline");
|
|
369
369
|
const dirArg = argv.find((a) => !a.startsWith("-"));
|
|
370
370
|
const workspace = path.resolve(options.workspace ?? dirArg ?? ".");
|
|
371
|
+
// The user's own global .env is unconditionally trusted and is where the
|
|
372
|
+
// interactive and headless paths both pick up provider keys (see
|
|
373
|
+
// `runInteractive` in index.tsx and `runHeadless` in headless.ts). Without
|
|
374
|
+
// loading it here the provider check below sees only the ambient
|
|
375
|
+
// environment, so a key that lives solely in ~/.kritya/.env is reported as
|
|
376
|
+
// missing — a false "no API key" that also flips the exit code to 1.
|
|
377
|
+
loadDotEnv([path.join(CONFIG_DIR, ".env")]);
|
|
371
378
|
const sections = await collectDiagnostics({ ...options, workspace, offline });
|
|
372
379
|
const report = summarize(sections, workspace);
|
|
373
380
|
if (json) {
|