teapot-coding-agent 0.37.168 → 0.37.169

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.
@@ -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
- return STOP_PATTERNS.some((re) => re.test(t));
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.168",
3
+ "version": "0.37.169",
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",