open-agents-ai 0.134.0 → 0.136.0

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 +39 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21418,6 +21418,10 @@ If you're stuck, try a completely different approach. Do NOT repeat what failed
21418
21418
  const errMsg = reqErr instanceof Error ? reqErr.message : String(reqErr);
21419
21419
  const cause = reqErr instanceof Error && reqErr.cause ? ` (${reqErr.cause.message ?? ""} ${reqErr.cause?.code ?? ""})` : "";
21420
21420
  this.emit({ type: "error", content: `Backend error: ${errMsg}${cause}`, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
21421
+ if (/HTTP 404|not found|model.*not found/i.test(errMsg)) {
21422
+ this.emit({ type: "error", content: `Model not available. Use /model to select a different model.`, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
21423
+ break;
21424
+ }
21421
21425
  messages.push({ role: "user", content: "[System: backend request failed, retrying on next turn. The previous request was lost.]" });
21422
21426
  continue;
21423
21427
  }
@@ -33392,6 +33396,9 @@ ${activitySummary}
33392
33396
 
33393
33397
  // packages/cli/dist/tui/model-picker.js
33394
33398
  import { totalmem as totalmem2 } from "node:os";
33399
+ function isImageGenModel(name, family) {
33400
+ return IMAGE_GEN_PATTERNS.some((p) => p.test(name) || family && p.test(family));
33401
+ }
33395
33402
  async function fetchOllamaModels(baseUrl) {
33396
33403
  const url = `${normalizeBaseUrl(baseUrl)}/api/tags`;
33397
33404
  const resp = await fetch(url, {
@@ -33402,15 +33409,20 @@ async function fetchOllamaModels(baseUrl) {
33402
33409
  }
33403
33410
  const data = await resp.json();
33404
33411
  const models = data.models ?? [];
33405
- const result = models.map((m) => ({
33406
- name: m.name,
33407
- size: formatBytes(m.size),
33408
- sizeBytes: m.size,
33409
- modified: formatRelativeTime(m.modified_at),
33410
- parameterSize: m.details?.parameter_size,
33411
- contextLength: void 0,
33412
- caps: void 0
33413
- })).sort((a, b) => b.sizeBytes - a.sizeBytes);
33412
+ const result = models.map((m) => {
33413
+ const family = m.details?.family;
33414
+ return {
33415
+ name: m.name,
33416
+ size: formatBytes(m.size),
33417
+ sizeBytes: m.size,
33418
+ modified: formatRelativeTime(m.modified_at),
33419
+ parameterSize: m.details?.parameter_size,
33420
+ contextLength: void 0,
33421
+ caps: void 0,
33422
+ isImageGen: isImageGenModel(m.name, family),
33423
+ family
33424
+ };
33425
+ }).sort((a, b) => b.sizeBytes - a.sizeBytes);
33414
33426
  const normalized = normalizeBaseUrl(baseUrl);
33415
33427
  const showResults = await Promise.allSettled(result.map((m) => fetch(`${normalized}/api/show`, {
33416
33428
  method: "POST",
@@ -33910,10 +33922,21 @@ function formatRelativeTime(iso) {
33910
33922
  const months = Math.floor(days / 30);
33911
33923
  return `${months}mo ago`;
33912
33924
  }
33925
+ var IMAGE_GEN_PATTERNS;
33913
33926
  var init_model_picker = __esm({
33914
33927
  "packages/cli/dist/tui/model-picker.js"() {
33915
33928
  "use strict";
33916
33929
  init_dist();
33930
+ IMAGE_GEN_PATTERNS = [
33931
+ /flux/i,
33932
+ /z-image/i,
33933
+ /stable-diffusion/i,
33934
+ /sdxl/i,
33935
+ /dall/i,
33936
+ /kandinsky/i,
33937
+ /midjourney/i,
33938
+ /imagen/i
33939
+ ];
33917
33940
  }
33918
33941
  });
33919
33942
 
@@ -42688,6 +42711,13 @@ async function switchModel(query, ctx, local = false) {
42688
42711
  return;
42689
42712
  }
42690
42713
  }
42714
+ if (match.isImageGen || isImageGenModel(match.name, match.family)) {
42715
+ renderWarning(`"${match.name}" is an image generation model, not a chat/code model.`);
42716
+ renderInfo("Image gen models use /api/generate with width/height/steps parameters.");
42717
+ renderInfo("They cannot be used as the primary chat backend for tool-calling tasks.");
42718
+ renderInfo("Use a text model instead (e.g., qwen3.5, nemotron, devstral).");
42719
+ return;
42720
+ }
42691
42721
  let finalModel = match.name;
42692
42722
  if (ctx.config.backendType === "ollama") {
42693
42723
  const result = await ensureExpandedContext(match.name, ctx.config.backendUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.134.0",
3
+ "version": "0.136.0",
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",