open-agents-ai 0.187.522 → 0.187.524

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.
package/dist/index.js CHANGED
@@ -525969,17 +525969,24 @@ var init_agenticRunner = __esm({
525969
525969
  // (daemon timeout). End-of-Task block uses this to set finalStatus="timeout"
525970
525970
  // in the session_gist instead of "abandoned".
525971
525971
  _aborting = false;
525972
- // REG-61 (root-cause from batch523 stax read-paralysis): one-shot early
525973
- // nudge that fires ONCE when the agent has read >=5 things without making
525974
- // a single creative edit. REG-44 catches this class but only at turn≥12
525975
- // (window of 15) by then the read habit is entrenched and the agent
525976
- // ignores the prompt. REG-61 fires at turn >=4 with a much harder
525977
- // directive: "your next tool call must be a creative edit that creates
525978
- // a deliverable." This is the SAME shape as the osm-vs-stax breakthrough:
525979
- // osm's first creative edit at call #48 was package.json (build harness),
525980
- // stax never made one. Generic across ecosystems — names no specific
525981
- // file/manifest format, just "deliverable".
525982
- _reg61Fired = false;
525972
+ // REG-61 (root-cause from batch523/524 read-paralysis): sliding-window
525973
+ // first-edit / sustained-edit nudge. Fires when the agent has accumulated
525974
+ // ≥3 read-class calls since the last creative edit AND turn 4 (or
525975
+ // 5 turns since the last creative edit). Re-fires after a 5-turn cooldown
525976
+ // because batch524 showed BOTH failure modes:
525977
+ //
525978
+ // stax: 1 early file_write at call #3, then 22 reads without re-firing.
525979
+ // (Old one-shot REG-61 with `_lastFileWriteTurn<0` gate missed this.)
525980
+ //
525981
+ // osm: REG-61 fired at turn 4, agent responded with `todo_write`, then
525982
+ // resumed pure reads. (todo_write was treated as fulfilling the
525983
+ // creative-edit directive — directive text needs to exclude it.)
525984
+ //
525985
+ // Sliding-window with 5-turn cooldown handles both: re-fires when the
525986
+ // agent slips back into read-paralysis after a successful edit, and
525987
+ // updated directive text names the 4 valid creative-edit tools and
525988
+ // explicitly excludes todo_write/memory_write/list_directory.
525989
+ _reg61CooldownUntilTurn = -1;
525983
525990
  // MEM_PATH item #9: adaptive retrieval cache. When the (goalHash, recent-tool-sig)
525984
525991
  // hasn't changed since last retrieval, skip the PPR call entirely and reuse
525985
525992
  // the previous memoryLines.
@@ -526376,6 +526383,122 @@ Your hypotheses MUST address this specific error, not generic causes.
526376
526383
  return null;
526377
526384
  }
526378
526385
  }
