From 6f3eeea75b23fca61c4bcd309899bb7e4a46cc22 Mon Sep 17 00:00:00 2001 From: Advait Paliwal Date: Fri, 17 Apr 2026 15:42:30 -0700 Subject: [PATCH] Fix Feynman runtime auth env --- README.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- scripts/install/install.ps1 | 2 +- scripts/install/install.sh | 2 +- scripts/lib/pi-subagents-patch.mjs | 2 +- src/pi/runtime.ts | 2 ++ tests/pi-runtime.test.ts | 1 + tests/pi-subagents-patch.test.ts | 2 +- website/public/install | 2 +- website/public/install.ps1 | 2 +- website/src/content/docs/getting-started/installation.md | 4 ++-- 12 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 899579e..458847f 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ curl -fsSL https://feynman.is/install | bash irm https://feynman.is/install.ps1 | iex ``` -The one-line installer fetches the latest tagged release. To pin a version, pass it explicitly, for example `curl -fsSL https://feynman.is/install | bash -s -- 0.2.30`. +The one-line installer fetches the latest tagged release. To pin a version, pass it explicitly, for example `curl -fsSL https://feynman.is/install | bash -s -- 0.2.31`. The installer downloads a standalone native bundle with its own Node.js runtime. diff --git a/package-lock.json b/package-lock.json index 1b526c6..3945155 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@companion-ai/feynman", - "version": "0.2.30", + "version": "0.2.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@companion-ai/feynman", - "version": "0.2.30", + "version": "0.2.31", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 3e1be39..8d9ccf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@companion-ai/feynman", - "version": "0.2.30", + "version": "0.2.31", "description": "Research-first CLI agent built on Pi and alphaXiv", "license": "MIT", "type": "module", diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1 index 6c415ed..dbf92a2 100644 --- a/scripts/install/install.ps1 +++ b/scripts/install/install.ps1 @@ -110,7 +110,7 @@ This usually means the release exists, but not all platform bundles were uploade Workarounds: - try again after the release finishes publishing - pass the latest published version explicitly, e.g.: - & ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.30 + & ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.31 "@ } diff --git a/scripts/install/install.sh b/scripts/install/install.sh index be9e968..125b410 100644 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -261,7 +261,7 @@ This usually means the release exists, but not all platform bundles were uploade Workarounds: - try again after the release finishes publishing - pass the latest published version explicitly, e.g.: - curl -fsSL https://feynman.is/install | bash -s -- 0.2.30 + curl -fsSL https://feynman.is/install | bash -s -- 0.2.31 EOF exit 1 fi diff --git a/scripts/lib/pi-subagents-patch.mjs b/scripts/lib/pi-subagents-patch.mjs index 21cb56a..c200bac 100644 --- a/scripts/lib/pi-subagents-patch.mjs +++ b/scripts/lib/pi-subagents-patch.mjs @@ -11,7 +11,7 @@ export const PI_SUBAGENTS_PATCH_TARGETS = [ const RESOLVE_PI_AGENT_DIR_HELPER = [ "function resolvePiAgentDir(): string {", - ' const configured = process.env.PI_CODING_AGENT_DIR?.trim();', + ' const configured = process.env.FEYNMAN_CODING_AGENT_DIR?.trim() || process.env.PI_CODING_AGENT_DIR?.trim();', ' if (!configured) return path.join(os.homedir(), ".pi", "agent");', ' return configured.startsWith("~/") ? path.join(os.homedir(), configured.slice(2)) : configured;', "}", diff --git a/src/pi/runtime.ts b/src/pi/runtime.ts index 3e6400d..b22656e 100644 --- a/src/pi/runtime.ts +++ b/src/pi/runtime.ts @@ -123,6 +123,8 @@ export function buildPiEnv(options: PiRuntimeOptions): NodeJS.ProcessEnv { FEYNMAN_BIN_PATH: resolve(options.appRoot, "bin", "feynman.js"), FEYNMAN_NPM_PREFIX: feynmanNpmPrefixPath, // Ensure the Pi child process uses Feynman's agent dir for auth/models/settings. + // Patched Pi uses FEYNMAN_CODING_AGENT_DIR; upstream Pi uses PI_CODING_AGENT_DIR. + FEYNMAN_CODING_AGENT_DIR: options.feynmanAgentDir, PI_CODING_AGENT_DIR: options.feynmanAgentDir, PANDOC_PATH: process.env.PANDOC_PATH ?? resolveExecutable("pandoc", PANDOC_FALLBACK_PATHS), PI_HARDWARE_CURSOR: process.env.PI_HARDWARE_CURSOR ?? "1", diff --git a/tests/pi-runtime.test.ts b/tests/pi-runtime.test.ts index 74bfed8..46ab147 100644 --- a/tests/pi-runtime.test.ts +++ b/tests/pi-runtime.test.ts @@ -54,6 +54,7 @@ test("buildPiEnv wires Feynman paths into the Pi environment", () => { assert.equal(env.FEYNMAN_NPM_PREFIX, "/home/.feynman/npm-global"); assert.equal(env.NPM_CONFIG_PREFIX, "/home/.feynman/npm-global"); assert.equal(env.npm_config_prefix, "/home/.feynman/npm-global"); + assert.equal(env.FEYNMAN_CODING_AGENT_DIR, "/home/.feynman/agent"); assert.equal(env.PI_CODING_AGENT_DIR, "/home/.feynman/agent"); assert.ok( env.PATH?.startsWith( diff --git a/tests/pi-subagents-patch.test.ts b/tests/pi-subagents-patch.test.ts index 22fb3a1..6c3aec9 100644 --- a/tests/pi-subagents-patch.test.ts +++ b/tests/pi-subagents-patch.test.ts @@ -83,7 +83,7 @@ for (const scenario of CASES) { const patched = patchPiSubagentsSource(scenario.file, scenario.input); assert.match(patched, /function resolvePiAgentDir\(\): string \{/); - assert.match(patched, /process\.env\.PI_CODING_AGENT_DIR\?\.trim\(\)/); + assert.match(patched, /process\.env\.FEYNMAN_CODING_AGENT_DIR\?\.trim\(\) \|\| process\.env\.PI_CODING_AGENT_DIR\?\.trim\(\)/); assert.ok(patched.includes(scenario.expected)); assert.ok(!patched.includes(scenario.original)); }); diff --git a/website/public/install b/website/public/install index be9e968..125b410 100644 --- a/website/public/install +++ b/website/public/install @@ -261,7 +261,7 @@ This usually means the release exists, but not all platform bundles were uploade Workarounds: - try again after the release finishes publishing - pass the latest published version explicitly, e.g.: - curl -fsSL https://feynman.is/install | bash -s -- 0.2.30 + curl -fsSL https://feynman.is/install | bash -s -- 0.2.31 EOF exit 1 fi diff --git a/website/public/install.ps1 b/website/public/install.ps1 index 6c415ed..dbf92a2 100644 --- a/website/public/install.ps1 +++ b/website/public/install.ps1 @@ -110,7 +110,7 @@ This usually means the release exists, but not all platform bundles were uploade Workarounds: - try again after the release finishes publishing - pass the latest published version explicitly, e.g.: - & ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.30 + & ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.31 "@ } diff --git a/website/src/content/docs/getting-started/installation.md b/website/src/content/docs/getting-started/installation.md index 66f61f1..688cbde 100644 --- a/website/src/content/docs/getting-started/installation.md +++ b/website/src/content/docs/getting-started/installation.md @@ -117,13 +117,13 @@ These installers download the bundled `skills/` and `prompts/` trees plus the re The one-line installer already targets the latest tagged release. To pin an exact version, pass it explicitly: ```bash -curl -fsSL https://feynman.is/install | bash -s -- 0.2.30 +curl -fsSL https://feynman.is/install | bash -s -- 0.2.31 ``` On Windows: ```powershell -& ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.30 +& ([scriptblock]::Create((irm https://feynman.is/install.ps1))) -Version 0.2.31 ``` ## Post-install setup