@commonlyai/cli 0.1.231 → 0.1.232
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
|
@@ -21,6 +21,7 @@ import { observeSpawn, controlsFromArguments } from '../runtime-observation.js';
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
import { requireSeatModel, seatModelRequired } from './seat-model.js';
|
|
24
|
+
import { isPatchAfterNewestTested } from './tested-version.js';
|
|
24
25
|
import { spawn as childSpawn, spawnSync } from 'child_process';
|
|
25
26
|
import { createHash } from 'crypto';
|
|
26
27
|
import { realpathSync } from 'fs';
|
|
@@ -729,16 +730,21 @@ export default {
|
|
|
729
730
|
if (!TESTED_OPENCODE_VERSIONS.includes(installedVersion)) {
|
|
730
731
|
const mismatch = describeOpenCodeVersionMismatch(installedVersion);
|
|
731
732
|
const allowOverride = process.env[ALLOW_UNTESTED_OPENCODE_VERSION_ENV] === '1';
|
|
732
|
-
|
|
733
|
+
const patchAfterTested = isPatchAfterNewestTested(installedVersion, TESTED_OPENCODE_VERSIONS);
|
|
734
|
+
if (isPublic && !allowOverride && !patchAfterTested) {
|
|
733
735
|
throw new Error(
|
|
734
736
|
`Public OpenCode seats refuse to run: ${mismatch}. `
|
|
735
737
|
+ `To override from the host process, set ${ALLOW_UNTESTED_OPENCODE_VERSION_ENV}=1.`,
|
|
736
738
|
);
|
|
737
739
|
}
|
|
740
|
+
let outcome = 'trusted seat continues';
|
|
741
|
+
if (isPublic) {
|
|
742
|
+
outcome = allowOverride
|
|
743
|
+
? `continuing because the host process set ${ALLOW_UNTESTED_OPENCODE_VERSION_ENV}=1`
|
|
744
|
+
: 'a patch release on the newest smoke-tested line, so the public seat continues';
|
|
745
|
+
}
|
|
738
746
|
// eslint-disable-next-line no-console
|
|
739
|
-
console.warn(
|
|
740
|
-
? `[opencode] ${mismatch}; continuing because the host process set ${ALLOW_UNTESTED_OPENCODE_VERSION_ENV}=1`
|
|
741
|
-
: `[opencode] ${mismatch}; trusted seat continues`);
|
|
747
|
+
console.warn(`[opencode] ${mismatch}; ${outcome}`);
|
|
742
748
|
}
|
|
743
749
|
|
|
744
750
|
const fullPrompt = buildMemoryPreamble(prompt, ctx.memoryLongTerm, {
|
package/src/lib/adapters/qwen.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Qwen Code 0.25.1 and 0.26.2 wrapper. Public turns have fresh HOME, config and keys. */
|
|
2
2
|
import { requireSeatModel } from './seat-model.js';
|
|
3
|
+
import { isPatchAfterNewestTested } from './tested-version.js';
|
|
3
4
|
import { spawn as childSpawn, spawnSync } from 'child_process';
|
|
4
5
|
import { lstatSync, realpathSync } from 'fs';
|
|
5
6
|
import { chmod, mkdtemp, readFile, rm, writeFile } from 'fs/promises';
|
|
@@ -259,11 +260,15 @@ export default {
|
|
|
259
260
|
});
|
|
260
261
|
if (!TESTED_QWEN_VERSIONS.includes(version)) {
|
|
261
262
|
const versions = TESTED_QWEN_VERSIONS.join(', ');
|
|
262
|
-
|
|
263
|
+
const allowOverride = process.env[ALLOW_UNTESTED_QWEN_VERSION_ENV] === '1';
|
|
264
|
+
const patchAfterTested = isPatchAfterNewestTested(version, TESTED_QWEN_VERSIONS);
|
|
265
|
+
if (isPublic && !allowOverride && !patchAfterTested) {
|
|
263
266
|
throw new Error(`Public Qwen seats refuse version ${version || 'unknown'}; smoke-tested: ${versions}. Set ${ALLOW_UNTESTED_QWEN_VERSION_ENV}=1 in the host process to override.`);
|
|
264
267
|
}
|
|
268
|
+
let outcome = 'trusted seat continues';
|
|
269
|
+
if (isPublic) outcome = allowOverride ? 'host override accepted' : 'a patch release on the newest smoke-tested line, so the public seat continues';
|
|
265
270
|
// eslint-disable-next-line no-console
|
|
266
|
-
console.warn(`[qwen] installed ${version || 'unknown'} differs from smoke-tested ${versions}; ${
|
|
271
|
+
console.warn(`[qwen] installed ${version || 'unknown'} differs from smoke-tested ${versions}; ${outcome}`);
|
|
267
272
|
}
|
|
268
273
|
// npm launches through a symlink into the package. Qwen loads chunks next
|
|
269
274
|
// to that entry file, so public sandboxes need that exact read-only tree.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Public seats run only on a harness version smoke-tested in its sandbox, with
|
|
2
|
+
// one tolerance: a stable patch release after the newest tested one, on that
|
|
3
|
+
// same major.minor line. Harnesses ship patches every few days, and refusing
|
|
4
|
+
// them refused every new BYO user on the current npm release (D245, 11-04).
|
|
5
|
+
// A newer minor or major, an older patch, an older line, or a prerelease still
|
|
6
|
+
// refuses until it is smoke-tested and added to the adapter's list.
|
|
7
|
+
const STABLE = /^(\d+)\.(\d+)\.(\d+)$/;
|
|
8
|
+
|
|
9
|
+
export const isPatchAfterNewestTested = (version, tested) => {
|
|
10
|
+
const installed = STABLE.exec(String(version || ''));
|
|
11
|
+
const newest = STABLE.exec(String(tested[tested.length - 1] || ''));
|
|
12
|
+
if (!installed || !newest) return false;
|
|
13
|
+
return Number(installed[1]) === Number(newest[1])
|
|
14
|
+
&& Number(installed[2]) === Number(newest[2])
|
|
15
|
+
&& Number(installed[3]) > Number(newest[3]);
|
|
16
|
+
};
|