526386
+ /**
526387
+ * REG-61 sliding-window first-edit / sustained-edit nudge.
526388
+ *
526389
+ * Fires when:
526390
+ * • turn ≥ 4 (give the agent a few turns to orient)
526391
+ * • EITHER this run has zero creative edits OR the last creative edit
526392
+ * was ≥ 5 turns ago (re-fires when agent slips back into read mode)
526393
+ * • there have been ≥ 3 read-class tool calls in the trailing window
526394
+ * (since the last creative edit)
526395
+ * • not in the 5-turn cooldown after a previous firing
526396
+ *
526397
+ * Why earlier than REG-44/REG-58: by turn 12 the read habit is locked in
526398
+ * and prompts get ignored. Re-fire-with-cooldown handles the batch524 stax
526399
+ * case where one early file_write satisfied the initial gate, then the
526400
+ * agent spent 22 turns re-reading source. Directive text names the 4 valid
526401
+ * creative-edit tools EXPLICITLY and lists todo_write as NOT counting
526402
+ * (batch524 osm responded to the original directive with todo_write
526403
+ * thinking it qualified). Generic across ecosystems — no manifest/file/
526404
+ * language keywords.
526405
+ *
526406
+ * BFC-61 (root-cause from batch527-midi-solo): refactored from inline
526407
+ * block in the main turn loop into this method so the brute-force
526408
+ * re-engagement inner loop can also invoke it. Without BFC-61, REG-61
526409
+ * stops checking once the runner enters brute-force cycles, allowing
526410
+ * 30+ minutes of read-paralysis (batch527 hit this — 804 consecutive
526411
+ * non-edit calls in brute-force, REG-61 fired 0× in that phase).
526412
+ *
526413
+ * Side effects when firing:
526414
+ * - bumps `this._reg61CooldownUntilTurn`
526415
+ * - pushes a system message with the directive into `messages`
526416
+ * - emits a `status` event with telemetry (turn, reads_in_window, gap)
526417
+ *
526418
+ * State (instance fields, persist across cycles — desired):
526419
+ * - `_lastFileWriteTurn`: bumped by tool dispatch on creative edits
526420
+ * - `_reg61CooldownUntilTurn`: bumped by this method when firing
526421
+ *
526422
+ * @param turn - Current turn counter from the enclosing loop. In
526423
+ * brute-force cycles this resets to 0 each cycle, but the
526424
+ * cooldown / lastFileWriteTurn state is retained across
526425
+ * cycles via instance fields, so behavior is consistent.
526426
+ * @param toolCallLog - Append-only ordered tool-call history.
526427
+ * @param messages - Conversation history to inject the system directive into.
526428
+ * @param cycleLabel - Optional label to disambiguate brute-force fires
526429
+ * from main-loop fires in the status emit (e.g. "bf-cycle 2").
526430
+ */
526431
+ _runReg61Check(turn, toolCallLog, messages2, cycleLabel) {
526432
+ const REG61_TURN_FLOOR = 4;
526433
+ const REG61_MIN_READS = 3;
526434
+ const REG61_NO_WRITE_GAP = 5;
526435
+ const REG61_COOLDOWN = 5;
526436
+ if (process.env["OA_DISABLE_REG61"] === "1")
526437
+ return;
526438
+ if (turn < REG61_TURN_FLOOR)
526439
+ return;
526440
+ if (turn <= this._reg61CooldownUntilTurn)
526441
+ return;
526442
+ const _writeGate = this._lastFileWriteTurn < 0 || turn - this._lastFileWriteTurn >= REG61_NO_WRITE_GAP;
526443
+ if (!_writeGate)
526444
+ return;
526445
+ const _readClassNames = /* @__PURE__ */ new Set([
526446
+ "file_read",
526447
+ "file_explore",
526448
+ "list_directory",
526449
+ "grep_search",
526450
+ "glob_find",
526451
+ "find_files",
526452
+ "code_neighbors",
526453
+ "repo_map",
526454
+ "codebase_map",
526455
+ "semantic_map",
526456
+ "symbol_search",
526457
+ "todo_read",
526458
+ "memory_read",
526459
+ "memory_search"
526460
+ ]);
526461
+ const _editClassNames = /* @__PURE__ */ new Set([
526462
+ "file_write",
526463
+ "file_edit",
526464
+ "batch_edit",
526465
+ "file_patch"
526466
+ ]);
526467
+ let _readsInWindow = 0;
526468
+ for (let k = toolCallLog.length - 1; k >= 0; k--) {
526469
+ const _name = toolCallLog[k].name;
526470
+ if (_editClassNames.has(_name))
526471
+ break;
526472
+ if (_readClassNames.has(_name))
526473
+ _readsInWindow++;
526474
+ }
526475
+ if (_readsInWindow < REG61_MIN_READS)
526476
+ return;
526477
+ this._reg61CooldownUntilTurn = turn + REG61_COOLDOWN;
526478
+ const _gapDesc = this._lastFileWriteTurn < 0 ? `no creative edits yet this run` : `${turn - this._lastFileWriteTurn} turns since last creative edit (turn ${this._lastFileWriteTurn})`;
526479
+ const reg61Msg = `[FIRST-EDIT NUDGE — REG-61]
526480
+ You have made ${_readsInWindow} read/exploration calls in the trailing window — ${_gapDesc}. Reading is preparation; writing is progress. Runs that stay in pure-read mode produce zero deliverables.
526481
+
526482
+ Your NEXT tool call MUST be EXACTLY ONE of:
526483
+ • file_write — create a new file
526484
+ • file_edit — modify an existing file (find/replace)
526485
+ • batch_edit — multiple find/replace edits in one call
526486
+ • file_patch — apply a unified diff
526487
+
526488
+ These are the ONLY four tools that count as creative edits. The following do NOT count and will NOT satisfy this directive:
526489
+ • todo_write (only updates the todo list, not the filesystem)
526490
+ • memory_write (writes to memory store, not the project)
526491
+ • list_directory / file_read / file_explore / grep_search / shell
526492
+
526493
+ Pick the SMALLEST concrete deliverable from the spec — typically the project entry point or the file most other modules depend on. Write a stub or skeleton if the full implementation is too large; you can iterate later. Do NOT issue another read or todo update before producing the next file_write/file_edit/batch_edit/file_patch.`;
526494
+ messages2.push({ role: "system", content: reg61Msg });
526495
+ const _cyclePart = cycleLabel ? ` (${cycleLabel})` : "";
526496
+ this.emit({
526497
+ type: "status",
526498
+ content: `REG-61 FIRST-EDIT NUDGE — fired at turn ${turn}${_cyclePart}; reads_in_window=${_readsInWindow}; ${_gapDesc}`,
526499
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
526500
+ });
526501
+ }
526379
526502
  readSessionTodos() {
526380
526503
  try {
526381
526504
  const sid = process.env["OA_SESSION_ID"] || this._sessionId || "default";
@@ -528189,7 +528312,7 @@ Respond with your assessment, then take action.`;
528189
528312
  this._lastFileWriteTurn = -1;
528190
528313
  this._fileWriteTimestamps = [];
528191
528314
  this._aborting = false;
528192
- this._reg61Fired = false;
528315
+ this._reg61CooldownUntilTurn = -1;
528193
528316
  if (!globalThis.__oa_rca1_sigterm_installed) {
528194
528317
  globalThis.__oa_rca1_sigterm_installed = true;
528195
528318
  const _sigtermHandler = () => {
@@ -528613,49 +528736,7 @@ TASK: ${task}` : task;
528613
528736
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
528614
528737
  });
