open-agents-ai 0.187.190 → 0.187.191

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.js +37 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -319243,7 +319243,42 @@ ${historyLines}
319243
319243
  });
319244
319244
  child.stderr?.on("data", () => {
319245
319245
  });
319246
- await new Promise((resolve39) => child.on("close", resolve39));
319246
+ const killDeadlineMs = chatTimeoutS * 1e3 + 3e4;
319247
+ let killedByDeadline = false;
319248
+ await new Promise((resolve39) => {
319249
+ let done = false;
319250
+ const finish = () => {
319251
+ if (!done) {
319252
+ done = true;
319253
+ resolve39();
319254
+ }
319255
+ };
319256
+ child.on("close", finish);
319257
+ const deadline = setTimeout(() => {
319258
+ if (done) return;
319259
+ killedByDeadline = true;
319260
+ try {
319261
+ if (child.pid) process.kill(-child.pid, "SIGTERM");
319262
+ } catch {
319263
+ }
319264
+ try {
319265
+ if (child.pid) process.kill(child.pid, "SIGTERM");
319266
+ } catch {
319267
+ }
319268
+ setTimeout(() => {
319269
+ try {
319270
+ if (child.pid) process.kill(-child.pid, "SIGKILL");
319271
+ } catch {
319272
+ }
319273
+ try {
319274
+ if (child.pid) process.kill(child.pid, "SIGKILL");
319275
+ } catch {
319276
+ }
319277
+ finish();
319278
+ }, 3e3).unref();
319279
+ }, killDeadlineMs);
319280
+ deadline.unref();
319281
+ });
319247
319282
  if (nonStreamBuf.trim()) nonStreamLines.push(nonStreamBuf);
319248
319283
  const rawNonStream = nonStreamLines.join("\n").trim();
319249
319284
  let content = "";
@@ -319275,7 +319310,7 @@ ${historyLines}
319275
319310
  const id = `chatcmpl-${session.id.slice(0, 12)}`;
319276
319311
  const cleanModel = model.replace(/^[a-z]+\//, "");
319277
319312
  if (!content) {
319278
- const errMsg = backendError ? `Backend error: ${backendError}` : "Agent produced no response. The model may have failed to load (try a smaller model or check 'ollama ps' for VRAM contention).";
319313
+ const errMsg = killedByDeadline ? `Agent exceeded ${chatTimeoutS}s timeout and was killed. Try a simpler prompt or increase timeout_s in the request body.` : backendError ? `Backend error: ${backendError}` : "Agent produced no response. The model may have failed to load (try a smaller model or check 'ollama ps' for VRAM contention).";
319279
319314
  jsonResponse(res, 200, {
319280
319315
  id,
319281
319316
  object: "chat.completion",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.190",
3
+ "version": "0.187.191",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",