@skydiveai/pi-extensions 0.1.258-beta.129 → 0.1.258-beta.130

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/index.mjs +10 -2
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -4005,6 +4005,14 @@ const toolCallEnvExtension = (pi) => {
4005
4005
  });
4006
4006
  };
4007
4007
  //#endregion
4008
+ //#region src/extensions/oom-neutral-bash.ts
4009
+ const OOM_NEUTRAL_PREFIX = "{ echo 0 > /proc/self/oom_score_adj; } 2>/dev/null\n";
4010
+ /** pi's local bash backend with every command reset to a neutral OOM score. */
4011
+ function createOomNeutralBashOperations({ shellPath }) {
4012
+ const local = createLocalBashOperations({ shellPath });
4013
+ return { exec: (command, cwd, options) => local.exec(`${OOM_NEUTRAL_PREFIX}${command}`, cwd, options) };
4014
+ }
4015
+ //#endregion
4008
4016
  //#region src/extensions/background-tasks.ts
4009
4017
  /**
4010
4018
  * Background bash tasks as a pi extension.
@@ -4110,7 +4118,7 @@ const toolCallEnvExtension = (pi) => {
4110
4118
  * (its own controller) and the foreground kill timeout no longer applies.
4111
4119
  */
4112
4120
  const log$14 = logger.child({ module: "background-tasks-ext" });
4113
- const ops = createLocalBashOperations();
4121
+ const ops = createOomNeutralBashOperations({ shellPath: void 0 });
4114
4122
  const STEER_BACKGROUND_DEFAULT_SECONDS = 60;
4115
4123
  const STEER_BACKGROUND_ENV_KEYS = ["BASH_STEER_BACKGROUND_SECONDS", "SKYDIVE_BASH_STEER_BACKGROUND_SECONDS"];
4116
4124
  /**
@@ -4389,7 +4397,7 @@ function createBackgroundTasksExtension({ channelContext, sessionId }) {
4389
4397
  * handling, timeout kill, and abort semantics.
4390
4398
  */
4391
4399
  function createSteerAwareOperations(base) {
4392
- const localOps = createLocalBashOperations({ shellPath: base.shellPath });
4400
+ const localOps = createOomNeutralBashOperations({ shellPath: base.shellPath });
4393
4401
  return { async exec(command, cwd, execOptions) {
4394
4402
  const thresholdMs = steerBackgroundThresholdMs();
4395
4403
  const toolOnData = execOptions?.onData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skydiveai/pi-extensions",
3
- "version": "0.1.258-beta.129",
3
+ "version": "0.1.258-beta.130",
4
4
  "homepage": "https://skydive.com",
5
5
  "license": "MIT",
6
6
  "author": "Create, Inc.",