528615
528738
  }
528616
- const REG61_TURN_FLOOR = 4;
528617
- const REG61_MIN_READS = 3;
528618
- if (!this._reg61Fired && turn >= REG61_TURN_FLOOR && this._lastFileWriteTurn < 0 && process.env["OA_DISABLE_REG61"] !== "1") {
528619
- const _readClassNames = /* @__PURE__ */ new Set([
528620
- "file_read",
528621
- "file_explore",
528622
- "list_directory",
528623
- "grep_search",
528624
- "glob_find",
528625
- "find_files",
528626
- "code_neighbors",
528627
- "repo_map",
528628
- "codebase_map",
528629
- "semantic_map",
528630
- "symbol_search",
528631
- "todo_read",
528632
- "memory_read",
528633
- "memory_search"
528634
- ]);
528635
- let _readsThisRun = 0;
528636
- for (const c9 of toolCallLog) {
528637
- if (_readClassNames.has(c9.name))
528638
- _readsThisRun++;
528639
- }
528640
- if (_readsThisRun >= REG61_MIN_READS) {
528641
- this._reg61Fired = true;
528642
- const reg61Msg = `[FIRST-EDIT NUDGE — REG-61]
528643
- You have made ${_readsThisRun} read/exploration calls without yet producing a creative edit. Reading is preparation; writing is progress. Successful runs produce their first deliverable EARLY and iterate from there — runs that stay in pure-read mode produce zero deliverables.
528644
-
528645
- Your NEXT tool call MUST be a creative edit:
528646
- • file_write — create a new file (preferred for greenfield)
528647
- • file_edit — modify an existing file
528648
- • batch_edit / file_patch — multi-line changes
528649
-
528650
- Pick the SMALLEST concrete deliverable from the spec — typically the project entry point or the file most other modules depend on. Write a stub or skeleton if the full implementation is too large; you can iterate later. Do NOT issue another file_read, list_directory, grep_search, or shell-cat before producing this first edit. After the edit lands, continue normally.`;
528651
- messages2.push({ role: "system", content: reg61Msg });
528652
- this.emit({
528653
- type: "status",
528654
- content: `REG-61 FIRST-EDIT NUDGE — fired at turn ${turn}; reads_so_far=${_readsThisRun}`,
528655
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
528656
- });
528657
- }
528658
- }
528739
+ this._runReg61Check(turn, toolCallLog, messages2);
528659
528740
  const REG58_NO_WRITE_BUDGET = 30;
