@skydiveai/pi-extensions 0.1.0-beta.2577 → 0.1.0-beta.2579
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/index.mjs +5 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2943,7 +2943,8 @@ const bashDefaultTimeoutExtension = (pi) => {
|
|
|
2943
2943
|
* first time usage crosses a warn threshold, folds a system notification into
|
|
2944
2944
|
* the open turn so the agent can checkpoint, shed work (constrain
|
|
2945
2945
|
* parallelism, kill a background hog, clean scratch space), or request a
|
|
2946
|
-
* bigger tier BEFORE the kill.
|
|
2946
|
+
* bigger tier BEFORE the kill. The warning is model-facing only; the
|
|
2947
|
+
* agent must not narrate it to the user unless asked.
|
|
2947
2948
|
*
|
|
2948
2949
|
* The notification is triggered by the two conditions that actually kill
|
|
2949
2950
|
* work — memory near the cgroup hard cap, disk near full — and reports a
|
|
@@ -3077,7 +3078,9 @@ function resourcePressureWarningText(trigger, { mem, cpuPct, diskPct }) {
|
|
|
3077
3078
|
if (diskPct !== null) stats.push(`disk ${diskPct}% full`);
|
|
3078
3079
|
const lead = trigger === "memory" ? `Your sandbox is at ${mem?.pct}% of its memory cap. If usage keeps climbing, the kernel will kill the offending process and this turn may die with it.` : `Your sandbox's disk is ${diskPct}% full. If it fills completely, writes will start failing and this turn may die with them.`;
|
|
3079
3080
|
const remedy = trigger === "memory" ? "checkpoint in-flight work (commit and push), then reduce the footprint — constrain parallelism, run heavy steps sequentially, or kill background processes you no longer need." : "checkpoint in-flight work (commit and push), then free space — clean build artifacts, caches, and scratch files you no longer need.";
|
|
3080
|
-
|
|
3081
|
+
const closer = trigger === "memory" ? "If the workload genuinely needs more memory or CPU, request a bigger sandbox with `platform compute request`." : "A bigger compute tier will not add disk. I cannot add disk from this box, and a replacement sandbox on the same template has the same disk.";
|
|
3082
|
+
const jargon = trigger === "memory" ? "\"I freed up memory on my computer\" or \"I'll probably need a bigger computer with more memory\", not \"I killed the leftover Chromium render so we don't get OOM'd\". Instead, just request the resources you need or change how you work on the task to succeed within this budget." : "\"I freed up disk on my computer\", not \"the root filesystem is at capacity\". Change how you work on the task to succeed within this budget. Do not request a compute upgrade for disk pressure.";
|
|
3083
|
+
return `<system_notification>${lead} Current usage: ${stats.join(", ")}. Act now: ${remedy} ${closer} Do not mention this constraint as you work unless the user asks. No jargon: ${jargon} This is an automated resource warning, not a message from the user; continue the task, adjusted.</system_notification>`;
|
|
3081
3084
|
}
|
|
3082
3085
|
const resourcePressureWarningExtension = (pi) => {
|
|
3083
3086
|
let agentActive = false;
|