@companion-ai/feynman 0.5.36 → 0.5.38

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.
@@ -6,7 +6,7 @@ Evidence:
6
6
  - Evidence over fluency. Prefer papers, official documentation, datasets, code, and direct experimental results over commentary.
7
7
  - Separate observations from inferences, and state uncertainty explicitly.
8
8
  - When a claim depends on recent literature or unstable facts, use tools before answering.
9
- - For papers, use the alpha tools (`alpha_search`, `alpha_get_paper`, `alpha_ask_paper`, `alpha_read_code`) and `feynman_science_database_search`. In a shell, call `feynman alpha ...`, not a bare global `alpha`.
9
+ - For papers, use the alpha tools (`alpha_search`, `alpha_get_paper`, `alpha_ask_paper`, `alpha_read_code`) and `feynman_science_database_search`. In a shell, call `feynman alpha ...`, not a bare global `alpha`. On macOS and Linux run Python as `python3`; `python` is often missing there.
10
10
  - For current topics (products, releases, pricing, benchmarks, docs, regulations, anything latest/current/recent), use `web_search` and `fetch_content` first. Never answer a current question from paper search alone. For mixed topics, use both.
11
11
  - Cite title, year, and a direct URL or identifier; prefer arXiv or alphaXiv links with the arXiv ID. Source-based answers end with a Sources section of direct URLs.
12
12
 
package/RELEASES.md CHANGED
@@ -6,6 +6,16 @@ GitHub release notes are generated from the matching `## vX.Y.Z` section in this
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## v0.5.38 - 2026-10-12
10
+
11
+ - **`/deepresearch` no longer waits for a "yes" after its plan.** About 1 in 5 people who started it never answered the approval question, so the research never ran. It now writes the plan, summarizes it, and continues, as `/lit` does. To check the plan first, say so in the request, for example `/deepresearch <topic>, show me the plan first`.
12
+ - **A failed model call says what went wrong.** When the provider rejects a request, Feynman now names the cause and the fix under the error: a model your account can't use (pick another with `/model`), no credits, a rate limit or used-up quota, rejected credentials (`feynman model login <provider>`), or a temporary outage. Most failed `/lit` and `/audit` runs ended on one of these. Feynman bugs go to github.com/Companion-Inc/feynman/issues; Pi's `/bug` reports to Pi's developers.
13
+ - Research runs on macOS and Linux no longer fail on `python: command not found`; Feynman tells the model to run `python3`.
14
+
15
+ ## v0.5.37 - 2026-10-12
16
+
17
+ - **A sign-in that came back without a code says what to do.** When the browser returned to `feynman model login` or `feynman setup` without an authorization code (seen mostly on Windows), Feynman printed only "Missing authorization code". It now gives the same advice as for `invalid_grant`: sign out of the provider's site or use a private window, then retry, and for ChatGPT it suggests `feynman model login openai-codex`.
18
+
9
19
  ## v0.5.36 - 2026-10-12
10
20
 
11
21
  - **A new user gets to a working model instead of a dead end.** Launching `feynman` with no model opens a menu to set one up.
@@ -742,11 +742,12 @@ 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.
745
+ // A provider answers invalid_grant when it rejects the authorization code, and
746
+ // the browser comes back with no code when the sign-in was denied or lost a
747
+ // redirect; a stale browser session usually causes both. Signing out there (or
748
+ // using a private window) and retrying fixes it.
748
749
  export function describeOAuthLoginFailure(providerId, error) {
749
- if (!(error instanceof Error) || !error.message.includes("invalid_grant"))
750
+ if (!(error instanceof Error) || !/invalid_grant|Missing authorization code/.test(error.message))
750
751
  return error;
751
752
  const alternative = providerId === "openai" ? " Or sign in with `feynman model login openai-codex` instead." : "";
752
753
  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}`);
@@ -0,0 +1,36 @@
1
+ import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
2
+
3
+ // Most failed research runs end on a provider error (quota, a key, a model the
4
+ // plan lacks). Pi follows them with its /bug hint, which reports to Pi's
5
+ // developers; this names the cause and the fix instead.
6
+ export function modelErrorHint(provider: string, error: string): string | undefined {
7
+ const login = `feynman model login ${provider}`;
8
+ if (/model_not_supported|requested model is not supported|not available to new users|does not support tools/i.test(error)) {
9
+ return `Your ${provider} account can't use this model. Pick another with /model (or \`feynman model set\`).`;
10
+ }
11
+ if (/\b402\b|credit|billing|balance is insufficient|payment required/i.test(error)) {
12
+ return `Your ${provider} account is out of credits. Add credits, or switch provider with /model.`;
13
+ }
14
+ if (/\b429\b|quota|rate.?limit|usage limit|resource.?exhausted|capacity|too many requests/i.test(error)) {
15
+ return `${provider} is rate-limiting this account or its quota is used up. Wait and retry, or switch model with /model.`;
16
+ }
17
+ if (/\b40[13]\b|invalid.{0,20}(api.?key|x-api-key|token)|authentication|unauthori[sz]ed|invalid_grant|refresh token/i.test(error)) {
18
+ return `${provider} rejected your credentials. Run \`${login}\` again, or check the API key you set.`;
19
+ }
20
+ if (/\b50[0-4]\b|overloaded|high demand|unavailable|timed out|timeout|terminated|connection error|fetch failed|ECONNRESET/i.test(error)) {
21
+ return `${provider} failed or timed out; this is usually temporary. Retry, or switch model with /model.`;
22
+ }
23
+ return undefined;
24
+ }
25
+
26
+ export function registerModelErrorHint(pi: ExtensionAPI): void {
27
+ pi.on("message_end", (event, ctx) => {
28
+ const message = event.message;
29
+ if (message.role !== "assistant" || message.stopReason !== "error" || !ctx.hasUI) return;
30
+ const hint = modelErrorHint(message.provider, message.errorMessage ?? "");
31
+ ctx.ui.notify(
32
+ `${hint ?? `${message.provider} returned an error.`} If this looks like a Feynman bug, report it at https://github.com/Companion-Inc/feynman/issues (Pi's /bug goes to Pi's developers).`,
33
+ "warning",
34
+ );
35
+ });
36
+ }
@@ -8,6 +8,7 @@ import { installFeynmanHeader } from "./research-tools/header.js";
8
8
  import { registerHelpCommand } from "./research-tools/help.js";
