Commit Graph
499 Commits
Author SHA1 Message Date
Pete Samwel fce059930e fix(catalog): emit AWS GovCloud us-gov Bedrock Claude inference profiles
Bare anthropic.claude-* Bedrock rows already derived eu.* selectors; also
emit us-gov.* so GovCloud accounts can resolve system inference profiles
without requiring a full partition ARN.
2026-08-04 13:13:18 -05:00
roboomp 58ced35dc0 fix(catalog): honored disabled DeepSeek thinking
Moved the direct DeepSeek enabled toggle into the thinking-only compat variant and normalized stale cached compat metadata before request encoding.

Fixes #7559
2026-08-03 21:48:40 +00:00
can1357 bc39ffa265 feat: introduced omptype validation package and migrated workspace dependencies
- Introduce `@oh-my-pi/omptype` as a new ArkType-compatible schema validation package featuring a lazy JIT runtime, JSON Schema emission, and compatibility adapters.
- Replace `arktype` across workspace packages and test utilities with `@oh-my-pi/omptype`.
- Add benchmark suites, tests, and documentation for the new validation engine and adapters.
- Update workspace build, test runner, and release configurations to include the new package.
2026-08-03 21:56:48 +02:00
can1357 35ed5db9e1 Merge PR #7473: fix(catalog): use live Copilot default-tier prices (@roboomp) 2026-08-03 14:46:23 +02:00
can1357 11559395c2 Merge PR #7468: fix(catalog): add reasoning config for deepseek-v4 family in alibaba-token-plan (@21307369) 2026-08-03 14:46:23 +02:00
can1357 c48376d8f0 fix(catalog): made bedrock-mantle dynamic discovery authoritative
- Account-scoped bearer /v1/models responses now replace the static seed
  instead of merging, so models disabled for the account are not selectable.
- Extended the catalog regression to run a real online refresh and assert
  the static seeds are pruned to the fetched IDs.
2026-08-03 14:36:57 +02:00
can1357 e06ccbd907 Merge PR #7080: fix(ai): add authenticated Bedrock Mantle routing (@anatoli-tsinovoy)
# Conflicts:
#	packages/ai/src/registry/registry.ts
#	packages/catalog/scripts/generated-policies.ts
#	packages/catalog/src/models.json
2026-08-03 14:36:52 +02:00
roboomp 27c1d6e8d4 fix(catalog): used live copilot default-tier prices
Applied GitHub Copilot's discovered default token-price tier to base models while preserving the provider fallback for unreported cache-write costs. Added regression coverage for GPT-5.6 Luna base and long-context pricing.

Fixes #7471
2026-08-03 08:38:14 +00:00
lsmir2 7beee683b9 fix(catalog): add reasoning config for deepseek-v4 family in alibaba-token-plan
Dynamically discovered deepseek-v4* models (e.g. deepseek-v4-flash-0731)
now receive reasoning: true and [high, max] thinking efforts via prefix
matching in the discovery mapper.
2026-08-03 15:55:14 +08:00
can1357 46ca4c6095 Merge PR #7317: fix(catalog): downgrade forced tool choice for deepseek reasoning models (@roboomp) 2026-08-02 20:55:16 +02:00
can1357 990ec2b0e8 fix(catalog): exclude Token Plan speech recognition models 2026-08-02 20:53:35 +02:00
roboomp ac403dbb71 fix(catalog): excluded token plan embedding models
Filtered text-embedding model IDs from authoritative Alibaba Token Plan chat discovery.

Covered text-embedding-v4 alongside the existing media-only discovery fixtures.

Fixes #7391
2026-08-02 16:16:24 +00:00
roboomp 3224245e98 fix(catalog): admitted discovered token plan chat models
Replaced the stale static discovery allowlist with explicit filters for media-only model families.

Covered newly advertised DeepSeek, Kimi, and MiniMax chat models while retaining image, audio, and video exclusions.

Fixes #7391
2026-08-02 16:09:07 +00:00
roboomp 93fe2ca9a9 fix(catalog): match opencode gateway by url for deepseek downgrade
Use isOpenCodeHost (provider id + baseUrl markers) instead of the built-in
provider-id check so DeepSeek reasoning models declared under a custom provider
id pointed at the OpenCode gateway URL also downgrade a forced tool_choice to
auto.

Fixes #7315
2026-08-01 20:23:07 +00:00
roboomp 879d8276c1 fix(catalog): scoped deepseek forced choice downgrade
Limit the DeepSeek forced tool-choice downgrade to the OpenCode Zen and Go
gateways whose default thinking mode rejects named selectors. Preserve forced
tool selection on NVIDIA and other gateways that can disable thinking for the
request.

