teapot-coding-agent 0.37.168 → 0.37.170
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 +9 -2
- package/dist/agent/context-claim.js +27 -1
- package/package.json +1 -1
- package/public/assets/index-Bs4Oodmd.js +190 -0
- package/public/assets/index-Bs4Oodmd.js.map +1 -0
- package/public/index.html +1 -1
- package/public/assets/index-DSYA4hsV.js +0 -190
- package/public/assets/index-DSYA4hsV.js.map +0 -1
package/dist/agent/agent.js
CHANGED
|
@@ -241,8 +241,15 @@ export class Agent {
|
|
|
241
241
|
if (idx < 0)
|
|
242
242
|
return 0;
|
|
243
243
|
const queuedAhead = idx;
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
/**
|
|
245
|
+
* What BLOCKS dispatch, not just "is a turn running".
|
|
246
|
+
*
|
|
247
|
+
* MEASURED: during a compaction the status is `waiting`, and a compaction runs on the same chain, so a prompt
|
|
248
|
+
* enqueued then cannot start — but `ahead` said 0 (nothing ahead, no turn running) and the row showed a timestamp:
|
|
249
|
+
* "queuedのメッセージの1つ目が queued じゃなくて時刻が表示される". A parked tool call blocks the same way.
|
|
250
|
+
*/
|
|
251
|
+
const blocked = this.status === "running" || this.status === "waiting" || this.parkedByTool;
|
|
252
|
+
return queuedAhead + (queuedAhead === 0 && blocked ? 1 : 0);
|
|
246
253
|
}
|
|
247
254
|
stopRequested = false;
|
|
248
255
|
windDownRequested = false;
|
|
@@ -46,6 +46,15 @@ const STOP_PATTERNS = [
|
|
|
46
46
|
/残(?:り)?(?:の)?(?:コンテキスト|トークン)[^。\n]{0,12}(?:僅少|わずか|少な|尽き|残っていない|無くな)/,
|
|
47
47
|
/コンテキスト(?:の)?(?:残量|残り)[^。\n]{0,12}(?:僅少|わずか|少な|尽き|残っていない|無くな)/,
|
|
48
48
|
/(?:コンテキスト|トークン)(?:を)?(?:節約|温存)[^。\n]{0,20}(?:区切|停止|終了|打ち切)/,
|
|
49
|
+
/**
|
|
50
|
+
* …and the BUDGET wording of the same give-up, MEASURED in prismrv-2-9bb8660a: "今回の予算では達成できませんでした".
|
|
51
|
+
*
|
|
52
|
+
* It is the same false claim as "out of context" — compaction is the harness's job, so a budget the model invented is
|
|
53
|
+
* not a blocker — but it names no context/token word, so every pattern above missed it. The give-up verb is
|
|
54
|
+
* REQUIRED (達成できません / 完了できません / 間に合いません / 見送ります): "予算の範囲で実装しました" is a normal report
|
|
55
|
+
* and must stay untouched, which is the false-positive risk of widening this at all.
|
|
56
|
+
*/
|
|
57
|
+
/(?:今回|この|残りの?)(?:の)?(?:予算|ターン|セッション)[^。\n]{0,24}(?:では|内では|の範囲では)[^。\n]{0,24}(?:達成でき(?:ません|ない|なかった)|完了でき(?:ません|ない|なかった)|実装でき(?:ません|ない|なかった)|間に合いません|見送ります)/,
|
|
49
58
|
];
|
|
50
59
|
/**
|
|
51
60
|
* Strip what the agent is REPORTING from what it is SAYING.
|
|
@@ -77,7 +86,24 @@ export function claimsContextLimit(text) {
|
|
|
77
86
|
const t = withoutQuotedBlocks(raw);
|
|
78
87
|
if (!t.trim())
|
|
79
88
|
return false;
|
|
80
|
-
|
|
89
|
+
for (const re of STOP_PATTERNS) {
|
|
90
|
+
const m = re.exec(t);
|
|
91
|
+
if (!m)
|
|
92
|
+
continue;
|
|
93
|
+
/**
|
|
94
|
+
* A quote of the claim, or its negation, is not a claim.
|
|
95
|
+
*
|
|
96
|
+
* "今回の予算では達成できません、とは言えないので続けます" is a model REFUSING to stop, and answering it with a
|
|
97
|
+
* forced continue would be noise on an otherwise healthy turn — the operator's own risk note when this pattern was
|
|
98
|
+
* widened ("誤検知も増えそう"). Only the immediate tail is inspected, because the giveaway is the grammar of the same
|
|
99
|
+
* sentence, not something later in the paragraph.
|
|
100
|
+
*/
|
|
101
|
+
const tail = t.slice(m.index + m[0].length, m.index + m[0].length + 12);
|
|
102
|
+
if (/^(?:\s*[,、。]?\s*)?(?:とは(?:言え|限ら)な|わけではな|のではなく|というわけではな)/.test(tail))
|
|
103
|
+
continue;
|
|
104
|
+
return true;
|
|
105
|
+
}
|
|
106
|
+
return false;
|
|
81
107
|
}
|
|
82
108
|
/**
|
|
83
109
|
* "context 13% used (97k/750k, 653k to compaction)" — the ground truth the model does not otherwise have.
|