@hexdecimal16/nexo 0.4.14 → 0.4.16

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/README.md CHANGED
@@ -28,7 +28,7 @@ nexo doctor # check Node, config, keys and t
28
28
 
29
29
  `nexo --help` lists every command. Data lives in `~/.nexo`. Set `NEXO_HOME` to move it.
30
30
 
31
- Images (PNG, JPEG, GIF, WebP) work with every vision model, including the `claude-p`, `codex-p` and `kiro-p` CLI providers. In the chat, drag an image file into the terminal or press ctrl+v to paste a screenshot; it shows as `[Image #1]`. `@shot.png` attaches an image in the project, `nexo run "…" --image shot.png` attaches one to a task, and the agent's `read` tool opens image files. Large images are scaled down to 2000 px, older images in a long run are replaced by a note (the file can be read again), and `nexo ui` shows the images each run saw.
31
+ Images (PNG, JPEG, GIF, WebP) work with every vision model, including the `agy-p`, `claude-p`, `codex-p` and `kiro-p` CLI providers. In the chat, drag an image file into the terminal or press ctrl+v to paste a screenshot; it shows as `[Image #1]`. `@shot.png` attaches an image in the project, `nexo run "…" --image shot.png` attaches one to a task, and the agent's `read` tool opens image files. Large images are scaled down to 2000 px, older images in a long run are replaced by a note (the file can be read again), and `nexo ui` shows the images each run saw.
32
32
 
33
33
  ## Settings and keys
34
34
 
@@ -10,6 +10,15 @@ export function classifyProviderError(message) {
10
10
  hint: "Set the provider's API key environment variable (for example ANTHROPIC_API_KEY or OPENAI_API_KEY) or log in with pi-ai",
11
11
  });
12
12
  }
13
+ if (/input_too_large|input exceeds the maximum length|context.?length.?exceeded/.test(lower))
14
+ return contextOverflowError(message);
15
+ if (FORMAT_FAILURE.test(message)) {
16
+ return new NexoError({
17
+ code: "PROVIDER_UNAVAILABLE",
18
+ message,
19
+ hint: "The model kept answering outside the nexo reply format (a native tool call or an unusable JSON reply) after the automatic retries; rerun the turn or switch model",
20
+ });
21
+ }
13
22
  if (/\b429\b|rate.?limit|too many requests|resource.?exhausted/.test(lower)) {
14
23
  return new NexoError({ code: "PROVIDER_RATE_LIMIT", message, retryable: true, hint: "Lower providers.<name>.maxConcurrent or retry later" });
15
24
  }
@@ -1101,6 +1101,9 @@ export async function executeRun(env, input) {
1101
1101
  }
1102
1102
  else if (input.signal?.aborted || last?.stopReason === "aborted") {
1103
1103
  status = "aborted";
1104
+ // Aborted while a provider error was pending (for example during the retry backoff): keep that error so the run says why it stalled.
1105
+ if (last?.stopReason === "error" && last.errorMessage)
1106
+ error = classifyProviderError(last.errorMessage).toPayload();
1104
1107
  }
1105
1108
  else if (last?.stopReason === "error") {
1106
1109
  status = "failed";
package/core/src/index.js CHANGED
@@ -18,6 +18,7 @@ export * from "./optimize/mine.js";
18
18
  export * from "./optimize/optimize.js";
19
19
  export * from "./optimize/optimizer-run.js";
20
20
  export * from "./optimize/reflect.js";
21
+ export * from "./providers/agy-p.js";
21
22
  export * from "./providers/claude-p.js";
22
23
  export * from "./providers/codex-p.js";
23
24
  export * from "./providers/kiro-p.js";