open-agents-ai 0.187.27 → 0.187.29

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 +42 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -260551,6 +260551,39 @@ Briefly assess your situation and choose ONE action:
260551
260551
 
260552
260552
  Respond with your assessment, then take action.`;
260553
260553
  }
260554
+ /**
260555
+ * WO-RL-02: Best-of-N execution — run N independent attempts, return highest-scoring.
260556
+ * Research: SWE-RM (2512.21919) +7-10 pts, MCTSr (2406.07394) 8B→GPT-4 level.
260557
+ * Research: Test-Time Compute Scaling (2408.03314) small + compute = 14x larger.
260558
+ *
260559
+ * Scoring: completed > not, fewer turns > more, has summary > no summary.
260560
+ * Candidates run sequentially to avoid overloading the backend.
260561
+ */
260562
+ async runBestOfN(task, context, n2) {
260563
+ const count = Math.min(n2 ?? this.options.bestOfN ?? 1, 5);
260564
+ if (count <= 1)
260565
+ return this.run(task, context);
260566
+ const candidates = [];
260567
+ const perCandidateTurns = Math.max(5, Math.floor((this.options.maxTurns ?? 25) / count));
260568
+ for (let i2 = 0; i2 < count; i2++) {
260569
+ const savedMaxTurns = this.options.maxTurns;
260570
+ this.options.maxTurns = perCandidateTurns;
260571
+ try {
260572
+ const result = await this.run(task, context);
260573
+ candidates.push(result);
260574
+ if (result.completed)
260575
+ break;
260576
+ } finally {
260577
+ this.options.maxTurns = savedMaxTurns;
260578
+ }
260579
+ }
260580
+ const scored = candidates.map((r2) => ({
260581
+ result: r2,
260582
+ score: (r2.completed ? 10 : 0) + (r2.summary && r2.summary.length > 50 ? 2 : 0) + Math.max(0, 5 - r2.turns * 0.3)
260583
+ }));
260584
+ scored.sort((a2, b) => b.score - a2.score);
260585
+ return scored[0].result;
260586
+ }
260554
260587
  /** Run a task through the agentic loop */
260555
260588
  async run(task, context) {
260556
260589
  this.aborted = false;
@@ -261342,6 +261375,15 @@ If you're stuck, try a completely different approach. Do NOT repeat what failed
261342
261375
  }
261343
261376
  if (!result.success && tc.name !== "task_complete") {
261344
261377
  const failDesc = `${tc.name}(${filePath || "..."}): ${(result.error || "").slice(0, 100)}`;
261378
+ const consecutiveSameTool = this._taskState.failedApproaches.slice(-2).filter((f2) => f2.startsWith(`${tc.name}(`)).length;
261379
+ if (consecutiveSameTool >= 2 && (this.options.modelTier === "small" || this.options.modelTier === "medium")) {
261380
+ this.pendingUserMessages.push(`[PIVOT REQUIRED] You have failed ${consecutiveSameTool + 1} times in a row with ${tc.name}. Your current approach is not working. You MUST try something fundamentally different:
261381
+ - If file_edit keeps failing: re-read the file first, then use the EXACT text from the file
261382
+ - If shell keeps failing: try a different command or check prerequisites
261383
+ - If grep_search finds nothing: try broader patterns or list_directory
261384
+ - Consider using a completely different tool or strategy
261385
+ Do NOT retry ${tc.name} with similar arguments.`);
261386
+ }
261345
261387
  if (!this._taskState.failedApproaches.includes(failDesc)) {
261346
261388
  this._taskState.failedApproaches.push(failDesc);
261347
261389
  if (this._taskState.failedApproaches.length > 10) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.27",
3
+ "version": "0.187.29",
4
4
  "description": "AI coding agent powered by open-source models (Ollama/vLLM) — interactive TUI with agentic tool-calling loop",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",