@strayl/agent 0.1.17 → 0.1.18

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/agent.js +5 -0
  2. package/package.json +1 -1
package/dist/agent.js CHANGED
@@ -13565,6 +13565,7 @@ async function runAgent(config) {
13565
13565
  const MAX_CONSECUTIVE_LLM_ERRORS = 5;
13566
13566
  let consecutiveTextOnly = 0;
13567
13567
  const MAX_CONSECUTIVE_TEXT_ONLY = 3;
13568
+ let totalToolCallsExecuted = 0;
13568
13569
  if (config.restoreCheckpoint) {
13569
13570
  const cp = config.restoreCheckpoint;
13570
13571
  context.restoreMessages(cp.messages);
@@ -13751,6 +13752,9 @@ ${IMPLEMENTATION_MODE_PROMPT2}`);
13751
13752
  });
13752
13753
  }
13753
13754
  if (completedToolCalls.length === 0) {
13755
+ if (totalToolCallsExecuted === 0) {
13756
+ break;
13757
+ }
13754
13758
  consecutiveTextOnly++;
13755
13759
  const completionPattern = /\b(task\s+(is\s+)?complete|all\s+done|finished|ready\s+to\s+(use|go|test)|work\s+is\s+done|that'?s\s+it|nothing\s+(else|more)\s+to\s+do|i'?m\s+done)\b/i;
13756
13760
  const isExplicitlyDone = completionPattern.test(assistantText);
@@ -13762,6 +13766,7 @@ ${IMPLEMENTATION_MODE_PROMPT2}`);
13762
13766
  continue;
13763
13767
  }
13764
13768
  consecutiveTextOnly = 0;
13769
+ totalToolCallsExecuted += completedToolCalls.length;
13765
13770
  for (const tc of completedToolCalls) {
13766
13771
  if (stdin.isCancelled()) {
13767
13772
  context.addToolResult(tc.id, tc.function.name, JSON.stringify({ error: "Cancelled by user." }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strayl/agent",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"