teapot-coding-agent 0.37.156 → 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.
package/dist/agent/agent.js
CHANGED
|
@@ -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
|
-
/**
|
|
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;
|
|
@@ -1542,12 +1544,43 @@ export class Agent {
|
|
|
1542
1544
|
* auto-continue off or no goal set, because filing a report is not a decision to stop. Once per round, and
|
|
1543
1545
|
* reset by any round that does actual work.
|
|
1544
1546
|
*/
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1547
|
+
/**
|
|
1548
|
+
* …and when the branch does NOT fire, say why.
|
|
1549
|
+
*
|
|
1550
|
+
* A report followed by a stop went unanswered on mediapad-t5 at 09:29Z on a build that HAS the per-round reset,
|
|
1551
|
+
* and nothing in the log could explain it: every guard that could have swallowed the branch (`pendingPrompts`,
|
|
1552
|
+
* a running background shell, an audit cap) either logs its own note or leaves no trace. This note makes the
|
|
1553
|
+
* decision observable the next time it goes the wrong way.
|
|
1554
|
+
*/
|
|
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 &&
|
|
1548
1564
|
// a PAUSED goal means the operator parked this agent; forcing another turn would fight that
|
|
1549
1565
|
this.goal.status !== "paused") {
|
|
1550
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
|
+
}
|
|
1551
1584
|
await this.log.append("system_note", this.currentSession, this.currentBranch, {
|
|
1552
1585
|
event: "auto-continue-after-progress",
|
|
1553
1586
|
detail: "the round filed a progress report and then stopped — a report is not a stop, so the loop continues",
|
|
@@ -2283,6 +2316,7 @@ export class Agent {
|
|
|
2283
2316
|
this.contextClaimNudges = 0;
|
|
2284
2317
|
this.blockerAsks = 0;
|
|
2285
2318
|
this.reportedNudges = 0;
|
|
2319
|
+
this.stalledReportContinues = 0;
|
|
2286
2320
|
/**
|
|
2287
2321
|
* `reportedThisRound` deliberately SURVIVES work done after the report.
|
|
2288
2322
|
*
|