@strayl/agent 0.1.20 → 0.1.21

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 +7 -0
  2. package/package.json +1 -1
package/dist/agent.js CHANGED
@@ -13563,6 +13563,7 @@ async function runAgent(config) {
13563
13563
  const maxIterations = config.maxIterations ?? 200;
13564
13564
  let consecutiveLLMErrors = 0;
13565
13565
  const MAX_CONSECUTIVE_LLM_ERRORS = 5;
13566
+ let nudgedToContinue = false;
13566
13567
  if (config.restoreCheckpoint) {
13567
13568
  const cp = config.restoreCheckpoint;
13568
13569
  context.restoreMessages(cp.messages);
@@ -13749,8 +13750,14 @@ ${IMPLEMENTATION_MODE_PROMPT2}`);
13749
13750
  });
13750
13751
  }
13751
13752
  if (completedToolCalls.length === 0) {
13753
+ if (!nudgedToContinue) {
13754
+ nudgedToContinue = true;
13755
+ context.addUser("[System: You responded with text but did not call any tools. If you are done, respond with your final message. Otherwise, use your tools to continue working.]");
13756
+ continue;
13757
+ }
13752
13758
  break;
13753
13759
  }
13760
+ nudgedToContinue = false;
13754
13761
  for (const tc of completedToolCalls) {
13755
13762
  if (stdin.isCancelled()) {
13756
13763
  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.20",
3
+ "version": "0.1.21",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"