Commit Graph
17 Commits
Author SHA1 Message Date
can1357 f1063cdfbb feat(catalog): added capability flags and thinking support for Claude Sonnet 5
- Added an `isAnthropicAdaptiveGenAtLeast` utility to classify adaptive-thinking Claude generations at or above a given version threshold.
- Enabled adaptive thinking display, sampling restrictions, and mid-conversation system message flags for Claude Sonnet 5+ models.
- Updated Bedrock and OpenRouter adaptive reasoning effort maps to support five-tier scales on Sonnet 5+ models.
2026-06-30 16:41:42 +02:00
roboomp 7a4cf0e30c fix(catalog): classified direct Anthropic Sonnet/Haiku 4.5 as plain budget thinking
Direct Anthropic Claude Sonnet 4.5 and Haiku 4.5 (plus their Cloudflare,
Vertex, GitLab-Duo, Copilot, OpenCode-Zen, and Bedrock cross-region passes)
were classified as anthropic-budget-effort, which made the Anthropic provider
serialize output_config.effort alongside the thinking.budget_tokens block.
Anthropic only honors output_config.effort on Opus 4.5 and adaptive (4.6+)
Messages-API models — Sonnet 4.5 and Haiku 4.5 reject every request with
HTTP 400 'This model does not support the effort parameter.', so the advisor
(and any agent on a Sonnet/Haiku 4.5 SKU) failed every turn.

inferThinkingControlMode now gates anthropic-budget-effort to
parsedModel.kind === 'opus' && semverGte(version, '4.5') on both
anthropic-messages and bedrock-converse-stream. Sonnet/Haiku 4.5 fall through
to mode: 'budget' (effort still scales the per-tier thinking budget via
ANTHROPIC_THINKING[reasoning]); Opus 4.5 keeps anthropic-budget-effort and
continues to emit output_config.effort. anthropic-budget-effort also remains
in use for Anthropic-compatible third-party backends that natively support
the field (Umans GLM 5.2).

Regenerated models.json so the 19 Sonnet/Haiku 4.5 first-party entries flip
to mode: 'budget' and the 12 Opus 4.5 entries stay on anthropic-budget-effort.

Regression tests cover both sides: anthropic-alignment.test.ts asserts the
Sonnet 4.5 wire body omits output_config and the Opus 4.5 wire body emits
output_config.effort: 'medium'.

Fixes #3497
2026-06-25 20:16:34 +00:00
Alexander Kirilin 7baa4e202e Merge remote-tracking branch 'origin/main' into fix/2864-mimo-efforts
# Conflicts:
#	packages/catalog/src/model-thinking.ts
#	packages/catalog/src/models.json
#	packages/catalog/src/variant-collapse.ts
#	packages/catalog/test/variant-collapse.test.ts
#	packages/coding-agent/test/model-registry.test.ts
2026-06-19 10:29:52 -04:00
can1357 ab6d1f916b feat(catalog): adjusted GLM-5.2 reasoning effort mapping per host
- Refactor GLM-5.2 effort mapping to accommodate specific requirements for Z.ai, OpenRouter, and general OpenAI-compatible hosts.
- Apply host-specific logic to ensure `xhigh` UI tiers are correctly resolved to the required `max` budget for supported providers.
- Add test coverage verifying expected effort mappings across different model hosts.
2026-06-19 16:06:16 +02:00
Alexander Kirilin 2c789beda9 fix(catalog): preserve MiMo effort mappings 2026-06-18 15:37:22 -04:00
Alexander Kirilin 1d62360a56 fix(catalog): clamp mimo reasoning efforts 2026-06-18 13:49:53 -04:00
roboomp 9f31423c42 fix(providers): mapped minimax anthropic thinking
Derived MiniMax M2/M3 Anthropic-compatible models as adaptive-thinking models, mapped supported efforts to the wire adaptive tag, and prevented MiniMax adaptive requests from sending Anthropic output_config effort tiers. Added catalog and request-shaping regression coverage.\n\nFixes #2928
2026-06-18 04:46:46 +00:00
OpenAI Codex 3462e5e401 Fix Ollama Cloud GLM-5.2 reasoning efforts
Advertise GLM-5.2 as high/max-only on Ollama Cloud and map xhigh to the native max think level.
2026-06-17 22:27:54 +00:00
can1357 fb3534740f feat(catalog): added GLM-5.2 reasoning support for ZAI and zhipu completions
- Added ZAI GLM-5.2 reasoning-effort mapping, translating minimal to none and xhigh to max.
- Enabled ZAI and zhipu GLM-5.2 completion requests to send reasoning_effort and tool_stream.
- Added provider token clamping so GLM-5.2 completion requests use capped max_tokens.
- Updated catalog policies to route GLM-5.2 max-token and reasoning support through ZAI/zhipu hosts.
- Removed synthetic HF model entries and aligned GLM-5.2 catalog specs with real providers.

