Commit Graph
240 Commits
Author SHA1 Message Date
can1357 3848a37f9a Merge PR #5820: fix(catalog): read litellm per-model cost from rich metadata (@roboomp) 2026-07-17 21:22:31 +02:00
can1357 8577371187 Merge PR #5896: fix(kimi-code): preserve K3 native effort contract (@roboomp) 2026-07-17 21:22:08 +02:00
roboomp 913ec0baae fix(kimi-code): preserved k3 native effort contract
- Parsed live named efforts, mandatory-thinking state, and model protocol metadata.

- Sent native Kimi named efforts and adaptive Anthropic override efforts without generic token budgets.

Fixes #5893
2026-07-17 18:19:00 +00:00
roboomp 40ea23181a fix(catalog): bumped litellm rich cache version
Invalidated rich-v4 rows so upgraded clients immediately refresh models with corrected per-model pricing instead of serving stale zero-cost entries until TTL expiry.
2026-07-17 09:01:13 +00:00
roboomp 29fc224509 fix(catalog): read litellm per-model cost from rich metadata
mapLiteLLMRichEntry read token limits and capabilities from LiteLLM's
rich model_info but hardcoded cost to the bundled reference or a zero
sentinel, so any model absent from the bundled catalog / models.dev
displayed as free even when LiteLLM reported real pricing.

Read input_cost_per_token / output_cost_per_token (and cache costs) via
getLiteLLMCost, converting per-token to per-million, and carry cost
through the cross-endpoint merge in fetchLiteLLMRichModels. Fall back to
the bundled reference only when LiteLLM omits cost.

Fixes #5818
2026-07-17 08:55:41 +00:00
roboomp bab156183e fix(catalog): suppressed LiteLLM fallback warning on retryable 401
Skipped recording 401 rich-endpoint failures as fallback diagnostics so the caller's auth-retry path (withAuth refresh/sibling rotation) is not pre-empted by a warning from a stale first credential.

Kept 403 and other non-retryable failures warn-worthy.

Fixes #5801
2026-07-17 07:46:40 +00:00
roboomp 63cac8dfd5 fix(catalog): warned on LiteLLM metadata fallback
Logged one actionable warning per LiteLLM management base when rich metadata discovery fails, while keeping missing 404 routes silent.

Documented metadata-route permissions and covered forbidden versus absent endpoints.

Fixes #5801
2026-07-17 07:38:06 +00:00
can1357 c71aa775e0 fix(catalog): restored regenerated models.json with behavior-level tests
Reinstates the catalog regeneration (glm-4.5 reasoning/effort metadata,
refreshed pricing and limits) that the previous commit wrongly rolled
back. The three failing tests were pinned to stale upstream metadata;
they now assert the durable contracts instead: K2.7-Code stays above
the 32,768 K2-family cap and tracks the bundled reference, and K3
asserts effort-mode metadata while the wire-body test remains the
binding reasoning_effort=max contract.
2026-07-17 06:22:44 +02:00
can1357 34cd2df096 merge PR #5758 via eval/pr-5758: fix(ai): honored kimi-k3 131k output limit 2026-07-17 04:40:05 +02:00
can1357 f2959f255e merge PR #5735 via eval/pr-5735: fix(catalog): sourced Umans PAYG model pricing 2026-07-17 04:40:04 +02:00
can1357 dace1ca535 merge PR #5707 via eval/pr-5707: fix(catalog): pinned gpt-5.6 codex discovery fallback to 372k 2026-07-17 04:39:15 +02:00
can1357 6e0b9d34f2 feat(catalog): increased maxTokens to 65,536 for Kimi K2.7-Code models on Fireworks
- Updated models.json to set maxTokens to 65536 for Kimi K2.7-Code entries.
- Adjusted openai-compat logic to use a new 65,536 ceiling for K2.7-Code while preserving the 32,768 cap for older K2 models.
- Modified tests to verify the new token limit and ensure K2.7-Code models are excluded from the older cap.
2026-07-17 03:49:38 +02:00
roboomp aa4386d8ca fix(ai): honored kimi-k3 131k output limit
The generic OpenAI-compatible output policy capped native K3 requests at 64,000 tokens even though its catalog metadata advertises Moonshot’s 131,072-token output limit.

- Generalized the Chat Completions provider clamp resolver.
- Allowed native moonshot/kimi-k3 to clamp against model.maxTokens.
- Preserved the existing 64k default for other OpenAI-compatible models and the existing raised GLM-5.2 reasoning clamp.
- Covered default and explicit 131,072-token K3 requests on the wire.

