teapot-coding-agent 0.37.157 → 0.37.158

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.
@@ -1450,8 +1450,10 @@ export class Agent {
1450
1450
  progressRequestedThisRound = false;
1451
1451
  /** the agent called report_progress in this round — a report is not a stop (#215) */
1452
1452
  reportedThisRound = false;
1453
- /** bounded: the forced continue after a report may happen once per round */
1453
+ /** how many forced continues this round has issued (diagnostics only — the bound is on PROGRESS, not on reports) */
1454
1454
  reportedNudges = 0;
1455
+ /** consecutive forced continues that produced no work at all: the model is repeating, not progressing */
1456
+ stalledReportContinues = 0;
1455
1457
  /** the stream was aborted because the model looped on the same characters (#209) */
1456
1458
  degenerateOutput = false;
1457
1459
  degenerateStops = 0;
@@ -1550,19 +1552,35 @@ export class Agent {
1550
1552
  * a running background shell, an audit cap) either logs its own note or leaves no trace. This note makes the
1551
1553
  * decision observable the next time it goes the wrong way.
1552
1554
  */
1553
- if (!finished && this.reportedThisRound && this.reportedNudges >= 1) {
1554
- await this.log.append("system_note", this.currentSession, this.currentBranch, {
1555
- event: "auto-continue-after-progress-skipped",
1556
- reason: "the nudge budget for this round was already spent",
1557
- nudges: this.reportedNudges,
1558
- });
1559
- }
1560
- if (!finished &&
1561
- this.reportedThisRound &&
1562
- this.reportedNudges < 1 &&
1555
+ /**
1556
+ * EVERY report-then-stop is answered — there is no budget.
1557
+ *
1558
+ * "まず上限を設定すべきではなくない? インターバルで発火するprogress要求に対してそれぞれ答えてからちゃんと進んで
1559
+ * いるかっていうのが重要". The interval asks for a report; each answer must be followed by work, and a cap turns
1560
+ * that into "the third interval is ignored". What actually needs guarding is the case where the model answers
1561
+ * and does NOTHING — that is the stall counter below, which measures progress instead of counting reports.
1562
+ */
1563
+ if (!finished && this.reportedThisRound &&
1563
1564
  // a PAUSED goal means the operator parked this agent; forcing another turn would fight that
1564
1565
  this.goal.status !== "paused") {
1565
1566
  this.reportedNudges += 1;
1567
+ this.stalledReportContinues += 1;
1568
+ /**
1569
+ * …, but a model that answers "reported." and does NOTHING must not be pinged for ever.
1570
+ *
1571
+ * This is the guard that belongs here: measure PROGRESS, not reports. Any round that calls a work tool resets
1572
+ * the counter, so a session that reports on each interval and keeps working never trips it; a model repeating
1573
+ * "reported." ends the round with a note instead of spinning (measured without it: 1430 nudges in one round).
1574
+ */
1575
+ if (this.stalledReportContinues > 3) {
1576
+ await this.log.append("system_note", this.currentSession, this.currentBranch, {
1577
+ event: "auto-continue-after-progress-stalled",
1578
+ continues: this.stalledReportContinues,
1579
+ detail: "the model kept reporting progress without doing any work — stopping instead of pinging it again",
1580
+ });
1581
+ this.stalledReportContinues = 0;
1582
+ break;
1583
+ }
1566
1584
  await this.log.append("system_note", this.currentSession, this.currentBranch, {
1567
1585
  event: "auto-continue-after-progress",
1568
1586
  detail: "the round filed a progress report and then stopped — a report is not a stop, so the loop continues",
@@ -2298,6 +2316,7 @@ export class Agent {
2298
2316
  this.contextClaimNudges = 0;
2299
2317
  this.blockerAsks = 0;
2300
2318
  this.reportedNudges = 0;
2319
+ this.stalledReportContinues = 0;
2301
2320
  /**
2302
2321
  * `reportedThisRound` deliberately SURVIVES work done after the report.
2303
2322
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.157",
3
+ "version": "0.37.158",
4
4
  "description": "A lightweight, always-on multi-agent harness for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "AGPL-3.0-or-later",