serpentstack 0.2.16 → 0.2.18
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.
|
@@ -315,10 +315,12 @@ async function pickModel(rl, agentName, currentModel, available) {
|
|
|
315
315
|
return currentModel;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
// If current model isn't in any list,
|
|
318
|
+
// If current model isn't in any list, append it at the end (never unshift — it breaks numbering)
|
|
319
319
|
if (!choices.some(c => c.id === currentModel)) {
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
const idx = choices.length;
|
|
321
|
+
choices.push({ id: currentModel, name: modelShortName(currentModel), tier: 'custom', action: 'use' });
|
|
322
|
+
console.log(` ${dim('── Current ─────────────────────────')}`);
|
|
323
|
+
console.log(` ${green('>')} ${dim(`${idx + 1}.`)} ${bold(modelShortName(currentModel))} ${dim('(not installed)')} ${green('← current')}`);
|
|
322
324
|
}
|
|
323
325
|
|
|
324
326
|
const currentIdx = choices.findIndex(c => c.id === currentModel);
|
|
@@ -799,7 +801,7 @@ async function runStart(projectDir, parsed, config, soulPath, hasOpenClaw) {
|
|
|
799
801
|
'--model', effectiveModel,
|
|
800
802
|
'--non-interactive',
|
|
801
803
|
]);
|
|
802
|
-
success(
|
|
804
|
+
success(`Registered ${bold(name)} ${dim(`(${modelShortName(effectiveModel)})`)}`);
|
|
803
805
|
} catch (err) {
|
|
804
806
|
// Agent may already exist — that's fine
|
|
805
807
|
if (err.message && err.message.includes('already exists')) {
|
|
@@ -816,6 +818,7 @@ async function runStart(projectDir, parsed, config, soulPath, hasOpenClaw) {
|
|
|
816
818
|
await execPromise('openclaw', [
|
|
817
819
|
'cron', 'add',
|
|
818
820
|
'--agent', name,
|
|
821
|
+
'--model', effectiveModel,
|
|
819
822
|
'--every', sched.every,
|
|
820
823
|
'--message', `Run task: ${sched.task}`,
|
|
821
824
|
'--name', `${name}-${sched.task}`,
|
package/lib/utils/agent-utils.js
CHANGED
|
@@ -250,6 +250,9 @@ export function listPids(projectDir) {
|
|
|
250
250
|
* Check if a process is alive.
|
|
251
251
|
*/
|
|
252
252
|
export function isProcessAlive(pid) {
|
|
253
|
+
// PID -1 is a marker for "terminal-managed" — we can't check those.
|
|
254
|
+
// process.kill(-1, 0) sends to ALL processes, always succeeds — never use it.
|
|
255
|
+
if (!pid || pid <= 0) return false;
|
|
253
256
|
try {
|
|
254
257
|
process.kill(pid, 0);
|
|
255
258
|
return true;
|