osborn 0.9.243 → 0.9.244
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/claude-llm.js +14 -5
- package/package.json +1 -1
package/dist/claude-llm.js
CHANGED
|
@@ -1008,11 +1008,20 @@ function buildMachineNudge() {
|
|
|
1008
1008
|
const cpuPct = Math.round((loadavg()[0] / ncpu) * 100); // 1-min load ÷ cores
|
|
1009
1009
|
const memPct = Math.round((1 - freemem() / totalmem()) * 100);
|
|
1010
1010
|
const subagents = statusManager.getActiveDispatchIds().length;
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1011
|
+
// Recommended concurrent heavy sub-agents, adapted to live headroom. This is a
|
|
1012
|
+
// concrete DEFAULT the agent should follow unless a task genuinely warrants
|
|
1013
|
+
// otherwise — surfaced as an actual number/target, never enforced.
|
|
1014
|
+
const recMax = (cpuPct >= 80 || memPct >= 90) ? Math.max(1, ncpu - 1) // hot: pull back below cores
|
|
1015
|
+
: (cpuPct >= 60) ? ncpu // busy: ~cores
|
|
1016
|
+
: ncpu + 1; // calm: a little headroom
|
|
1017
|
+
const over = subagents > recMax;
|
|
1018
|
+
const warn = over || cpuPct >= 80;
|
|
1019
|
+
const head = `[MACHINE${warn ? ' ⚠️' : ''}] CPU ~${cpuPct}% · MEM ${memPct}% · sub-agents ${subagents}/${recMax} recommended`;
|
|
1020
|
+
if (over)
|
|
1021
|
+
return `${head} — over the recommended concurrency; wind down to ≤${recMax} (finish or stop in-flight sub-agents) unless a task must continue. (recommendation — the agent decides, not enforced)`;
|
|
1022
|
+
if (cpuPct >= 80)
|
|
1023
|
+
return `${head} — load high; hold new sub-agents beyond ${recMax} unless needed. (recommendation — the agent decides, not enforced)`;
|
|
1024
|
+
return head;
|
|
1016
1025
|
}
|
|
1017
1026
|
catch {
|
|
1018
1027
|
return '';
|