9
9
  import { registerHuggingFaceTools } from "./research-tools/huggingface.js";
10
10
  import { registerLaunchNotice } from "./research-tools/launch-notice.js";
11
+ import { registerModelErrorHint } from "./research-tools/model-error-hint.js";
11
12
  import { registerInitCommand, registerOutputsCommand } from "./research-tools/project.js";
12
13
  import { registerServiceTierControls } from "./research-tools/service-tier.js";
13
14
  import { registerScienceDatabaseTools } from "./research-tools/science-databases.js";
@@ -29,6 +30,7 @@ export default function researchTools(pi: ExtensionAPI): void {
29
30
  registerHelpCommand(pi);
30
31
  registerInitCommand(pi);
31
32
  registerLaunchNotice(pi);
33
+ registerModelErrorHint(pi);
32
34
  registerOutputsCommand(pi);
33
35
  registerServiceTierControls(pi);
34
36
  registerScienceDatabaseTools(pi);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-ai/feynman",
3
- "version": "0.5.36",
3
+ "version": "0.5.38",
4
4
  "description": "The open source AI research agent.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,7 +17,7 @@ Every run must leave these files on disk:
17
17
  - `outputs/<slug>.md` or `papers/<slug>.md`
18
18
  - `outputs/<slug>.provenance.md` or `papers/<slug>.provenance.md`
19
19
 
20
- Before the plan is approved, only the plan file may exist; do not create placeholder drafts, final outputs, or provenance files. After the user approves the plan, if any capability fails, continue in degraded mode and still write a blocked or partial final output and provenance sidecar. Never end with chat-only output after plan approval. Never end with only an explanation in chat after plan approval. Use `Verification: BLOCKED` when verification could not be completed.
20
+ Do not create placeholder drafts, final outputs, or provenance files before their stage. If any capability fails, continue in degraded mode and still write a blocked or partial final output and provenance sidecar. Never end with chat-only output or with only an explanation in chat. Use `Verification: BLOCKED` when verification could not be completed.
21
21
 
22
22
  ## Step 1: Plan
23
23
 
@@ -31,11 +31,7 @@ Create `outputs/.plans/<slug>.md` immediately. The plan must include:
31
31
 
32
32
  Make the scale decision before assigning owners in the plan. If the topic is a narrow "what is X" explainer, the plan must use lead-owned direct search tasks only; do not allocate researcher subagents in the task ledger.
33
33
 
34
- After writing the plan, stop and ask for explicit confirmation before gathering evidence. Summarize the plan briefly and ask:
35
-
36
- `Proceed with this deep research plan? Reply "yes" to continue, or tell me what to change.`
37
-
38
- Do not run searches, fetch sources, spawn subagents, draft, cite, review, or deliver final artifacts until the user confirms. If the user requests changes, update `outputs/.plans/<slug>.md` first, then ask for confirmation again.
34
+ After writing the plan, summarize it in a few lines and continue immediately in the same turn with the next tool call; never end a turn with a message that only announces what you will do next. Stop for confirmation only when the user explicitly asked to review the plan first; then ask `Proceed with this deep research plan? Reply "yes" to continue, or tell me what to change.`, and if they request changes, update `outputs/.plans/<slug>.md` before asking again.
39
35
 
40
36
  ## Step 2: Scale
41
37