@kody-ade/kody-engine 0.4.186 → 0.4.188

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/bin/kody.js +17 -9
  2. package/package.json +1 -1
package/dist/bin/kody.js CHANGED
@@ -1309,7 +1309,7 @@ var init_loadPriorArt = __esm({
1309
1309
  // package.json
1310
1310
  var package_default = {
1311
1311
  name: "@kody-ade/kody-engine",
1312
- version: "0.4.186",
1312
+ version: "0.4.188",
1313
1313
  description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
1314
1314
  license: "MIT",
1315
1315
  type: "module",
@@ -2215,11 +2215,15 @@ async function runAgent(opts) {
2215
2215
  );
2216
2216
  }
2217
2217
  finalText = resultTexts.join("\n\n---\n\n");
2218
- if (outcome === "completed" && !sawMutatingTool && tokens.output === 0 && finalText === "") {
2219
- outcome = "failed";
2220
- outcomeKind = "model_error";
2221
- noWorkSuccess = true;
2222
- errorMessage = errorMessage ?? "session reported success but produced no model output (0 output tokens) \u2014 backend likely unreachable";
2218
+ if (outcome === "completed" && !sawMutatingTool) {
2219
+ const backendDead = opts.isBackendHealthy ? !await opts.isBackendHealthy() : false;
2220
+ const zeroOutput = tokens.output === 0 && finalText === "";
2221
+ if (backendDead || zeroOutput) {
2222
+ outcome = "failed";
2223
+ outcomeKind = "model_error";
2224
+ noWorkSuccess = true;
2225
+ errorMessage = errorMessage ?? (backendDead ? "model backend unreachable after a reported success \u2014 proxy crashed mid-request (hollow success)" : "session reported success but produced no model output (0 output tokens) \u2014 backend likely unreachable");
2226
+ }
2223
2227
  }
2224
2228
  const shouldRetry = outcome === "failed" && attempt < MAX_CONNECTION_RETRIES && !sawMutatingTool && (isTransientConnectionError(errorMessage) || noWorkSuccess);
2225
2229
  if (!shouldRetry) break;
@@ -4195,7 +4199,7 @@ async function checkLitellmHealth(url) {
4195
4199
  return false;
4196
4200
  }
4197
4201
  }
4198
- var DEFAULT_LITELLM_STARTUP_TIMEOUT_SEC = 60;
4202
+ var DEFAULT_LITELLM_STARTUP_TIMEOUT_SEC = 150;
4199
4203
  var LITELLM_HEALTH_POLL_INTERVAL_MS = 2e3;
4200
4204
  function resolveLitellmTimeoutMs() {
4201
4205
  const envSec = Number(process.env.KODY_LITELLM_TIMEOUT_SEC);
@@ -4281,8 +4285,9 @@ ${tail}
4281
4285
  spawnProxy();
4282
4286
  return waitForHealth();
4283
4287
  };
4288
+ const isHealthy = () => checkLitellmHealth(url);
4284
4289
  if (await checkLitellmHealth(url)) {
4285
- return { url, kill: killChild, ensureHealthy };
4290
+ return { url, kill: killChild, isHealthy, ensureHealthy };
4286
4291
  }
4287
4292
  spawnProxy();
4288
4293
  if (!await waitForHealth()) {
@@ -4294,7 +4299,7 @@ ${tail}
4294
4299
  ${tail}`
4295
4300
  );
4296
4301
  }
4297
- return { url, kill: killChild, ensureHealthy };
4302
+ return { url, kill: killChild, isHealthy, ensureHealthy };
4298
4303
  }
4299
4304
  function readDotenvApiKeys(projectDir) {
4300
4305
  const dotenvPath = path14.join(projectDir, ".env");
@@ -14187,6 +14192,9 @@ async function runExecutable(profileName, input) {
14187
14192
  // On a connection drop mid-run, restart the (possibly crashed) proxy
14188
14193
  // before the agent retries. No-op for direct-Anthropic runs (lm null).
14189
14194
  ensureBackend: lm ? () => lm.ensureHealthy().then(() => void 0) : void 0,
14195
+ // Pure liveness probe so the agent can spot a hollow "success" (proxy
14196
+ // crashed mid-request, SDK still reported success). No-op when lm null.
14197
+ isBackendHealthy: lm ? () => lm.isHealthy() : void 0,
14190
14198
  verbose: input.verbose,
14191
14199
  quiet: input.quiet,
14192
14200
  ndjsonDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kody-ade/kody-engine",
3
- "version": "0.4.186",
3
+ "version": "0.4.188",
4
4
  "description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative executable profiles.",
5
5
  "license": "MIT",
6
6
  "type": "module",