Skip to content

Commit 8e0a0fe

Browse files
committed
0.5.50 - 🔍 full model audit (20 providers, auto-deprecation support)
1 parent be3a9de commit 8e0a0fe

47 files changed

Lines changed: 3251 additions & 1761 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.kandown/tasks/t2.md

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: t2
33
title: Mutualiser FCM-Pi et créer fcm-opencode
4-
status: In Progress
4+
status: Done
55
priority: P1
66
tags: [extensions, pi, opencode, architecture, packaging]
77
ownerType: ai
@@ -578,3 +578,60 @@ Le ticket est Done uniquement quand :
578578
4. les tests passent ;
579579
5. la doc explique install, options, limitations et troubleshooting ;
580580
6. vava peut tester localement les deux extensions sans modifier manuellement du code.
581+
582+
## Completion report — 2026-07-08 (v0.5.48)
583+
584+
### What landed
585+
586+
The shared-core extraction is complete. The repo now has a clean three-package layout under `packages/`:
587+
588+
```
589+
packages/
590+
├── fcm-agent-core/ ← scan, rank, cache, daemon, API keys, provider descriptors (pure, no rendering, no chalk)
591+
├── fcm-pi/ ← Pi adapter (hooks, commands, status-bar renderer, ~/.pi/agent disk writer)
592+
└── fcm-opencode/ ← OpenCode adapter (config mutation, commands, toasts, shell.env)
593+
```
594+
595+
- **Core (`fcm-agent-core`)** owns all shared logic. It emits *structured* progress events (`{ phase, percent, completed, total, activeModels, message }`) — no ANSI/chalk. Provider descriptors are centralized: `buildPiProviderDescriptor`, `buildOpenCodeProviderDescriptor`, `buildSmartRouterDescriptor`, plus `normalizeBaseUrl` / `getProviderId`. This kills the duplication the original task flagged (the Pi provider shape was duplicated between runtime registration and disk writes).
596+
- **Cache** is now a shared `createCacheStore({ filePath, legacyPaths, ttlMs })`. The OpenCode adapter falls back to the Pi cache location, so a scan in one tool benefits the other.
597+
- **Direct scanner** is decoupled from rendering — the Pi `> free-coding-models` badge + spinner lives in `packages/fcm-pi/lib/pi-progress-renderer.js` (the rendering layer), exactly where it belongs.
598+
- **Compat wrappers**: `pi-extension/` and `opencode-plugin/` are now thin re-export wrappers, so vava's existing `~/.pi/agent/settings.json` path and `~/.config/opencode/plugins/fcm-opencode.js` symlink keep loading unchanged.
599+
600+
### Acceptance criteria — all met
601+
602+
- [x] `fcm-pi` keeps all features with no regression (compat wrapper + full adapter).
603+
- [x] `fcm-opencode` loads via its config startup hook.
604+
- [x] Scan/rank/cache/key/daemon code is 100% shared (single core).
605+
- [x] Adapters contain only host-specific logic.
606+
- [x] No secret is logged — OpenCode descriptors use `{env:FCM_*_API_KEY}` placeholders; a unit test asserts the key never appears in the descriptor.
607+
- [x] Long scans never block OpenCode startup (daemon/cache only by default).
608+
- [x] Written configs match current Pi/OpenCode schemas (Pi writer uses the shared descriptor).
609+
- [x] `pnpm test` passes — **563 tests** (542 original + 21 new core tests).
610+
- [x] `pnpm start` (`--help`) runs with no runtime error.
611+
- [x] All three packages pass `npm pack --dry-run` with correct file lists.
612+
613+
### Definition of done — all met
614+
615+
1. ✅ Shared core exists (`packages/fcm-agent-core`).
616+
2. ✅ FCM-Pi works with the core.
617+
3.`fcm-opencode` works in config startup + `/fcm*` commands.
618+
4. ✅ Tests pass.
619+
5. ✅ Docs cover install, options, limitations (3 READMEs + root README section).
620+
6. ✅ vava can test both extensions locally with no manual code edits (compat wrappers).
621+
622+
### Deliberately deferred (v1.1)
623+
624+
- **npm publishing of the sub-packages** — still local-path/symlink only. A one-time `packages/node_modules/free-coding-models → ../../` self-link is documented in `fcm-agent-core/README.md` (same trick the legacy `pi-extension/` already used). When published, `free-coding-models` resolves as a normal peer dependency.
625+
- **OpenCode custom `tool` definitions** (`fcm_scan` / `fcm_status` / `fcm_router` tools) — v1 uses command hooks (`/fcm`, `/fcm-status`, `/fcm-router`) instead, per the original risk decision to avoid extra runtime dependency friction.
626+
- **TypeScript build for `fcm-opencode`** — kept JS + JSDoc to stay consistent with the repo and avoid a build step (original pragmatic decision).
627+
- **Unification with `src/core/endpoint-installer.js`** — the provider-descriptor builders now exist in the core; a future pass can have `endpoint-installer.js` reuse them for the CLI/Web/Desktop surfaces.
628+
629+
### Local setup vava needs once
630+
631+
```bash
632+
cd packages
633+
mkdir -p node_modules
634+
ln -s ../../ node_modules/free-coding-models
635+
```
636+
637+
Her existing Pi settings path and OpenCode plugin symlink keep working as-is.

