teapot-coding-agent 0.37.125 → 0.37.127

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.
@@ -2976,6 +2976,42 @@ export class Agent {
2976
2976
  catch {
2977
2977
  }
2978
2978
  }
2979
+ /**
2980
+ * The GOAL and the open TODO list, re-attached as facts — not left to the summary.
2981
+ *
2982
+ * memory/files/AGENTS.md were re-attached, but the two things that actually drive the work were only implied
2983
+ * by the checkpoint the summarizer wrote. If that summary omits or paraphrases the goal, the agent drifts; and
2984
+ * the TODO list is the only copy of what is left. Reported as "compact後にアクティブなgoalとかTODOリストを再入
2985
+ * とかしてる? それしないと見失いそうだけど (TODOは更新せずに作業終わることがあるからなんとも言えないけど)".
2986
+ *
2987
+ * Only what's open is shown: a done item is noise after a compaction.
2988
+ */
2989
+ {
2990
+ /**
2991
+ * The WHOLE list, not just the unchecked lines.
2992
+ *
2993
+ * todo.md is free-form input — the operator writes paragraphs into it, and the checklist is the part of it
2994
+ * that survives a round trip, not the whole of it. Filtering to bullets would silently drop the context
2995
+ * around them. The only case worth omitting is when every item is already done: then the list says nothing
2996
+ * actionable, and its past is in the log.
2997
+ */
2998
+ const lines = this.todo.split("\n");
2999
+ const items = lines.filter((l) => /^\s*-/.test(l));
3000
+ const allDone = items.length > 0 && items.every((l) => /^\s*-\s*\[x\]/i.test(l));
3001
+ const todoText = allDone ? "" : this.todo.trim();
3002
+ const goalText = this.goal.text.trim();
3003
+ if (goalText || todoText) {
3004
+ this.messages.splice(1, 0, {
3005
+ role: "user",
3006
+ content: `[harness] Your goal and TODO list, re-attached after compaction:\n` +
3007
+ `goal (${this.goal.status}): ${goalText ? goalText.slice(0, 2_000) : "(none set)"}\n` +
3008
+ (todoText
3009
+ ? `todo.md (verbatim):\n${todoText.slice(0, 8_000)}\n` +
3010
+ `Update the list as you finish work (set_todo), so this list and reality cannot drift.`
3011
+ : `no task is open in todo.md right now — if work remains, write it there`),
3012
+ });
3013
+ }
3014
+ }
2979
3015
  if (this.recentReads.length && mode === "summarize") {
2980
3016
  const restored = [];
2981
3017
  const restoredPaths = new Set();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.37.125",
3
+ "version": "0.37.127",
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",