# Comparison: pi-other-provider vs pi-ai built-ins vs OmniRoute

## vs pi-ai built-in `opencode` / `opencode-go`

| Aspect            | Built-in                   | pi-other-provider (`oc-zen`/`oc-go`)                                                                |
| ----------------- | -------------------------- | --------------------------------------------------------------------------------------------------- |
| Qwen3.x (Go)      | `/chat/completions` → 400  | `/messages` ✅                                                                                      |
| MiniMax M2.x (Go) | `/chat/completions` → 400  | `/messages` ✅                                                                                      |
| MiniMax M3 (Go)   | `/chat/completions` → 400  | `/messages` ✅                                                                                      |
| Gotcha hooks      | none                       | 5 `onPayload` hooks (client_metadata, tool cap, effort tiers, reasoning_content, boolean reasoning) |
| Model list        | static (can go stale)      | static baseline **+ live refresh** via pi model-store                                               |
| Provider id       | `opencode` / `opencode-go` | `oc-zen` / `oc-go` (no clobbering; A/B possible)                                                    |
| Cost display      | built-in table             | same rates, mirrored + extended                                                                     |

Use the custom providers when the built-in models error; keep the built-ins if
you prefer pi-ai's exact behavior.

## vs OmniRoute's handling

Deep-read reference: `source/OmniRoute/open-sse/{config/providers/registry,executors}`.

### OpenCode Go — aligned

| Item                                                  | OmniRoute                 | pi-other-provider            |
| ----------------------------------------------------- | ------------------------- | ---------------------------- |
| Go model list                                         | 44 (incl. effort aliases) | **44, 1:1 match**            |
| Qwen → claude format                                  | ✅                        | ✅                           |
| MiniMax M2.x/M3 → claude (Go)                         | ✅                        | ✅                           |
| Effort aliases (deepseek/grok/glm/kimi/mimo/hy3/qwen) | ✅                        | ✅                           |
| `kimi-k2.7-code` (not `kimi-k2.7`)                    | ✅                        | ✅                           |
| Key validation via Zen endpoint                       | ✅                        | ✅ (same `OPENCODE_API_KEY`) |

### Command Code — pi-other-provider adopts OmniRoute's hardening

| Item                      | OmniRoute                                                           | pi-other-provider                                               |
| ------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------- |
| `x-cli-environment`       | `external`                                                          | `external` ✅ (was `production`)                                |
| `x-taste-learning`        | `false`                                                             | `false` ✅ (was `true`)                                         |
| `max_tokens` policy       | only forward + clamp 200k                                           | same ✅ (was fabricate 64k)                                     |
| Passthrough params        | reasoning_effort/reasoning/thinking/effort/output_config/extra_body | same ✅                                                         |
| `memory`/`taste`/`skills` | `""`                                                                | `""` ✅ (was `null`)                                            |
| `permissionMode`          | `standard`                                                          | `standard` ✅                                                   |
| Models                    | static 18                                                           | **live fetch 52+** (better)                                     |
| threadId / session        | random `x-session-id` header                                        | **stable `threadId` per conversation** (cache-friendly, better) |
| Usage                     | cache tokens folded into prompt_tokens                              | cacheRead/cacheWrite reported separately (better for pi)        |
| Vision                    | full image conversion                                               | text-only (future work)                                         |

## Built-in provider visibility (not supported — by design)

The `/providers` command and the on/off visibility mechanism apply **only** to
the three providers registered by this package. They deliberately do **not**
extend to pi's built-in providers (`anthropic`, `openai`, `minimax`, `zai`,
`opencode-go`, custom `models.json` providers, …), for these reasons:

- **Per-model hiding is impossible.** pi has no model blacklist: models carry no
  `hidden`/`disabled` field, the `/model` selector filters by nothing but search,
  and the `filterModels` provider hook is forwarded only from a pi-ai _base_
  provider — never from an extension (`provider-composer.js`). `enabledModels` is
  an additive whitelist that merely creates a separate "scoped" view; it does
  not hide models from the "all" view.
- **Whole-provider disable has no clean setting.** A provider is "available"
  iff it has configured auth (`model-runtime.js`); the only way to drop it is to
  remove its credential — fragile (env-var auth can't be toggled; `models.json`
  inline keys would need editing) and out of scope for this package.

If pi later adds a native model-blacklist or provider-disable mechanism, this
package can revisit extending `/providers` to built-ins. For now, manage
built-in availability with pi's own `/login`.

## Open items / future work

- **Vision for commandcode** (image conversion for Kimi K2 / Qwen 3.x / GPT-5 /
  Claude Fable / MiMo v2.5 / Step-3 / Fugu) — larger change; not implemented.
- `x-command-code-version` may need bumps as the upstream evolves (OmniRoute
  defaults to 0.33.2; this package ships the vendored 0.29.0).
- `supportsLongCacheRetention` / `supportsCacheControlOnTools` compat flags for
  OpenCode Anthropic models are not set (default caching behavior still works).
