# Changelog v0.5.47 - 2026-07-08

### Added
- **New BETA `fcm-opencode` plugin** — an OpenCode adapter that brings `free-coding-models` scans, routing, and provider injection into OpenCode. It reuses the exact same scan / ranking / API-key / daemon / model-safety code as `fcm-pi`, so provider fixes and safety filters stay in one place. Install via a local symlink (see `opencode-plugin/README.md`). Commands:
  - `/fcm` — scan and list ranked choices **without switching**
  - `/fcm 1` / `/fcm 2` / … — explicitly switch OpenCode config to ranked model #N
  - `/fcm best` — explicitly switch to the best ranked model
  - `/fcm rescan` — force a fresh scan
  - `/fcm status` (or `/fcm-status`) — plugin diagnostics (cache age, daemon, active model)
  - `/fcm router` (or `/fcm-router`) — explicitly switch OpenCode to the local FCM Smart Router daemon
- **New shared `pi-extension/lib/pi-model-config.js` module** — centralizes the Pi model safety policy so both adapters apply identical rules: `parseContextWindow` (`8k` / `128k` / `1M` → number), `getPiMaxTokens` (caps completions to leave prompt room), `isPiContextUsable` (hides tiny-context models that pass a probe but fail real agent prompts, e.g. 8k Cerebras), and `getPiReasoningFlag` (keeps OpenAI-compatible FCM models in non-thinking mode).
- **`runFcmScan({ mode })` now supports `auto`, `daemon`, and `direct` scan strategies.** OpenCode uses `daemon` at startup so direct probes never block boot.

### Changed
- **FCM-Pi is now silent by default.** No startup scan, no footer noise, and no automatic model switch on Pi boot or `/resume`. Run `/fcm` to scan and pick a model explicitly.
- **Error-triggered picker replaces silent auto-failover.** When the active model returns HTTP 4xx/5xx, FCM reopens the picker and marks the failing model `🔴 BUGGED` instead of switching automatically — you stay in control of which model runs.
- **Pi scan-progress footer now shows the branded `> free-coding-models` badge** in the exact same green/white-on-black colours as the main TUI header logo, instead of scrolling live model names. The live `%` progress and `(completed/total)` counter stay beside it.
- **OpenCode startup is light by default:** fresh cache first, daemon second, no direct scan unless the user explicitly runs `/fcm`. Long probes never freeze OpenCode boot.
- **README updated** with a new `fcm-opencode` section and a refreshed FCM-Pi section reflecting the silent-by-default behaviour.

### Notes
- `fcm-pi` and `fcm-opencode` remain **BETA** and are installed via local path / symlink, not via the npm `free-coding-models` package.
- The full shared-core extraction into `packages/fcm-agent-core` / `packages/fcm-opencode` is still in progress (tracked in `.kandown/tasks/t2.md`). This release ships the working adapters and the extracted model-safety module ahead of that restructure.
