@caupulican/pi-adaptative 0.80.83 → 0.80.84

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.
@@ -1113,9 +1113,13 @@ export class AgentSession {
1113
1113
  // =========================================================================
1114
1114
  async _runAgentPrompt(messages) {
1115
1115
  try {
1116
+ const maxGoalLoopRounds = this.settingsManager.getAutonomySettings().maxStallTurns;
1117
+ this.agent.maxStallTurns = maxGoalLoopRounds;
1118
+ let goalLoopRounds = 1;
1116
1119
  await this.agent.prompt(messages);
1117
- while (await this._handlePostAgentRun()) {
1120
+ while ((maxGoalLoopRounds === 0 || goalLoopRounds < maxGoalLoopRounds) && (await this._handlePostAgentRun())) {
1118
1121
  await this.agent.continue();
1122
+ goalLoopRounds++;
1119
1123
  }
1120
1124
  }
1121
1125
  finally {