Add regression coverage for both the affected OpenCode path and an unaffected
NVIDIA DeepSeek route.

Fixes #7315
2026-08-01 20:17:16 +00:00
roboomp 114a10d340 fix(catalog): downgrade forced tool choice for deepseek reasoning models
DeepSeek reasoning models on the OpenCode Zen/Go gateways 400 with
"Thinking mode does not support this tool_choice" when a specific tool is
forced. The compat descriptor already drops reasoning_effort via
disableReasoningOnToolChoice, but that does not turn off the gateway's
default thinking mode, so the forced named selector still trips DeepSeek's
thinking+tool_choice guard.

Mark forced tool_choice unsupported for DeepSeek reasoning models so
buildParams downgrades the selector to "auto" while keeping the tool
advertised, mirroring the Anthropic and direct-DeepSeek paths.

Fixes #7315
2026-08-01 20:05:27 +00:00
can1357 8fe2b8f9ba Merge PR #7311: fix(catalog): honor openrouter deepseek effort metadata (@roboomp) 2026-08-01 21:29:35 +02:00
can1357 e154c8ed0b fix(catalog): sourced antigravity claude pricing from google vertex
- Claude ids now alias to google-vertex suffixed entries (claude-opus-4-6@default etc.) so Antigravity follows Google's price if it diverges from Anthropic's list price; plain-id anthropic lookup remains as dangling-alias fallback.
- Regenerated models.json via gen:models.
2026-08-01 21:27:51 +02:00
can1357 d0d15f1a55 fix(catalog): implemented fallback pricing for unpriced antigravity models
- Added `applyAntigravityPricingFallback` to back-fill unpriced `google-antigravity` models using first-party list prices from `google` and `anthropic`.
- Mapped Antigravity model IDs to preview-id aliases (e.g., `gemini-3.1-pro` to `gemini-3.1-pro-preview`) for correct pricing resolution.
- Added test coverage in `packages/catalog/test/generated-policies.test.ts` verifying fallback pricing and preservation of billable costs.
2026-08-01 21:23:17 +02:00
roboomp 2cfaeb6116 fix(catalog): honored openrouter deepseek effort metadata
- Parsed OpenRouter reasoning effort ladders and defaults during discovery.

- Preserved explicit thinking metadata from models.yml patches.

- Regenerated the catalog and covered both regression paths.

Fixes #7307
2026-08-01 19:06:44 +00:00
can1357 4428110979 Merge PR #7267: fix(catalog): inherit base model limits for ollama tag variants (@roboomp) 2026-08-01 20:14:39 +02:00
can1357 40007abeb5 Merge PR #7230: fix(ai): honor model.compat.streamIdleTimeoutMs in the Anthropic idle watchdog (@excniesNIED) 2026-08-01 20:13:39 +02:00
can1357 09a7c86563 fix(catalog): unioned codex generator discovery across all oauth accounts
- Rewrote fetchCodexDiscoveryModels to resolve every stored openai-codex
  OAuth account via getOAuthAccesses and reuse openaiCodexModelManagerOptions'
  tested union/fail-closed path, so a single narrow account can no longer
  authoritatively wipe sibling-account models from the bundle.
