@companion-ai/feynman 0.5.31 → 0.5.32

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,10 @@ GitHub release notes are generated from the matching `## vX.Y.Z` section in this
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## v0.5.32 - 2026-10-09
10
+
11
+ - **A rejected sign-in now says what to do.** When `feynman model login` or `feynman setup` ended with `invalid_grant`, usually after Sign in with ChatGPT, Feynman printed only the provider's error. It now explains that a stale browser session usually causes it: sign out of the provider's site or use a private window, then run `feynman model login <provider>` again. For ChatGPT it also suggests `feynman model login openai-codex`.
12
+
9
13
  ## v0.5.31 - 2026-10-09
10
14
 
11
15
  - **Feynman starts again if you once installed the old `session-search` package.** Its entry stayed in `~/.feynman/agent/settings.json` after the preset was removed. On Node 24 that made every launch fail installing it, or crash Pi through its SQLite module or its extension. Feynman now drops the entry on launch; Feynman's sessions are searchable with `grep` or `rg` over `~/.feynman/sessions`.
@@ -742,6 +742,15 @@ export function getOrCreateDeviceId(authPath) {
742
742
  writeFileSync(settingsPath, `${JSON.stringify({ ...settings, deviceId }, null, 2)}\n`, "utf8");
743
743
  return deviceId;
744
744
  }
745
+ // A provider answers invalid_grant when it rejects the authorization code,
746
+ // usually because a stale session in the browser interfered with the sign-in.
747
+ // Signing out there (or using a private window) and retrying fixes it.
748
+ export function describeOAuthLoginFailure(providerId, error) {
749
+ if (!(error instanceof Error) || !error.message.includes("invalid_grant"))
750
+ return error;
751
+ const alternative = providerId === "openai" ? " Or sign in with `feynman model login openai-codex` instead." : "";
752
+ return new Error(`${error.message}\nThe sign-in was rejected, usually because of a stale browser session. Sign out of the provider's site in your browser, or use a private window, then run \`feynman model login ${providerId}\` again.${alternative}`);
753
+ }
745
754
  export async function loginModelProvider(authPath, providerId, settingsPath) {
746
755
  if (providerId) {
747
756
  const resolvedProvider = await resolveModelProviderForCommand(authPath, providerId);
@@ -809,7 +818,9 @@ export async function loginModelProvider(authPath, providerId, settingsPath) {
809
818
  }
810
819
  },
811
820
  signal: abortController.signal,
812
- }, { getDeviceId: () => getOrCreateDeviceId(authPath) });
821
+ }, { getDeviceId: () => getOrCreateDeviceId(authPath) }).catch((error) => {
822
+ throw describeOAuthLoginFailure(provider.id, error);
823
+ });
813
824
  printSuccess(`Model provider login complete: ${provider.id}`);
814
825
  await maybeSetRecommendedDefaultModel(settingsPath, authPath);
815
826
  return true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-ai/feynman",
3
- "version": "0.5.31",
3
+ "version": "0.5.32",
4
4
  "description": "Research-first CLI agent built on Pi and alphaXiv",
5
5
  "license": "MIT",
6
6
  "type": "module",