@companion-ai/feynman 0.5.6 → 0.5.8

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/RELEASES.md CHANGED
@@ -6,6 +6,15 @@ GitHub release notes are generated from the matching `## vX.Y.Z` section in this
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## v0.5.8 - 2026-09-26
10
+
11
+ - `FEYNMAN_HOME=~` or `~/path` now means your home folder. Unexpanded `~` (common in `.env` files, Docker `ENV`, and Windows shells) created a literal `~` folder in the current directory.
12
+ - Starting two Feynman sessions at the same moment no longer crashes one of them with "Subagent config changed during settings normalization". The second start keeps the subagent config the first one wrote.
13
+
14
+ ## v0.5.7 - 2026-09-26
15
+
16
+ - When Feynman runs as a package inside another Pi setup, an extension error no longer appears on every turn ("Cannot set properties of undefined (setting 'current_date')") if another extension or the host leaves the system-prompt sections unset (#298, thanks @Oscar-Williams in #300).
17
+
9
18
  ## v0.5.6 - 2026-09-26
10
19
 
11
20
  ### Failures report what went wrong
@@ -1,8 +1,15 @@
1
1
  import { mkdirSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
- import { resolve } from "node:path";
3
+ import { join, resolve } from "node:path";
4
+ // Like Pi's own agent-dir variable: a leading ~ in FEYNMAN_HOME (unexpanded in
5
+ // .env files, Docker ENV, or Windows shells) means the home folder.
6
+ export function expandHomePath(path, home = homedir()) {
7
+ if (path === "~")
8
+ return home;
9
+ return /^~[\\/]/.test(path) ? join(home, path.slice(2)) : path;
10
+ }
4
11
  export function getFeynmanHome() {
5
- return resolve(process.env.FEYNMAN_HOME ?? homedir(), ".feynman");
12
+ return resolve(expandHomePath(process.env.FEYNMAN_HOME ?? homedir()), ".feynman");
6
13
  }
7
14
  export function getFeynmanAgentDir(home = getFeynmanHome()) {
8
15
  return resolve(home, "agent");
@@ -180,15 +180,20 @@ export async function ensureFeynmanSettings(settingsPath, bundledSettingsPath, a
180
180
  settings.defaultModel = preferredModel.id;
181
181
  }
182
182
  }
183
- if (subagentDefaults) {
184
- const current = existsSync(subagentDefaults.path) ? readFileSync(subagentDefaults.path, "utf8") : undefined;
185
- if (current !== subagentDefaults.original) {
186
- throw new Error(`Subagent config changed during settings normalization: ${subagentDefaults.path}. Retry without overwriting it.`);
187
- }
183
+ // If another process wrote the subagent config while models were being
184
+ // discovered, keep its version instead of overwriting it or failing startup.
185
+ const subagentCurrent = subagentDefaults && existsSync(subagentDefaults.path) ? readFileSync(subagentDefaults.path, "utf8") : undefined;
186
+ if (subagentDefaults && subagentCurrent === subagentDefaults.original) {
188
187
  mkdirSync(dirname(subagentDefaults.path), { recursive: true });
189
- writeFileSync(subagentDefaults.path, subagentDefaults.content, {
190
- encoding: "utf8", mode: 0o600, flag: subagentDefaults.original === undefined ? "wx" : "w",
191
- });
188
+ try {
189
+ writeFileSync(subagentDefaults.path, subagentDefaults.content, {
190
+ encoding: "utf8", mode: 0o600, flag: subagentDefaults.original === undefined ? "wx" : "w",
191
+ });
192
+ }
193
+ catch (error) {
194
+ if (error.code !== "EEXIST")
195
+ throw error;
196
+ }
192
197
  }
193
198
  const content = JSON.stringify(settings, null, 2) + "\n";
194
199
  if (content === existing?.source)
@@ -16,6 +16,7 @@ export function registerCurrentDateResearchContext(
16
16
  now: () => Date = () => new Date(),
17
17
  ): void {
18
18
  pi.on("before_agent_start", (event) => {
19
+ event.systemPromptOptions.sections ??= {};
19
20
  event.systemPromptOptions.sections.current_date = buildCurrentDateResearchContext(now());
20
21
  });
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-ai/feynman",
3
- "version": "0.5.6",
3
+ "version": "0.5.8",
4
4
  "description": "Research-first CLI agent built on Pi and alphaXiv",
5
5
  "license": "MIT",
6
6
  "type": "module",