hostwares-cli 2.4.2 → 2.4.3

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 +14 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1980,7 +1980,7 @@ ${opts.message}` : opts.message;
1980
1980
  if (seen > MAX_IDENTICAL_CALLS && isReadOnlyTool(call.name)) {
1981
1981
  shortCircuited.push({
1982
1982
  id: call.id,
1983
- result: `[loop guard] You already ran ${call.name}(${compactArgs(call.input)}) and nothing has changed since. This call was NOT executed. You are looping. If you have already written and verified the work this turn, STOP NOW and give your final answer \u2014 say what you changed, quote the check that passed, and end. Only continue calling tools if there is a concrete NEW change left to make; if so, make it directly instead of reading again.`
1983
+ result: `[loop guard] You already ran ${call.name}(${compactArgs(call.input)}) and nothing has changed since \u2014 re-reading it will keep returning the same thing. This call was NOT executed. STOP re-inspecting and DECIDE from what you already know: if a file the task needs does not exist yet, WRITE it now (write_file) \u2014 an empty or missing directory means the file has not been created, not that you should look again. If every file the task needs already exists and has been run/verified, give your final answer now (what you built + how to run it) and end. Do NOT read or list again.`
1984
1984
  });
1985
1985
  emit({ type: "tool:end", id: call.id, tool: call.name, ok: false, durationMs: 0, summary: "loop guard: repeated read skipped" });
1986
1986
  } else if (WRITE_TOOLS.has(call.name) && path && (writeCounts.get(path) ?? 0) >= MAX_WRITES_PER_FILE) {
@@ -1998,9 +1998,16 @@ ${opts.message}` : opts.message;
1998
1998
  stalledHops++;
1999
1999
  else
2000
2000
  stalledHops = 0;
2001
- if (stalledHops >= 2 || totalGuardHits >= 6) {
2002
- const wroteSomething = writeCounts.size > 0;
2003
- emit({ type: "error", message: wroteSomething ? `Stopping: I kept re-reading or rewriting the same files without making new progress. What I changed is saved; tell me specifically what to adjust next.` : `Stopping: I kept re-reading the same files without writing anything. I have enough context now \u2014 tell me the specific change you want and I'll make it directly.` });
2001
+ const wroteThisHop = toRun.some((c2) => WRITE_TOOLS.has(c2.name));
2002
+ if (wroteThisHop) {
2003
+ stalledHops = 0;
2004
+ }
2005
+ const filesWritten = writeCounts.size;
2006
+ const guardHitCeiling = 6 + filesWritten * 3;
2007
+ const stallCeiling = filesWritten > 0 ? 4 : 2;
2008
+ if (stalledHops >= stallCeiling || totalGuardHits >= guardHitCeiling) {
2009
+ const wroteSomething = filesWritten > 0;
2010
+ emit({ type: "error", message: wroteSomething ? `Stopping: I kept re-reading the same files without making new progress. What I built so far is saved. Tell me the specific next change (e.g. "write the UI file" / "start it") and I'll do it directly.` : `Stopping: I kept re-reading the same files without writing anything. I have enough context now \u2014 tell me the specific change you want and I'll make it directly.` });
2004
2011
  return finish({ conversationId, turnCredits, balance, text, aborted: false });
2005
2012
  }
2006
2013
  for (const c2 of toRun) {
@@ -3321,6 +3328,9 @@ async function runCliTurn(opts) {
3321
3328
  spinner.stop();
3322
3329
  error(e.message);
3323
3330
  break;
3331
+ case "tool:pending":
3332
+ spinner.stop();
3333
+ break;
3324
3334
  }
3325
3335
  }
3326
3336
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hostwares-cli",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "Hostwares CLI - AI DevOps in your terminal",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "url": "https://github.com/Hostwares/hostwares-cli/issues"
42
42
  },
43
43
  "devDependencies": {
44
+ "@hostwares/agent-client": "github:Hostwares/hostwares-agent-client#v1",
44
45
  "@types/node": "^20.0.0",
45
- "typescript": "^5.5.0",
46
46
  "esbuild": "^0.28.2",
47
- "@hostwares/agent-client": "github:Hostwares/hostwares-agent-client#v1"
47
+ "typescript": "^5.5.0"
48
48
  }
49
49
  }