teapot-coding-agent 0.37.160 → 0.37.161

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.
@@ -1255,7 +1255,17 @@ export class Agent {
1255
1255
  ...(this.compactPhase ? { compacting: this.compactPhase } : {}),
1256
1256
  },
1257
1257
  pendingPrompts: this.pendingPrompts.length,
1258
- pendingPromptIds: this.pendingPrompts.map((p) => p.id).filter((x) => !!x).slice(0, 64),
1258
+ /**
1259
+ * The CANCELLABLE set — user prompts only (#141).
1260
+ *
1261
+ * Harness prompts are named too now (they need a row and a count), but they must not appear here: the ✕ cancel is
1262
+ * offered for what this list contains, and a queued harness message is not the operator's to withdraw.
1263
+ */
1264
+ pendingPromptIds: this.pendingPrompts
1265
+ .filter((p) => p.source === "user")
1266
+ .map((p) => p.id)
1267
+ .filter((x) => !!x)
1268
+ .slice(0, 64),
1259
1269
  pendingPromptQueue: this.pendingPrompts
1260
1270
  .filter((p) => !!p.id)
1261
1271
  .slice(0, 64)
@@ -1287,8 +1297,18 @@ export class Agent {
1287
1297
  this.activityChars = 0;
1288
1298
  this.turnsSinceProgress = 0;
1289
1299
  }
1290
- const promptId = source === "user" ? `u${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}` : "";
1291
- const entry = { source, text, images, ...(promptId ? { id: promptId } : {}) };
1300
+ /**
1301
+ * EVERY queued prompt gets an id, harness ones included.
1302
+ *
1303
+ * Only user prompts were given one, and the snapshot publishes just the prompts it can name
1304
+ * (`pendingPromptQueue`/`pendingPromptIds` filter on `id`). A queued harness prompt was therefore invisible to the
1305
+ * client — no row, no count — which is the remaining half of "harnessからのメッセージにqueuedがついてない問題が
1306
+ * v0.37.160 でもあった".
1307
+ */
1308
+ const promptId = source === "user"
1309
+ ? `u${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`
1310
+ : `h${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
1311
+ const entry = { source, text, images, id: promptId };
1292
1312
  this.pendingPrompts.push(entry);
1293
1313
  void this.ensureReady()
1294
1314
  .then(async () => {
@@ -2777,7 +2797,7 @@ export class Agent {
2777
2797
  : `The auditor returned no specific gaps. Re-read the verification contract above and re-run it yourself, item by item, before finishing again:\n\n${this.goal.verify?.slice(0, 2000) || this.goal.text.slice(0, 2000)}`;
2778
2798
  const retryText = `[harness] The completion audit REJECTED this finish. Address these gaps, then finish again with goalComplete=true:\n\n${gaps}`;
2779
2799
  if (this.consecutiveAuditRejects < (this.opts.maxAuditRejects ?? 3)) {
2780
- this.pendingPrompts.push({ source: "harness", text: retryText });
2800
+ this.pendingPrompts.push({ source: "harness", text: retryText, id: `h${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}` });
2781
2801
  await this.log.append("prompt", this.currentSession, this.currentBranch, {
2782
2802
  source: "harness",
2783
2803
  text: retryText,
@@ -2819,7 +2839,7 @@ export class Agent {
2819
2839
  `AUDIT, not a finding about your work. Before finishing again, state plainly and briefly what ` +
2820
2840
  `you verified for each item of the contract, so the auditor has something to judge.\n\n` +
2821
2841
  `${this.goal.verify?.slice(0, 2000) || this.goal.text.slice(0, 2000)}`;
2822
- this.pendingPrompts.push({ source: "harness", text });
2842
+ this.pendingPrompts.push({ source: "harness", text, id: `h${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}` });
2823
2843
  void this.log
2824
2844
  .append("prompt", this.currentSession, this.currentBranch, { source: "harness", text })
2825
2845
  .catch(() => { });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.160",
3
+ "version": "0.37.161",
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",