Fixes #2833
2026-06-17 09:38:43 +02:00
can1357 176157055b feat(catalog): added thinking.requiresEffort baking for mandatory-reasoning upstreams
- Added `thinking.requiresEffort` to `ThinkingConfig` and baked it in `deriveThinking`/`fillThinkingWireDefaults` via `impliesMandatoryReasoning` for reasoning-only upstreams: Gemini 3.x, Gemini 2.5 Pro, the OpenAI o-series, MiniMax M2, and thinking-only `-reasoner`/`-reasoning` SKUs.
- Added `minimumSupportedEffort()` to `model-thinking.ts` as the clamp target for thinking-off requests on flagged models.
- Moved `stripThinkingVariantToken`/`findThinkingVariantToken` into `identity/family.ts`, taught them the `-reasoning`/`-reasoner` spellings, and re-pointed the `variant-collapse` and coding-agent `model-resolver` imports.
- Dropped `requiresEffort` (with `effortRouting`/`suppressWhenOff`) from collapsed-pair thinking surfaces in `derivePairThinkingSurface`, since the collapsed pair routes off to the bare backing id.
- Regenerated `models.json` and covered derivation, backfill, and reasoning-token pairing in `model-thinking.test.ts` and `variant-collapse.test.ts`.
2026-06-12 08:20:27 +02:00
roboomp efd0812791 fix(catalog): normalized cached restricted thinking efforts
Stale cached or dynamically discovered MiniMax M2 / GPT-OSS rows can carry
explicit pre-fix thinking.efforts with minimal/xhigh. buildModel used to
trust that explicit surface and only backfill wire maps, so those rows could
still make disableReasoning choose minimal and hit Fireworks' none mapping.

Normalize model-defined effort restrictions before returning explicit
thinking metadata, and drop stale effortMap entries that no longer apply to
the normalized effort surface.

Fixes #2315
2026-06-11 23:32:17 +00:00
roboomp 392a834036 fix(catalog): moved OpenAI effort maps into thinking metadata
Moved buildOpenAICompat's detected reasoning effort maps into catalog
thinking metadata so request handlers read model.thinking.effortMap instead
of model.compat.reasoningEffortMap. The moved defaults cover Groq Qwen,
DeepSeek-family models, OpenRouter Anthropic adaptive models, and Fireworks'
minimal-to-none mapping.

Explicit provider/user compat reasoningEffortMap values remain supported as
build-time override inputs and are merged into thinking.effortMap, filtered
to the model's declared effort surface. Regenerated models.json carries the
baked maps.

Fixes #2315
2026-06-11 23:28:07 +00:00
roboomp fe49e66a60 fix(catalog): encoded MiniMax and GPT-OSS effort limits
Moved the MiniMax M2 / GPT-OSS reasoning effort fix out of the
OpenAI-compatible compat map and into catalog thinking metadata. These
families now derive low|medium|high as their supported efforts for
openai-completions models, and regenerated models.json carries the same
limits for bundled entries.

Fireworks' generic minimal -> none map remains unchanged for GLM and other
models that accept the none literal; the affected MiniMax/GPT-OSS models now
pick low from catalog metadata for disableReasoning.

Fixes #2315
2026-06-11 23:28:07 +00:00
roboomp b34b2b2272 fix(catalog): handled missing thinking efforts
Treat explicit thinking metadata without efforts as sparse input so model resolution infers the capability surface instead of crashing.\n\nFixes #2251
2026-06-10 10:05:19 +00:00
can1357 a25d521cab refactor(catalog): baked thinking metadata into buildModel pipeline
- Replaced minLevel/maxLevel range with explicit efforts array plus baked effortMap/supportsDisplay wire facts.
- Removed runtime enrichment layer and modelOmitsReasoningEffort; providers now read baked fields.
- Fixed dotted Opus 4.7/4.8 ids missing adaptive display via classifier-based predicates (#1373).
- Bumped model cache schema to v4 to invalidate pre-efforts rows.
2026-06-10 07:22:11 +02:00
can1357 ae415199dc feat: added build-time compatibility in ModelSpec/buildModel pipeline
- Centralized catalog and registry handling on `ModelSpec` and `buildModel`, resolving compatibility at model build time.
- Removed runtime compatibility detectors and switched provider request flows to direct `model.compat` reads.
- Added compat fields (`supportsReasoningParams`, `alwaysSendMaxTokens`, `strictResponsesPairing`, `whenThinking`).
- Persisted explicit compatibility overrides through `compatConfig` in discovery and cache merge paths.
2026-06-10 06:20:51 +02:00
can1357 1b9d9d0851 refactor(catalog)!: split model catalog from pi-ai
Move bundled models, model cache/manager, thinking metadata, effort helpers,
provider descriptors/discovery, wire constants, and model identity utilities
into the new @oh-my-pi/pi-catalog package.

Update pi-ai to keep provider runtime/auth concerns, move catalog provider
metadata into CATALOG_PROVIDERS, and migrate coding-agent, agent, stats, docs,
and tests to import catalog values from pi-catalog.

Split coding-agent model registry helpers into discovery, roles, and models
config modules while preserving registry orchestration.

BREAKING CHANGE: @oh-my-pi/pi-ai no longer exports catalog subpaths such as
/models, /model-cache, /model-manager, /model-thinking, /effort,
/provider-models*, discovery helpers, and provider wire constants; use the
matching @oh-my-pi/pi-catalog subpaths instead.
2026-06-10 04:06:57 +02:00