528660
528741
  if (turn > stagnationCooldownUntilTurn && this._lastFileWriteTurn >= 0 && turn - this._lastFileWriteTurn >= REG58_NO_WRITE_BUDGET && process.env["OA_DISABLE_REG58"] !== "1") {
528661
528742
  const gap = turn - this._lastFileWriteTurn;
@@ -532090,6 +532171,7 @@ Your most recent tool calls SUCCEEDED. If the task is complete, call task_comple
532090
532171
  content: `Re-engaging — cycle ${bruteForceCycle} (${totalTurns} turns, ${toolCallCount} tool calls so far)`,
532091
532172
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
532092
532173
  });
532174
+ this._reg61CooldownUntilTurn = -1;
532093
532175
  messages2.push({
532094
532176
  role: "user",
532095
532177
  content: `[CONTINUATION — Cycle ${bruteForceCycle}]
@@ -532123,6 +532205,7 @@ You have ${this.options.maxTurns} more turns. Continue making progress. Call tas
532123
532205
  this.emit({ type: "error", content: "Task aborted by user", timestamp: (/* @__PURE__ */ new Date()).toISOString() });
532124
532206
  break;
532125
532207
  }
532208
+ this._runReg61Check(turn, toolCallLog, messages2, `bf-cycle ${bruteForceCycle}`);
532126
532209
  const bfNow = Date.now();
532127
532210
  if (bfNow > nextSelfEval) {
532128
532211
  selfEvalCount++;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.522",
3
+ "version": "0.187.524",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "open-agents-ai",
9
- "version": "0.187.522",
9
+ "version": "0.187.524",
10
10
  "hasInstallScript": true,
11
11
  "license": "CC-BY-NC-4.0",
12
12
  "dependencies": {
@@ -2070,12 +2070,12 @@
2070
2070
  "license": "MIT"
2071
2071
  },
2072
2072
  "node_modules/axios": {
2073
- "version": "1.15.2",
2074
- "resolved": "https://registry.npmjs.org/axios/-/axios-1.15.2.tgz",
2075
- "integrity": "sha512-wLrXxPtcrPTsNlJmKjkPnNPK2Ihe0hn0wGSaTEiHRPxwjvJwT3hKmXF4dpqxmPO9SoNb2FsYXj/xEo0gHN+D5A==",
2073
+ "version": "1.16.0",
2074
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz",
2075
+ "integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==",
2076
2076
  "license": "MIT",
2077
2077
  "dependencies": {
2078
- "follow-redirects": "^1.15.11",
2078
+ "follow-redirects": "^1.16.0",
2079
2079
  "form-data": "^4.0.5",
2080
2080
  "proxy-from-env": "^2.1.0"
2081
2081
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "open-agents-ai",
3
- "version": "0.187.522",
3
+ "version": "0.187.524",
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",