The discovery paths for llama.cpp, LM Studio, and openai-models-list
hardcode reasoning: false because the upstream /models endpoints don't
advertise the capability. The original gate
Boolean(spec.reasoning) && (LOCAL_PROVIDER || loopback)
therefore left replayReasoningContent off for the common setup the bug
targets — a discovered Qwen / DeepSeek model on local llama.cpp — and
the stream parser still recorded the upstream's reasoning_content
deltas as thinking blocks, so #3528 reproduced unchanged.
Drop the spec.reasoning gate. The encoder's own
'if (nonEmptyThinkingBlocks.length > 0)' guard ensures the flag stays a
no-op for pure-text turns, so always-on for local hosts adds nothing to
non-reasoning histories. Flip the matching test and add an encoder pin
that mirrors the discovery setup (reasoning: false + actual thinking
block must still ride as reasoning_content).
Addresses chatgpt-codex review on #3532.
@oh-my-pi/pi-catalog
Model catalog for oh-my-pi: bundled model database, provider discovery, model identity, classification, and equivalence.
What's inside
| Module | Purpose |
|---|---|
models.json + models |
Bundled model database (pricing, context windows, modalities, thinking support) |
provider-models |
Provider catalog descriptors (CATALOG_PROVIDERS), per-provider model resolution rules |
discovery |
Runtime model discovery for OpenAI-compatible endpoints, Gemini, Codex, Cursor, Antigravity, Ollama |
identity |
Model id parsing and classification (family/version), reference resolution, equivalence, selection priority |
model-thinking |
Thinking/reasoning metadata and generated per-model policies |
model-manager / model-cache |
Runtime model registry with discovery refresh and on-disk caching |
variant-collapse |
Collapsing provider-specific variants of the same underlying model |
compat |
Request/response compatibility fixups for OpenAI- and Anthropic-shaped APIs |
wire |
Wire-level helpers: Codex, Gemini headers, GitHub Copilot |
effort |
Reasoning-effort level definitions |
Import from subpaths (@oh-my-pi/pi-catalog/<module>) or the root barrel.
models.json is generated
Never edit src/models.json by hand — it is produced from upstream sources (models.dev, provider catalog discovery, OpenCode docs) by scripts/generate-models.ts and the resolvers in src/provider-models/. Regenerate with:
bun --cwd=packages/catalog run generate-models
To change an entry, fix the source: resolver overrides in provider-models/openai-compat.ts, provider entries in provider-models/descriptors.ts, generator fixups in scripts/generate-models.ts, or thinking policies in model-thinking.ts.
Install
bun add @oh-my-pi/pi-catalog
Ships TypeScript source directly (no build step); requires Bun ≥ 1.3.14.