pi-free 2.2.3 → 2.2.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.
package/CHANGELOG.md CHANGED
@@ -7,70 +7,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [2.2.3] - 2026-06-19
10
+ ## [2.2.4] - 2026-06-27
11
11
 
12
- ### Refactored
13
-
14
- - `index.ts`: Introduce a `UNIQUE_PROVIDERS` array as the single source
15
- of truth for the provider list. `Promise.allSettled` now maps over
16
- it instead of a hardcoded 14-element literal, so adding a new
17
- provider is a one-line change in the array (DRYKISS DRY finding).
18
- - `index.ts`: Trim the outdated top-level docstring; point to
19
- `UNIQUE_PROVIDERS` and `README.md` for the full provider catalog
20
- (DRYKISS Documentation finding).
12
+ ### Added
21
13
 
22
- ## [2.2.2] - 2026-06-19
14
+ - **OpenModel AI provider** — Anthropic-compatible LLM gateway at `api.openmodel.ai` (24 models). Merges the public `/web/v1/models` catalog (real per-token pricing via `price_multiplier`, supports flags, max tokens) with the authed `/v1/models` protocol list. Registers only messages-protocol models. The current **DeepSeek V4 Flash Free Event** is automatically detected: `deepseek-v4-flash` has `price_multiplier=0` → free via Route A (no hardcoding required). 6 free models surface under `free_only`: `deepseek-v4-flash` (1M context, MoE), plus 5 DashScope Qwen models whose catalog entries have no per-token pricing. Set `OPENMODEL_API_KEY` or add `openmodel_api_key` to `~/.pi/free.json`. Toggle with `/toggle-openmodel` ([#269](https://github.com/apmantza/pi-free/pull/269)).
23
15
 
24
- ### Refactored
16
+ - `npm run smoke:openmodel` — Live end-to-end check for the OpenModel Anthropic-Messages wire format. Reads `OPENMODEL_API_KEY` from env or `~/.pi/free.json`; skips with exit 0 when neither is set, exits 1 on any non-200 or malformed response.
25
17
 
26
- - `config.ts`: Introduced `PROVIDER_META` table that pairs each
27
- provider's ID, env-var prefix, and typed config key. `getProviderShowPaid`
28
- now delegates to a generic `resolveShowPaidForProvider` resolver
29
- instead of a 17-case switch. New `PROVIDER_OPENROUTER`, `PROVIDER_OPENCODE`,
30
- and `PROVIDER_FASTROUTER` constants added to `constants.ts` and used
31
- in the table (DRYKISS DRY/Architecture findings).
32
- - `index.ts`: Wrap dynamic built-in provider import in `try/catch`
33
- with full error+stack logging to both `~/.pi/free.log` and stderr
34
- (DRYKISS Resilience finding).
35
- - `providers/bai/bai.ts`: Improve startup-failure message to point users
36
- at `~/.pi/free.log` and their API key (DRYKISS Resilience finding).
18
+ - **Kilo and Cline API key authentication** — Both providers now support direct API key auth alongside OAuth. Set `KILO_API_KEY` / `CLINE_API_KEY` (or `kilo_api_key` / `cline_api_key` in `~/.pi/free.json`) to skip the OAuth flow. When a key is configured, the provider registers without OAuth and uses the key for model fetching and chat requests ([#282](https://github.com/apmantza/pi-free/pull/282)).
37
19
 
38
- ## [2.2.1] - 2026-06-19
20
+ ### Removed
39
21
 
40
- ### Security
22
+ - **AgentRouter provider** — The `agentrouter.org` gateway is unreachable from Pi: its OpenAI-compatible path returns `unauthorized client detected` for every direct API client (Codex CLI only), and the Anthropic path returned the same error for every key we tested. The "free public-welfare" tier is therefore not accessible from this extension, so the provider has been removed. Files deleted: `providers/agentrouter/agentrouter.ts`, `tests/agentrouter.test.ts`. Cleaned up: `PROVIDER_AGENTROUTER` / `BASE_URL_AGENTROUTER` in `constants.ts`, the `agentrouter_api_key` and `agentrouter_show_paid` config fields, the `PROVIDER_META` entry, `getAgentrouterApiKey` / `getAgentrouterShowPaid`, the import + `UNIQUE_PROVIDERS` slot in `index.ts`, and the `agentrouter` entry in the `freemiumProviders` Set. The corresponding `### Added` entry for AgentRouter is also removed from this release.
41
23
 
42
- - `~/.pi/free.json` (which contains API keys for paid providers) is now
43
- written and re-tightened with mode `0600` (owner read/write only) on
44
- every startup and on every write. Previously the file was world-readable
45
- on Unix. No-op on Windows. Closes DRYKISS finding.
24
+ - **Naraya AI Router provider** — The `router.naraya.ai` gateway's `/v1/*` namespace is broken (observed 2026-06-23 and counting): every request returns HTTP 200 with `content-length: 0` and no `content-type` — nginx is responding with a default 200 but the upstream API is unreachable. The marketing website (`router.naraya.ai/`) is still up, so the failure mode is the `/v1/*` reverse-proxy backend specifically. No working API = no usable provider, so Naraya has been removed. Files deleted: `providers/naraya/naraya.ts`, `tests/naraya.test.ts`. Cleaned up: `PROVIDER_NARAYA` / `BASE_URL_NARAYA` in `constants.ts`, the `naraya_api_key` and `naraya_show_paid` config fields, the `PROVIDER_META` entry, `getNarayaApiKey` / `getNarayaShowPaid`, the import + `UNIQUE_PROVIDERS` slot in `index.ts`, and the `naraya` entry in the `freemiumProviders` Set. Orphaned `MODEL_VARIANTS` entries (`mistral-medium-3-5` → `mistral-medium-3.5`, `deepseek-v4-flash-naraya` → `deepseek-v4-flash-reasoning-high-effort`) in `provider-failover/benchmark-lookup.ts` were also removed.
46
25
 
47
26
  ### Fixed
48
27
 
49
- - Wrap quota monitoring and telemetry event handlers in `try/catch` so a
50
- failed status-bar update or telemetry write can never break the agent
51
- loop (DRYKISS resilience findings).
28
+ - **OpenModel 404 (`route not found`)** The shared `createReRegister` / `registerOpenAICompatible` / `createCtxReRegister` helpers in `provider-helper.ts` hardcoded `api: "openai-completions"` regardless of the provider's actual wire protocol. This silently forced OpenModel to POST to `/v1/chat/completions` even though it is an Anthropic-protocol gateway, returning `404 {"code":"NOT_FOUND","msg":"route not found"}` on every chat call. Added an optional `api` field on `OpenAICompatibleConfig` (default `"openai-completions"` for backward compatibility with the 17 existing callers) and threaded it through all three helpers. OpenModel now passes `api: "anthropic-messages"` so pi-ai dispatches to the Anthropic SDK and POSTs to `/v1/messages` correctly. New test file `tests/provider-helper-api-field.test.ts` pins the new behaviour (6 tests covering default, anthropic-messages, ctx variant, and header preservation). Live-verified end-to-end against `https://api.openmodel.ai/v1/messages` with a real `OPENMODEL_API_KEY` via `scripts/smoke-openmodel-wire-format.ts` — both non-streaming JSON (200 with Anthropic Messages shape) and streaming SSE (200 with `text/event-stream`, `event: message_start` + `event: content_block_start` + thinking deltas) work.
52
29
 
53
- ## [2.2.0] - 2026-06-19
30
+ (Removed: `mistral-medium-3-5` / `deepseek-v4-flash-naraya` CI matching fix and `mistral-medium-3-5` CI score fix entries — Naraya is gone, so the hyphen-form variants no longer need a benchmark lookup alias.)
54
31
 
55
- ### Added
32
+ ### Verified clean (no fix needed)
56
33
 
57
- - **b.ai** provider (`api.b.ai/v1`) OpenAI-compatible gateway with 29 models
58
- (Claude Opus 4.x / Sonnet 4.x, GPT-5.x family, Gemini 3.x family, DeepSeek
59
- V4 / V3.2, GLM-5.x, Kimi K2.5, Qwen 3.6-27B, MiniMax M3 / M2.7). Currently
60
- advertises `MiniMax-M3` as a limited-time free promotional model; all
61
- other models default to paid (visible by default). Static API key auth via
62
- `BAI_API_KEY` env var or `bai_api_key` in `~/.pi/free.json`. New commands:
63
- `/toggle-bai`.
34
+ The following recent model IDs correctly miss `all-strategies-failed` because the benchmark DB genuinely has no entry for them — no fabricated scores added (pending the next `scripts/update-benchmarks.ts` run against the Artificial Analysis API):
64
35
 
65
- ### Security
36
+ - `minimax-m3` — latest MiniMax generation, not yet in benchmark DB
37
+ - `claude-haiku-4-5` — Claude Haiku 4.5, not yet in benchmark DB
38
+ - `qwen3.6-flash` — Qwen 3.6 Flash variant, not yet in benchmark DB
66
39
 
67
- - Bumped `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, and
68
- `@earendil-works/pi-tui` to `^0.79.8` — resolves Dependabot advisories
69
- #19 and #21 (high-severity protobufjs, ws, undici vulnerabilities in
70
- `@earendil-works/pi-coding-agent`).
71
- - Bumped `typescript` devDep to `^6.0.3`.
72
- - Removed now-redundant `overrides` for `protobufjs` and `ws` (fixed
73
- upstream).
40
+ (Removed: `mistral-large (bare, from Naraya)` and `deepseek-3.2 (bare, from Naraya)` notes — Naraya is gone.)
74
41
 
75
42
  ## [2.1.1] - 2026-06-15
76
43