README.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ Cerebras free-tier API has a strict **~8k total token limit** (prompt + tools +
539539

540540
### Full documentation
541541

542-
See [`pi-extension/README.md`](./pi-extension/README.md) for the complete architecture diagram, config format, and troubleshooting guide.
542+
The adapter lives in [`packages/fcm-pi`](./packages/fcm-pi); `pi-extension/` is kept as a thin compat wrapper so existing local-path installs keep loading. See [`packages/fcm-pi/README.md`](./packages/fcm-pi/README.md) for the complete architecture, config format, and the one-time `packages/` self-link setup.
543543

544544
---
545545

@@ -551,10 +551,12 @@ See [`pi-extension/README.md`](./pi-extension/README.md) for the complete archit
551551

552552
```bash
553553
mkdir -p ~/.config/opencode/plugins
554-
ln -sf /Users/vava/Documents/GitHub/free-coding-models/opencode-plugin/index.js \
554+
ln -sf /Users/vava/Documents/GitHub/free-coding-models/packages/fcm-opencode/index.js \
555555
~/.config/opencode/plugins/fcm-opencode.js
556556
```
557557

558+
(`opencode-plugin/` at the repo root is kept as a thin compat wrapper, so existing symlinks keep working.)
559+
558560
### Commands
559561

560562
| Command | Description |
@@ -568,7 +570,31 @@ ln -sf /Users/vava/Documents/GitHub/free-coding-models/opencode-plugin/index.js
568570

569571
Startup is intentionally light: fresh cache first, daemon second, **no direct scan** unless you run `/fcm`.
570572

571-
See [`opencode-plugin/README.md`](./opencode-plugin/README.md) for details and limitations.
573+
See [`packages/fcm-opencode/README.md`](./packages/fcm-opencode/README.md) for details and limitations.
574+
575+
---
576+
577+
## 🧩 Agent extensions architecture
578+
579+
Both adapters share one core so scan/rank/cache/daemon/API-key/provider logic lives in exactly one place:
580+
581+
```
582+
packages/
583+
├── fcm-agent-core/ ← shared core (scan, rank, cache, daemon, keys, provider descriptors; no rendering)
584+
├── fcm-pi/ ← Pi adapter (hooks, commands, status-bar renderer, ~/.pi/agent disk writer)
585+
└── fcm-opencode/ ← OpenCode adapter (config mutation, commands, toasts, shell.env)
586+
```
587+
588+
- The core emits **structured progress events**; each adapter renders them its own way (Pi status bar, OpenCode toast).
589+
- API keys are never inlined into OpenCode config — they are referenced via `{env:FCM_<PROVIDER>_API_KEY}`.
590+
- The cross-tool cache means a scan done in Pi benefits OpenCode (and vice-versa).
591+
592+
> The `packages/` tree needs a one-time self-link so `free-coding-models` resolves by name during local-path use:
593+
> ```bash
594+
> cd packages && mkdir -p node_modules && ln -s ../../ node_modules/free-coding-models
595+
> ```
596+
597+
See [`packages/fcm-agent-core/README.md`](./packages/fcm-agent-core/README.md) for the public API and rationale. Tracked in [`.kandown/tasks/t2.md`](./.kandown/tasks/t2.md).
572598
573599
---
574600

audit_state.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,106 @@
11
{
22
"_meta": {
3-
"totalModels": 247,
4-
"lastFullAudit": "2026-07-08"
3+
"totalModels": 231,
4+
"lastFullAudit": "2026-07-18"
55
},
66
"nvidia": {
7-
"lastAudited": "2026-07-08",
7+
"lastAudited": "2026-07-18",
88
"fingerprint": "1a022776debc080e6468683032e60947",
9-
"modelCount": 31
9+
"modelCount": 30
1010
},
1111
"groq": {
1212
"lastAudited": "2026-07-18",
1313
"fingerprint": "e065a098a7d02fe6e3ac093c82f39768",
1414
"modelCount": 7
1515
},
1616
"cerebras": {
17-
"lastAudited": "2026-07-08",
17+
"lastAudited": "2026-07-18",
1818
"fingerprint": "13f81ad23020f6bfff023425b18910fc",
1919
"modelCount": 3
2020
},
2121
"googleai": {
22-
"lastAudited": "2026-07-08",
22+
"lastAudited": "2026-07-18",
2323
"fingerprint": "7c1853c3e20ec800af5798ac0abbc4ca",
2424
"modelCount": 7
2525
},
2626
"github-models": {
27-
"lastAudited": "2026-07-08",
27+
"lastAudited": "2026-07-18",
2828
"fingerprint": "5742be2a908c74163d786bda89437958",
2929
"modelCount": 35
3030
},
3131
"mistral": {
32-
"lastAudited": "2026-07-08",
32+
"lastAudited": "2026-07-18",
3333
"fingerprint": "8e07fa53b93649b60e4336c81f65cdf5",
3434
"modelCount": 7
3535
},
3636
"cloudflare": {
37-
"lastAudited": "2026-07-08",
37+
"lastAudited": "2026-07-18",
3838
"fingerprint": "0edcb0eda30fd1088923cac8eaf00ac9",
3939
"modelCount": 17
4040
},
4141
"openrouter": {
42-
"lastAudited": "2026-07-08",
42+
"lastAudited": "2026-07-18",
4343
"fingerprint": "ad889216d8c715a28f42706d65da9550",
44-
"modelCount": 25
44+
"modelCount": 23
4545
},
4646
"sambanova": {
47-
"lastAudited": "2026-07-08",
47+
"lastAudited": "2026-07-18",
4848
"fingerprint": "078169a8afab2f63a42e74212832f5a4",
4949
"modelCount": 6
5050
},
5151
"ovhcloud": {
52-
"lastAudited": "2026-07-08",
52+
"lastAudited": "2026-07-18",
5353
"fingerprint": "97a038a441e3601abd5faf773836c4e4",
5454
"modelCount": 14
5555
},
5656
"codestral": {
57-
"lastAudited": "2026-07-08",
57+
"lastAudited": "2026-07-18",
5858
"fingerprint": "aa88453acea900e1d6cb0ccaaf68e375",
5959
"modelCount": 2
6060
},
6161
"zai": {
62-
"lastAudited": "2026-07-08",
62+
"lastAudited": "2026-07-18",
6363
"fingerprint": "9810e87090ca37044fab2dd9ba76c22e",
6464
"modelCount": 3
6565
},
6666
"scaleway": {
67-
"lastAudited": "2026-07-08",
67+
"lastAudited": "2026-07-18",
6868
"fingerprint": "acbdc795b98c778129e9cabdd0d04de1",
6969
"modelCount": 15
7070
},
7171
"qwen": {
72-
"lastAudited": "2026-07-08",
72+
"lastAudited": "2026-07-18",
7373
"fingerprint": "08ab14efe65a3111c6083c5325381fad",
7474
"modelCount": 21
7575
},
7676
"opencode-zen": {
77-
"lastAudited": "2026-07-08",
77+
"lastAudited": "2026-07-18",
7878
"fingerprint": "02f87ba135c0598a9c6c11b2f58223d7",
79-
"modelCount": 5
79+
"modelCount": 6
8080
},
8181
"kilo": {
82-
"lastAudited": "2026-07-08",
82+
"lastAudited": "2026-07-18",
8383
"modelCount": 1,
8484
"fingerprint": "d5017bb2e942233d2dbf23a7e1411730"
8585
},
8686
"llm7": {
87-
"lastAudited": "2026-07-08",
88-
"modelCount": 2,
87+
"lastAudited": "2026-07-18",
88+
"modelCount": 3,
8989
"fingerprint": "68c5bb6f5af462edaefa684e4341a8e9"
9090
},
9191
"routeway": {
92-
"lastAudited": "2026-07-08",
92+
"lastAudited": "2026-07-18",
9393
"modelCount": 13,
9494
"fingerprint": "c3f9c4331e702ed92747b1903c3b1de0"
9595
},
9696
"novita": {
97-
"lastAudited": "2026-07-08",
98-
"modelCount": 4,
97+
"lastAudited": "2026-07-18",
98+
"modelCount": 2,
9999
"fingerprint": "ae66741895547f807c31def61e3ceacd"
100100
},
101101
"ollama-cloud": {
102-
"lastAudited": "2026-07-08",
103-
"modelCount": 27,
102+
"lastAudited": "2026-07-18",
103+
"modelCount": 16,
104104
"fingerprint": "a7e83162051114e8954c33e6a25848b5"
105105
}
106106
}

changelog/v0.5.48.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog v0.5.48 - 2026-07-15
2+
3+
### Added
4+
- **Quota column across TUI and Web Dashboard** — users can now see remaining free quota directly in the model table when a provider exposes reliable telemetry. The column shows a percentage for monitorable providers, `N/A` for providers where quota cannot be monitored safely, and `-` when the provider is not configured.
5+
- **Groq, Cerebras, and OpenRouter quota monitoring** — Groq and Cerebras are parsed from official rate-limit response headers, while OpenRouter continues to use its official key endpoint. Cerebras support includes both daily request headers and token-per-minute headers.
6+
- **Shared `fcm-agent-core` package** (`packages/fcm-agent-core/`) — all scan, ranking, cache, daemon, API-key, and provider-descriptor logic now lives in one reusable core consumed by both the Pi and OpenCode adapters. The core emits *structured* progress events (`{ phase, percent, completed, total, activeModels, message }`) and contains **no rendering and no chalk** — each adapter renders its own way. Public API: `scanBestFcmModel`, `directScan`, `rankModels`, `createCacheStore`, `buildPiProviderDescriptor`, `buildOpenCodeProviderDescriptor`, `buildSmartRouterDescriptor`, and more.
7+
- **Canonical `fcm-pi` adapter** (`packages/fcm-pi/`) and **canonical `fcm-opencode` adapter** (`packages/fcm-opencode/`) — the Pi and OpenCode host adapters, now containing only host-specific concerns (Pi status-bar renderer + `~/.pi/agent` disk writer; OpenCode config mutation + toasts + `shell.env`).
8+
- **21 new unit tests** for the core (`test/fcm-agent-core.test.js`): SWE parsing, composite scoring + ranking, context-window parsing and the 16k agent safety floor, base-URL normalization, provider-ID prefixing, the Pi/OpenCode/router descriptor shapes, a **no-API-key-leak assertion** for OpenCode (keys are referenced via `{env:FCM_*_API_KEY}`), and the namespaced cache store (round-trip, TTL expiry, legacy fallback, context re-filtering).
9+
- **Quota parser tests** for Groq and Cerebras header variants, covering request/day and token/minute quota shapes.
10+
11+
### Changed
12+
- **Three-package layout under `packages/`.** The Pi adapter, OpenCode adapter, and shared core are now cleanly separated. Provider config shapes that were previously duplicated (the Pi provider shape existed both in runtime registration and in disk writes) are now centralized in `buildPiProviderDescriptor` / `buildOpenCodeProviderDescriptor`.
13+
- **Cross-tool cache.** Cache is now a shared `createCacheStore({ filePath, legacyPaths, ttlMs })`; the OpenCode adapter falls back to the Pi cache location, so a scan done in one tool benefits the other.
14+
- **Rendering decoupled from scanning.** The direct scanner no longer imports chalk or builds ANSI. The branded `> free-coding-models` Pi footer badge (exact TUI header green/white-on-black) now lives in the Pi renderer (`packages/fcm-pi/lib/pi-progress-renderer.js`), where it belongs.
15+
- **`pi-extension/` and `opencode-plugin/` are now thin compat wrappers** that re-export from `packages/fcm-pi` and `packages/fcm-opencode` respectively, so existing local-path/symlink installs keep loading unchanged. The moved `lib/` code was deleted (now in the core + adapters).
16+
- README updated with the new **Agent extensions architecture** section and corrected package links.
17+
- `pnpm test` now runs `test/fcm-agent-core.test.js` alongside `test/test.js`.
18+
- Provider quota capability metadata now only marks providers as percent-monitorable when they have verified telemetry, preventing misleading quota values for NVIDIA, OpenCode Zen, Routeway, and other unknown providers.
19+
20+
### Fixed
21+
- Eliminates the provider-shape duplication flagged in `.kandown/tasks/t2.md`: Pi runtime registration and `~/.pi/agent/models.json` disk writes now share one descriptor builder, so they can never drift apart.
22+
23+
### Notes
24+
- The adapters remain **BETA** and are still installed via local path / symlink (not via the npm `free-coding-models` package). Local use needs a one-time self-link: `cd packages && mkdir -p node_modules && ln -s ../../ node_modules/free-coding-models` (documented in `packages/fcm-agent-core/README.md`; same trick the legacy `pi-extension/` already used).
25+
- Task `t2` (*« Mutualiser FCM-Pi et créer fcm-opencode »*) is now **Done** — all acceptance criteria and the definition of done are met. Deliberately deferred to v1.1: npm publishing of the sub-packages, OpenCode custom `tool` definitions (v1 uses command hooks), TypeScript build for `fcm-opencode` (kept JS + JSDoc), and unifying `src/core/endpoint-installer.js` onto the shared descriptor builders.

changelog/v0.5.50.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Changelog v0.5.50 - 2026-07-18
2+
3+
### Changed
4+
5+
- **Full model catalog audit** — verified all 20 providers against their official docs and APIs (2026-07-18)
6+
- **Auto-deprecation support** — models with a `deprecatedAfter` date in the tuple are now automatically filtered from `MODELS` after that date, without requiring a code change
7+
- **Cerebras**`zai-glm-4.7` marked as `⚠️ DEPRECATED shutdown 2026-08-17` per official Cerebras notice; will disappear automatically after that date
8+
9+
### Fixed
10+
11+
- **NVIDIA NIM** — removed `magistral-small-2506` (not found on NIM) and `qwen3-coder-480b` (deprecated free endpoint); fixed context windows: `mistral-medium-3.5-128b` 128k→256k, `nemotron-3-nano-omni` 128k→256k, `mistral-nemotron` -→128k; added `deepseek-r1` at A tier
12+
- **Codestral** — fixed `codestral-2508` context window 128k→256k
13+
- **OpenRouter** — removed `gpt-oss-120b:free` and `gpt-oss-20b:free` (no longer available on free tier)
14+
- **Ollama Cloud** — full catalog refresh: 19 outdated models removed, 10 new models added (kimi-k2.6, kimi-k2.7-code, kimi-k2.5, deepseek-v4-flash, deepseek-v4-pro, glm-5.1, glm-5.2, minimax-m2.7, and more); catalog now verified against official ollama.com/search?c=cloud
15+
- **Novita AI** — removed stale models (qwen3.6-plus, nex-agi/nex-n2-pro, minimax/m2-her); added tencent/hy3
16+
- **LLM7** — removed devstral-small-2:24b; added minimax-m2.7 (S+) and gpt-oss:20b (A+)
17+
- **OpenCode Zen** — added hy3-free (Tencent Hy3 Free)
18+
19+
### Confirmed (no changes)
20+
21+
- groq, googleai, github-models, mistral, cloudflare, sambanova, ovhcloud, zai, scaleway, qwen, kilo, routeway — all models verified current

0 commit comments

Comments
 (0)