- Restored openai-codex gpt-5.4, gpt-5.6-sol, and gpt-5.3-codex-spark bundle
  entries (and gpt-5.5's contextPromotionTarget) dropped by the previous
  single-account regen.
- Updated the live Codex image tool-result tests off the retired
  gpt-5.2-codex id to gpt-5.5.

Fixes #6265
2026-08-01 17:39:43 +02:00
roboomp c00790fa3a fix(catalog): cap ollama cloud deepseek-v4 output at 65536
Ollama Cloud's deepseek-v4-pro and deepseek-v4-flash deployments reject any
output budget above 65536 with HTTP 400, despite advertising a 1M context /
384K output (ollama/ollama#16890). Ollama's /api/show never reports this cap,
so the catalog left the base models at the full context window and the dated
tag deepseek-v4-flash:0731 at a stale 8192 fallback. Pin these ids (base plus
tag variants) to min(contextWindow, 65536) at both runtime discovery and
generation; other cloud models keep their discovered limits.

Fixes #7266
2026-08-01 15:30:17 +00:00
Anatoli Tsinovoy e5541a577a fix(ai): address Bedrock Mantle review feedback 2026-08-01 12:29:07 +03:00
excniesNIED 4a1abb8dba fix(ai): honor model.compat.streamIdleTimeoutMs in the Anthropic idle watchdog
anthropic-messages requests dispatched through the direct Anthropic provider
path ignored the catalog compat idle timeout. Slow relayed endpoints therefore
remained limited by the default inter-event watchdog even when the model
configured a wider or disabled timeout.

Add streamIdleTimeoutMs to AnthropicCompat, preserve it through
buildAnthropicCompat, and pass it as the fallback to getStreamIdleTimeoutMs in
streamAnthropic. A value of 0 disables only the inter-event watchdog; the
first-event watchdog is unchanged.

Resolution order matches the existing timeout helper contract:

caller option
> PI_STREAM_IDLE_TIMEOUT_MS
> PI_OPENAI_STREAM_IDLE_TIMEOUT_MS
> model compat
> 300s default

The pi-native transport retains its existing transport-level timeout policy.

Tested: anthropic stream timeout suite, env-contaminated regression cases,
models config validation, and bun check.
2026-08-01 15:15:31 +08:00
can1357 641e216ecf chore: update changelogs 2026-08-01 08:35:06 +02:00
can1357 71c755d5f6 feat: introduced aiand provider registry entry and model catalog
- Implement the ai& provider registry entry with API-key authentication and login support.
- Add model descriptors, static model seeding, and openai-compatible model discovery for the ai& provider.
- Update the model catalog with ai& provider models, pricing, and updated provider model names.
- Add unit tests for the ai& provider environment resolution, metadata, and dynamic model mapping.
2026-08-01 08:30:37 +02:00
can1357 c565e6fb44 feat(catalog): migrated model catalog endpoints to stencil.so with ETag and ZStd
- Migrated model catalog fetching and documentation references from the models.dev API to the stencil.so well-known models endpoint.
- Added support for zstd decompression and session-based caching with ETag conditional requests and stale fallback handling.
- Updated test suites, mock URLs, and constants across catalog and coding-agent packages to target stencil.so.
2026-07-31 20:38:49 +02:00
can1357 e9dda1f867 chore: applied biome formatting to merged pull request sources 2026-07-31 19:32:42 +02:00
can1357 160907233b Merge PR #7097: fix(catalog): route Copilot Grok 4.5 to Responses (@roboomp) 2026-07-31 19:28:42 +02:00
can1357 6480167f95 fix(catalog): align Cursor identity import with main 2026-07-31 19:28:41 +02:00
can1357 7bcd1aff41 Merge PR #7072: feat(cursor): expose 1M context windows in model discovery (@mmmeff)
# Conflicts:
#	packages/catalog/src/discovery/cursor.ts
2026-07-31 19:28:10 +02:00
can1357 56a176ea64 chore(catalog): regenerated models.json for synthetic capability mapping
- Regen picks up PR #7159's Synthetic mapper fields (reasoning, vision,
  output limits, pricing, thinking ladder) in the bundled syn:* entries.
- Includes incidental upstream metadata refresh (kimi-k3 efforts,
  deepseek-v4-flash, hf gpt-oss-120b) from models.dev since last regen.
2026-07-31 19:09:04 +02:00
can1357 8cb10f3f5b Merge PR #7159: fix(catalog): read Synthetic's advertised model capabilities (@Gareth-Rouse) 2026-07-31 19:08:31 +02:00
can1357 79fde0a8b7 Merge PR #7191: fix(catalog): disable store field for Google AI Studio openai-compat host (@yevman) 2026-07-31 19:07:27 +02:00
can1357 ac736d3ee1 Merge PR #7186: fix(cursor): preserve structured K3 history replay (@roboomp) 2026-07-31 19:07:19 +02:00
can1357 bf08e12629 Merge PR #7163: fix(session): reconstruct context without prompt usage (@harshav167) 2026-07-31 19:07:16 +02:00
can1357 b990e84a96 fix(catalog): dropped unconfirmed GMI Cloud cache-read price
GMI's launch post documents only $0.14/$0.28 per 1M for DeepSeek-V4-Flash;
the $0.028 cache-read figure was back-derived from OpenRouter's discounted
route and has no direct api.gmi-serving.com source. Keep cacheRead at 0
until GMI confirms cached-token billing, so usage cost reporting is not
overstated.
2026-07-31 18:46:14 +02:00
can1357 4a7dc22e99 fix(catalog): corrected GMI Cloud seed to direct-tariff metadata
- Set deepseek-ai/DeepSeek-V4-Flash cost to GMI's direct api.gmi-serving.com
  tariff ($0.14/$0.28 per 1M, cache read $0.028) per GMI's DeepSeek V4
  launch post, instead of values inherited from other providers.
- Documented that mapWithBundledReference keeps the seed's cost/reasoning/
  thinking at runtime: /v1/models discovery only overrides the model ID set
  and context/max-token limits, so the seed must carry real GMI values.
- Regenerated models.json.
2026-07-31 18:43:34 +02:00
can1357 685311807c fix(catalog,ai): seeded GMI Cloud default model into bundled catalog
- Added GMI_CLOUD_STATIC_MODELS seed wired into gen:models so a fresh
  install resolves deepseek-ai/DeepSeek-V4-Flash synchronously at boot,
  before async /v1/models discovery fires; live discovery stays
  authoritative and replaces the seed.
- Regenerated models.json with the seeded gmi-cloud slice.
- Dropped the GeneratedProvider cast now that gmi-cloud is bundled.
- Moved gmi-cloud to the end of the /login provider order.
- Moved changelog entries from released 17.0.3 sections to Unreleased.
- Added a regression test asserting the seed covers the descriptor's
  defaultModel.
2026-07-31 18:40:09 +02:00
yevman 2429efab86 fix(catalog): disable store field for Google AI Studio openai-compat host
Google AI Studio's OpenAI-compatible endpoint
(generativelanguage.googleapis.com/v1beta/openai/chat/completions)
implements a subset of the chat-completions schema and rejects the
`store` field with HTTP 400:

  Invalid JSON payload received. Unknown name "store": Cannot find field.

OMP unconditionally emits `store: false` for any openai-completions
model whose resolved compat has supportsStore: true, so every request
to a custom provider pointed at this host (a common wiring for the
`vision` role, e.g. gemini-2.5-flash) failed before the first token.

Add a googleAistudio host class (URL-marker only, like chutes, since
users wire this host under arbitrary provider ids in models.yml) and
include it in the isNonStandard set so supportsStore resolves false.
Same failure shape as openclaw/openclaw#22704.

Detection is URL-based: verified against a captured 400 request dump
from generativelanguage.googleapis.com/v1beta/openai/chat/completions.
2026-07-31 12:29:21 -04:00
definitelynotguruandcan1357 2c61c373b7 feat(catalog,ai): add GMI Cloud provider
Add the gmi-cloud chat-model provider, an OpenAI-compatible inference
gateway at https://api.gmi-serving.com/v1. Wired per the adding-a-provider
contract: a createSimpleOpenAICompletionsOptions helper and catalog entry
in pi-catalog, plus a registry definition with an API-key paste login in
pi-ai. Dynamic model discovery via /v1/models; auth falls back to
GMI_API_KEY. defaultModel is deepseek-ai/DeepSeek-V4-Flash.

The providerId is cast to GeneratedProvider until the next gen:models run
seeds gmi-cloud into models.json (same pattern as xai-oauth/vllm).
2026-07-31 18:21:30 +02:00
roboomp 53eae701bd fix(cursor): preserved structured K3 history replay
- Rebuilt assistant thinking, tool calls, and paired tool results in Cursor-native history shapes.
- Rejected K3 continuation when prior same-model thinking cannot be replayed safely.
- Marked dynamically discovered Cursor K3 variants as reasoning models.

Fixes #7184
2026-07-31 15:23:52 +00:00
Gareth-Rouse a2b0e2347a fix(catalog): keep Synthetic's wire-off reasoning through the manager merge
Codex P2 on b88869dc6 (reproduced live): the mapper's `reasoning: false`
for a `none`-only route only held for the raw fetcher. The production path
normalizes through `createModelManager`, where `mergeDynamicModel` merged
the dynamic row over the bundled reference with
`existingModel.reasoning || dynamicModel.reasoning` — so a stale bundled
`reasoning: true` (e.g. `hf:zai-org/GLM-5.2`) won again and `buildModel`
fabricated a `[minimal,low,medium,high,xhigh]` ladder for a route that
advertised only the `none` off-state.

`mergeDynamicModel` now treats Synthetic's discovered `reasoning` as
authoritative (both-sides-synthetic guard inside the per-id merge),
mirroring the existing Copilot `dynamicInputAuthoritative` precedent in
the same function. This loses nothing: the Synthetic mapper already folds
the reference's reasoning vote into the dynamic row whenever the wire is
silent on reasoning, so the reference still gets its say — at the mapper,
where the wire vocabulary can be consulted, instead of via a blind OR at
the merge.

The new regression test drives the full production path
(`createModelManager.refresh("online")`) rather than calling the fetcher
and `buildModel` directly, closing the gap Codex called out.
2026-07-31 11:52:23 +01:00
Gareth-Rouse 850ecb0d5f fix(catalog): keep single-tier Synthetic reasoning routes reasoning
Codex P2 on b88869dc6: the reasoning gate required more than one ladder
entry, so a route advertising exactly one named tier (e.g.
`reasoning_parameters.efforts: ["high"]`) was marked non-reasoning and its
only wire-accepted `reasoning_effort` was hidden and dropped. The
off-switch is a vocabulary with no named tiers (`["none"]` or unrecognized
values alone), not a one-tier ladder — gate on the named-tier count
instead. Adds a single-tier regression test asserted through buildModel.
2026-07-31 11:34:50 +01:00
Gareth-Rouse b88869dc64 fix(catalog): let Synthetic's wire vocabulary override reference metadata
Addresses two review items on the Synthetic capability fix:

- Codex P2: an advertised `reasoning_parameters.efforts` list is now
  authoritative over the bundled reference's `reasoning` flag. Previously a
  `hf:*` reference with `reasoning: true` re-armed the effort dial even when
  the wire advertised only the `none` off-state, so the raw spec carried a
  misleading `reasoning: true` plus a one-stop minimal ladder. When the wire
  names tiers, the reference no longer gets a vote.
- roboomp should-fix: a present-but-empty `supported_features: []` was
  treated like absent metadata and left `supportsTools` unset, which the
  request layer reads as tool-capable. A present array (empty included) with
  no `tools` entry now marks the route tool-less, while a reference that
  already vouched for tools still wins over a merely-incomplete wire list.

Tests: stale-reference override is asserted through the built-model path
(`buildModel`), and a new fixture covers the empty-features contract.
7 pass; full packages/catalog suite 525 pass, 0 fail.
2026-07-31 11:19:38 +01:00
Harsha Vardhan 66a7126b5b fix(session): reconstruct context without prompt usage 2026-07-31 20:10:01 +10:00
Gareth-Rouse 306245cb78 fix(catalog): keep Synthetic effort ladders inside the wire vocabulary
Code review on b2880217e found three edge-shape leaks in the new mapper:

- A route advertising efforts: ["none"] (or only unrecognized tiers) set
  reasoning: true with thinking: undefined, so resolveModelThinking fell
  through to identity inference and fabricated an unadvertised
  low/medium/high/xhigh ladder for the request layer. None-only routes
  now map onto minimal -> none and report non-reasoning; unrecognized-only
  vocabularies keep the reference reasoning flag but never grow tiers the
  wire did not name.
- The same undefined-thinking path let a stale bundled reference ladder
  (e.g. hf:zai-org/GLM-5.2's baked tiers) survive past the wire
  vocabulary. Wire efforts now always override the reference ladder.
- supportsTools: false was written from a populated but tool-less
  supported_features list with no reference OR-fallback, unlike
  reasoning/input, so an incomplete wire list could hard-disable tools
  on a route the reference marked tool-capable. The strip now also
  honors an explicit reference supportsTools: false and only downgrades
  when neither source vouches for tools.

Tests: none-only vocabulary, stale-reference override, and the discovery
request's Authorization header. 6 pass; full packages/catalog suite 524
pass, 0 fail.
2026-07-31 10:31:35 +01:00
Gareth-Rouse b2880217e9 fix(catalog): read Synthetic's advertised model capabilities
The Synthetic discovery mapper looked for `supports_reasoning`,
`supports_vision` and `max_tokens`. Synthetic's /openai/v1/models sends
none of those: capabilities arrive in `supported_features`, the accepted
`reasoning_effort` vocabulary in `reasoning_parameters.efforts`,
modalities in `input_modalities`, the output cap in `max_output_length`,
and per-token prices in `pricing` as `$`-prefixed strings.

Every capability therefore fell back to the bundled reference, so any
route without one — the `syn:*` router aliases, newly added routes such
as `hf:moonshotai/Kimi-K3` — resolved to `reasoning: false`, text-only,
zero cost, `maxTokens: 8192`. `reasoning: false` makes
`getSupportedEfforts` return `[]`, which hides the thinking selector and
silently drops a `provider/model:high` suffix, so those models never
receive `reasoning_effort` at all; the 8k cap is low enough that verbose
models stop on `length` every turn, which reads as an incomplete
response and triggers recovery compaction at ~9% context.

Read the fields Synthetic actually sends and derive the effort ladder
from the per-model wire vocabulary. `none` is the router's thinking-off
state rather than a user tier, so it backs `minimal` through the wire
map, mirroring the existing Fireworks `minimal -> none` mapping.

Verified live against api.synthetic.new: `reasoning_effort` is accepted
on every route (`none` yields no reasoning, `high` < `max`), and the
`syn:*:vision` aliases do accept image input.
2026-07-31 10:05:52 +01:00