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.
Files changed (2) hide show
  1. package/dist/claude-llm.js +14 -5
  2. package/package.json +1 -1
@@ -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
- const hot = cpuPct >= 80 || subagents >= 4;
1012
- const head = `[MACHINE${hot ? ' ⚠️' : ''}] CPU ~${cpuPct}% · MEM ${memPct}% · sub-agents ${subagents}`;
1013
- if (!hot)
1014
- return head;
1015
- return `${head} — load is high; prefer finishing in-flight work over spawning new sub-agents this turn, and stop any that look stuck. (advisory only — not enforced)`;
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 '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "osborn",
3
- "version": "0.9.243",
3
+ "version": "0.9.244",
4
4
  "description": "Voice AI coding assistant - local agent that connects to Osborn frontend",
5
5
  "type": "module",
6
6
  "bin": {