teapot-coding-agent 0.35.2 → 0.35.4

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.
@@ -1141,11 +1141,22 @@ export class Agent {
1141
1141
  */
1142
1142
  get memoryFile() {
1143
1143
  const perSession = path.join(this.opts.sessionDir, "memory.md");
1144
- const agentWide = path.join(path.dirname(this.opts.sessionDir), "memory.md");
1145
- // `sessionDir` may itself be the agent-level directory in older layouts; only use the
1146
- // parent when the basename looks like a session (<agent>-<hex>)
1147
- const looksPerSession = /-[0-9a-f]{6,}$/i.test(path.basename(this.opts.sessionDir));
1148
- return looksPerSession ? agentWide : perSession;
1144
+ const parent = path.dirname(this.opts.sessionDir);
1145
+ /**
1146
+ * Agent-scoped when the session dir sits inside a `sessions/` ROOT, session-scoped otherwise.
1147
+ *
1148
+ * The previous test was `/-[0-9a-f]{6,}$/` against the basename — "looks like
1149
+ * `<agent>-<hex>`". MEASURED: `mkdtemp` suffixes are 6 alphanumerics, so ~0.2% of them are
1150
+ * all-hex and match. That made the memory file's LOCATION depend on a random temp name, which
1151
+ * is why a test asserting `read_memory(query)` failed in CI and passed locally: the fixture
1152
+ * `mems-AbCdEf` resolved to the agent-wide file, and a sibling test's notes were then in
1153
+ * scope.
1154
+ *
1155
+ * The structural fact is reliable: `Master.resolveSessionDir` always mints session dirs
1156
+ * inside its `sessions/` root, so a parent named `sessions` means "one level down from the
1157
+ * agent". A bare temp dir has no such parent and stays session-scoped.
1158
+ */
1159
+ return path.basename(parent) === "sessions" ? path.join(parent, "memory.md") : perSession;
1149
1160
  }
1150
1161
  /** the pre-migration location, read once so notes are not lost on upgrade */
1151
1162
  get legacyMemoryFile() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teapot-coding-agent",
3
- "version": "0.35.2",
3
+ "version": "0.35.4",
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",