@commonlyai/cli 0.1.366 → 0.1.367
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
|
@@ -1404,16 +1404,31 @@ const CODEX_PROVIDER_KEY_ENVS = [
|
|
|
1404
1404
|
// What the turn will launch, asked for its version. 30 s, as in goose: a first
|
|
1405
1405
|
// launch after an upgrade can be slow. A failed probe isn't cached, so the next
|
|
1406
1406
|
// turn reads it again. `_codexVersion` and `_versionProbe` are test seams only.
|
|
1407
|
+
//
|
|
1408
|
+
// A Codex that can't be launched at all throws what the turn's own launch would
|
|
1409
|
+
// (F262), so the pod hears that it won't start, not that it needs upgrading.
|
|
1410
|
+
// "Can't be launched" is the probe's own ENOENT, the error execFile and the
|
|
1411
|
+
// turn's spawn share: a codex found any way the OS finds it (a relative PATH
|
|
1412
|
+
// entry, PATH unset) but exiting non-zero is a version refusal.
|
|
1407
1413
|
const readCodexVersion = async (ctx, env) => {
|
|
1408
1414
|
if (ctx._codexVersion !== undefined) return ctx._codexVersion;
|
|
1415
|
+
const { command, args } = resolveLaunch('codex', [], { env, ...ctx._commandResolution });
|
|
1416
|
+
let notFound = false;
|
|
1417
|
+
let version = null;
|
|
1409
1418
|
try {
|
|
1410
|
-
|
|
1411
|
-
return await probeVersion(command, {
|
|
1419
|
+
version = await probeVersion(command, {
|
|
1412
1420
|
args, env, timeoutMs: 30000, parse: parseCodexVersion, ...ctx._versionProbe,
|
|
1421
|
+
onError: (error) => { if (error?.code === 'ENOENT') notFound = true; },
|
|
1413
1422
|
});
|
|
1414
1423
|
} catch {
|
|
1415
|
-
|
|
1424
|
+
version = null;
|
|
1425
|
+
}
|
|
1426
|
+
if (version === null && notFound) {
|
|
1427
|
+
const missing = new Error(`spawn ${command} ENOENT`);
|
|
1428
|
+
missing.code = 'ENOENT';
|
|
1429
|
+
throw missing;
|
|
1416
1430
|
}
|
|
1431
|
+
return version;
|
|
1417
1432
|
};
|
|
1418
1433
|
|
|
1419
1434
|
// `ownGroup`: see runClaude in claude.js.
|
|
@@ -94,9 +94,11 @@ const resolveBinary = (binary, env) => {
|
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
+
// `onError` sees the launch's own error when the probe fails, so a caller can
|
|
98
|
+
// tell a binary that isn't there (ENOENT) from one that ran and refused.
|
|
97
99
|
export const probeVersion = async (binary, {
|
|
98
100
|
args = [], env, timeoutMs = 30000, parse, execFileImpl = childProcess.execFile, cache = versionCache,
|
|
99
|
-
now = Date.now,
|
|
101
|
+
now = Date.now, onError,
|
|
100
102
|
} = {}) => {
|
|
101
103
|
const resolved = args.length ? null : resolveBinary(binary, env);
|
|
102
104
|
const key = resolved?.key || null;
|
|
@@ -104,6 +106,7 @@ export const probeVersion = async (binary, {
|
|
|
104
106
|
if (hit && hit.mtimeMs === resolved.mtimeMs && now() - hit.at < VERSION_CACHE_MAX_AGE_MS) return hit.version;
|
|
105
107
|
const stdout = await new Promise((resolve) => {
|
|
106
108
|
execFileImpl(key || binary, [...args, '--version'], { encoding: 'utf8', env, timeout: timeoutMs }, (error, out) => {
|
|
109
|
+
if (error && onError) onError(error);
|
|
107
110
|
resolve(error ? null : out);
|
|
108
111
|
});
|
|
109
112
|
});
|
|
@@ -48,6 +48,9 @@ const CLAUDE_SIGNED_OUT_WORDINGS = [
|
|
|
48
48
|
];
|
|
49
49
|
const WONT_START_WORDINGS = [
|
|
50
50
|
/^spawn \S+ ENOENT/,
|
|
51
|
+
// windows-command.js resolveLaunch: not on PATH, or a .cmd/.ps1 that only a
|
|
52
|
+
// shell can run. The harness never started, as with ENOENT (F262).
|
|
53
|
+
/^cannot launch \S+ on Windows without a shell: /,
|
|
51
54
|
/^\w+ adapter: \S+ (?:is not set|is missing)/, // the seat has no provider key
|
|
52
55
|
];
|
|
53
56
|
// The vendors' credit wordings open at the adapter's own label or the claude
|