Fixes #5756
2026-07-16 21:50:57 +00:00
roboomp fdb5d8bd0e fix(catalog): kept kimi-k3 reasoning on forced tool choices
Native Kimi K3 always reasons via reasoning_effort: "max" and is newly marked
requiresEffort. The Kimi-family disableReasoningOnForcedToolChoice rule (added
for the K2.x Moonshot 400 "tool_choice 'specified' is incompatible with
thinking enabled", #827) applies only to the binary thinking block K3 never
sends, so it wrongly stripped K3's effort on forced-tool turns — e.g. plan-mode
toolChoice: "required" — leaving mandatory reasoning off on the wire.

- Exempted native K3 from disableReasoningOnForcedToolChoice.
- Added a regression test asserting reasoning_effort=max survives a forced
  tool_choice turn while no thinking block is emitted.

Fixes #5756
2026-07-16 21:44:03 +00:00
roboomp c98b1b83d3 fix(catalog): corrected moonshot kimi-k3 pricing and reasoning transport
Native moonshot/kimi-k3 is dynamically discovered but has no bundled or
models.dev reference, so mapWithBundledReference fell through to the generic
dynamic defaults: zero token cost, null limits, text-only input, and no
reasoning. /models then labeled the paid model "Free".

- Added isKimiK3ModelId identity helper for any-namespace K3 ids.
- Stamped Moonshot's official K3 pricing ($3 input / $0.30 cache-hit / $15
  output), 1,048,576-token context, 131,072 default max output, image input,
  and always-on reasoning in the moonshot discovery mapper.
- Routed native K3 reasoning through OpenAI-style reasoning_effort: "max"
  instead of the K2.x binary thinking: { type } block, which K3 does not use.
- Widened the 300s reasoning stream-idle floor to cover native K3.

Fixes #5756
2026-07-16 21:35:50 +00:00
roboomp 0becfbe197 fix(catalog): sourced Umans PAYG model pricing
- Repointed the Umans models.dev descriptor to published PAYG rates.
- Backfilled authoritative discovery rows and the Flash technical alias.
- Added runtime, descriptor, and bundled catalog regression coverage.

Fixes #5733
2026-07-16 17:39:22 +00:00
roboomp 1945734b42 fix(catalog): pinned gpt-5.6 codex discovery fallback to 372k
The generation-time policy pin only corrected the bundled JSON. Logged-in
Codex users hit fetchCodexModels() at runtime, and mergeDynamicModel prefers
any positive dynamic contextWindow over the bundled one, so the 272000
discovery fallback re-overwrote the 372000 bundle on every live refresh.

Made the Codex discovery context_window fallback SKU-aware: GPT-5.6
luna/sol/terra now fall back to 372000 (their upstream hard capacity) when
upstream omits the field, matching the generation-time policy.

Fixes #5705
2026-07-16 13:46:45 +00:00
roboomp 62c164d256 fix(catalog): pinned gpt-5.6 codex context window to 372k
Codex discovery falls back to DEFAULT_CONTEXT_WINDOW (272000) when upstream
omits context_window, which overwrote the previously-bundled 372000 hard
capacity for openai-codex gpt-5.6 luna/sol/terra on regen. OpenAI's Codex
model registry declares context_window = max_context_window = 372000, and a
direct Responses request with 350,317 input tokens completes, proving 272K is
not the route's hard cap.

Pinned these SKUs to 372000 in applyOpenAICatalogPolicy and refreshed the
bundled entries.

Fixes #5705
2026-07-16 13:39:04 +00:00
can1357 b68c7245f7 merged PR #5408: fix(catalog): widen GLM coding-plan idle timeout to OpenCode gateways 2026-07-16 03:32:04 +02:00
can1357 b865e6a4d7 fix(catalog): scope Kimi K2.7 timeout to Moonshot 2026-07-16 03:32:02 +02:00
can1357 9c78b7e7b0 merged PR #5428: fix(catalog): extend streamIdleTimeoutMs floor to Kimi K2.7 Code 2026-07-16 03:32:02 +02:00
can1357 d7241e572f fix(catalog): invalidate stale MAI Code routes 2026-07-16 03:31:58 +02:00
can1357 51b7601fc5 merged PR #5613: fix(catalog): route Copilot mai-code models to the /responses endpoint 2026-07-16 03:31:58 +02:00
can1357 ee7a6eb01b merged PR #5608: fix(ai): omit sampling params for OpenAI reasoning models 2026-07-16 03:31:57 +02:00
can1357 6783c3a473 merged PR #5573: fix: disable eager tool streaming for custom Anthropic endpoints 2026-07-16 03:31:57 +02:00
roboomp 4d89b29028 fix(catalog): routed copilot mai-code models to responses api
GitHub Copilot's mai-code-1-flash-picker (and other mai-* models) are
served only through the /responses endpoint; the classifier routed them
to /chat/completions, which returned 400 unsupported_api_for_model.

Added the mai- prefix to isCopilotResponsesModelId so both dynamic
discovery (inferCopilotApi) and bundled resolution
(COPILOT_API_RESOLUTION_RULES) select openai-responses, and updated the
bundled models.json entry to match.

Fixes #5612
2026-07-15 20:13:11 +00:00
roboomp f6de373506 fix(ai): omitted unsupported reasoning sampling params
- Added resolved sampling-parameter compatibility for OpenAI o-series and GPT-5+ models.
- Stopped Responses and Chat Completions payloads from forwarding temperature and related controls to restricted models.
- Added catalog and wire-payload regressions for GitHub Copilot GPT-5.6 Luna.

Fixes #5606
2026-07-15 19:30:53 +00:00
roboomp fdf79caf20 fix(catalog): sourced zai GLM pricing from PAYG models.dev key
The `zai` provider descriptor mapped the models.dev `zai-coding-plan`
key, which reports all-$0 subscription rates, so 13 of 14 GLM SKUs
showed token cost as "Free" in /models. The models.dev `zai`
pay-as-you-go key carries the real per-token rates for the identical
model ids, matching how other subscription providers surface comparison
pricing.

- Point the `zai` descriptor at the `zai` models.dev key.
- Regenerate the bundled zai cost blocks from the PAYG rates.
- Add issue-5598 regression test against the descriptor + mapper.

Fixes #5598
2026-07-15 17:47:03 +00:00
roboomp 9e72202b48 fix(ai): gated custom eager streaming on compat provenance
Keyed the non-official eager opt-in on resolved officialEndpoint provenance instead of a baseUrl equality check, so runtime provider baseUrl overrides that reroute canonical Anthropic models no longer leak eager_input_streaming even when the spec baked a resolved official compat block.

Fixes #5572
2026-07-15 11:52:55 +00:00
roboomp 375e890992 fix(ai): gated legacy anthropic beta to official endpoints
Kept strict custom proxies free of both eager_input_streaming and the legacy fine-grained tool-streaming beta while preserving the official API fallback.

Fixes #5572
2026-07-15 11:27:22 +00:00
roboomp 4b3ec660f3 fix(catalog): disabled eager streaming for custom anthropic
Defaulted eager tool input streaming to the canonical Anthropic API while allowing explicit models.yml opt-in for compatible proxies.

Fixes #5572
2026-07-15 11:20:12 +00:00
can1357 7dded47aa1 Merge PR #5409: fix(catalog): sync OpenCode models from live catalogs (@roboomp) 2026-07-14 23:11:09 +02:00
roboomp b61dddc783 fix(catalog): partitioned opencode model caches
Authoritative OpenCode model catalogs now use credential-and-endpoint-specific cache namespaces so one account cannot reuse another account's entitlements.

Fixes #4769
2026-07-14 20:08:32 +00:00
roboomp 29c8cae9ba fix(catalog): extend stream idle floor to kimi k2.7 code
Native Kimi K2.7 Code (kimi-k2.7-code / kimi-k2.7-code-highspeed) reasons
for minutes before the first stream event like K2.6, but the
streamIdleTimeoutMs branch in buildOpenAICompat gated only on
isKimiK26ModelId, so K2.7 Code fell through to the 120s default and
aborted on long reasoning turns. Match matchesKimiK27CodeFamily in the
same branch and rename the constant to KIMI_REASONING_STREAM_IDLE_TIMEOUT_MS.

Fixes #4836
2026-07-14 16:39:54 +00:00
can1357 f23f3f43e8 Merge PR #4959: fix(catalog): preserve static limits on cache fingerprint mismatch (@roboomp) 2026-07-14 18:34:13 +02:00
can1357 5ce32055dd Merge PR #5119: fix(catalog): classify Z.ai GLM-5.2 anthropic-messages endpoint as budget-effort with high/max (@oldschoola) 2026-07-14 18:34:13 +02:00
can1357 b9eebad3ad Merge PR #4975: fix(cursor): preserve max-mode flag (@roboomp)
# Conflicts:
#	packages/catalog/test/cursor-discovery.test.ts
2026-07-14 18:31:32 +02:00
roboomp 26a4a4f89e fix(catalog): made opencode discovery authoritative
OpenCode Zen and Go now replace bundled fallback models after successful live discovery instead of retaining removed entries.

Fixes #4769
2026-07-14 15:58:41 +00:00
roboomp 7cdecd824a fix(catalog): widened GLM coding-plan idle timeout to opencode gateways
GLM-5.x coding-plan SKUs idle for minutes mid-reasoning, so they get a
600s stream idle-timeout floor instead of the 120s default. That floor
was gated to the native Z.AI/Zhipu hosts only, so GLM-5.2 served through
the OpenCode Go/Zen gateways fell back to the 120s watchdog and stalled
with "OpenAI completions stream stalled while waiting for the next event"
during the slow /plan writing phase.

Fixes #4758
2026-07-14 15:56:49 +00:00
can1357 fde2d1d612 Merge remote-tracking branch 'origin/farm/acd088b5/github-copilot-business-vision' 2026-07-11 07:40:14 +02:00
can1357 ebe8ca50ad Merge remote-tracking branch 'origin/farm/2e273be7/fix-version-first-claude-ids' 2026-07-11 07:39:52 +02:00
oldschoola f34034fa7f fix(catalog): classify Z.ai GLM-5.2 anthropic-messages endpoint as budget-effort with high/max
Z.ai's Anthropic-compatible proxy (api.z.ai/api/anthropic) serves GLM-5.2
with the same two-tier high/max reasoning scale as Umans, but the catalog
predicate only matched provider 'umans'. The bundled zai/glm-5.2 entry
derived mode:'budget' with five synthetic effort tiers, so
output_config.effort was never emitted on the wire — only
thinking.budget_tokens.

Generalized isUmansGlm52ReasoningEffortModel to
isAnthropicMessagesGlm52ReasoningEffortModel, matching both 'umans' and
'zai' providers. Regenerated models.json from the updated policy.
2026-07-10 14:43:31 -07:00
roboomp 060179729e fix(codex): sent version header with requests
Added Codex version headers to turn requests and model discovery so backend-gated models resolve consistently.

Fixes #5105
2026-07-10 18:08:40 +00:00
roboomp c1480b29ec fix(catalog): parsed version-first claude ids
Recognized SAP AI Core hai-proxy Claude ids in claude-<version>-<kind> order so Anthropic thinking and capability inference stay on the adaptive path.

Fixes #5069
2026-07-10 13:09:34 +00:00
roboomp e58d2c460c fix(providers): preserved copilot vision denials
Treat GitHub Copilot discovery input as authoritative during model merges so explicit supports.vision=false is not OR-upgraded from bundled references.

Fixes #4779
2026-07-10 12:20:39 +00:00
roboomp 4bae9a42ab fix(providers): required copilot vision confirmation
Keep non-personal Copilot endpoints text-only when discovery omits supports.vision, while preserving explicit vision support.

Fixes #4779
2026-07-10 12:08:43 +00:00
roboomp b0f22caf83 fix(providers): restored copilot business vision
Honor GitHub Copilot /models vision support on Business and Enterprise endpoints and remove the stale snapcompact non-personal-host block.

Fixes #4779
2026-07-10 11:57:14 +00:00
can1357 d435385ab1 feat: introduced max reasoning effort tier across model and rpc systems
- Introduced `Max` as a first-class reasoning effort tier across all packages, including AI providers, coding agent configurations, and RPC protocols.
- Refactored model effort ladders to use wire-exact mappings and removed legacy effort aliasing (e.g., `max-to-xhigh` mapping).
- Updated model registry and provider configurations to support `Max` tier routing, color themes, and UI icon associations.
- Expanded test suites to provide end-to-end coverage for the new reasoning tier, including updated compatibility and fallback scenarios.
2026-07-10 13:39:42 +02:00
can1357 f79098b9ba fix(providers): corrected novita discovery and login
- Corrected Novita pricing from ten-thousandths of a dollar per million tokens.
- Validated pasted keys against the authenticated balance endpoint.
- Made live discovery authoritative and excluded models without positive output limits.
2026-07-10 12:08:44 +02:00
freecodewu a45ecd5593 Add Novita provider 2026-07-10 17:14:12 +08:00