89 Commits
Author SHA1 Message Date
github-actions[bot] d26fdce0a7 chore: refresh models.dev snapshot (+116 -124 ~284) 2026-11-02 06:23:18 +00:00
github-actions[bot] c50fb53854 chore: refresh models.dev snapshot (+34 -28 ~82) 2026-10-26 23:10:24 +00:00
github-actions[bot] 53d3751996 chore: refresh models.dev snapshot (+338 -454 ~2857) 2026-10-26 15:06:07 +01:00
Arnaud Héritier fd23717648 test(modelsdev): pin the Haiku 5.5 price tier boundary
Signed-off-by: Arnaud Héritier <aheritier@apache.org>
2026-10-21 12:50:19 +02:00
github-actions[bot] c0db603e44 chore: refresh models.dev snapshot (+661 -71 ~381) 2026-10-19 06:35:16 +00:00
David Gageot 5b38f1d517 fix: price OpenAI requests by actual service tier
Remove the model allowlist and instead derive the Fast tier premium
from matching catalogue entries, falling back to the documented
multiplier when metadata is missing or inconsistent. Endpoint and
cost-override guards, tests, and docs are preserved.

Signed-off-by: David Gageot <david.gageot@docker.com>
2026-10-17 13:09:15 +02:00
github-actions[bot] c825db7618 chore: refresh models.dev snapshot (+151 -138 ~264) 2026-10-12 06:43:06 +00:00
github-actions[bot] aedd4f1a4e chore: refresh models.dev snapshot (+91 -27 ~130) 2026-10-07 22:20:53 +00:00
David Gageot af03ff01d6 fix: honor configured OpenAI base_url when pricing fast tiers
An explicitly configured base_url of https://api.openai.com/v1 was
being treated as a custom endpoint, so the fast/priority (2x) and
ultrafast (6x) service-tier cost multipliers silently fell back to
standard rates. Only the resolved client endpoint was checked before;
now both the configured and resolved values are compared against the
official endpoint.

Also narrows Vercel's gpt-6-astra long-context tier boundary from
272001 to 272000 tokens so it matches the exclusive threshold
RatesFor expects, and adds published-rate boundary coverage for
gpt-5.6-luna and gpt-6-astra plus mixed-tier SQLite persistence tests.

Assisted-By: docker-agent
2026-10-07 13:51:52 +02:00
Arnaud Héritier 0be7276d05 Merge pull request #4530 from docker/fix/catalog-provider-aliases
fix(models): align provider IDs with the catalogue
2026-10-07 09:35:34 +00:00
David Gageot 07a3a4a739 feat: price OpenAI fast/priority and ultrafast by actual service tier
Cost accounting now uses the tier the provider actually served instead
of the one requested, covering chat, responses, and websocket
transports. Custom endpoints, routers, and cost overrides are left
alone. WebSocket and HTTP paths now resolve the base URL the same way,
fixed at client construction for both transports.

Assisted-By: docker-agent
2026-10-07 11:03:00 +02:00
Arnaud Héritier ceb461233e fix(models): align provider IDs with the catalogue 2026-10-07 09:50:48 +02:00
github-actions[bot] 44ed5e77e8 chore: refresh models.dev snapshot (+132 -38 ~155) 2026-10-05 06:41:32 +00:00
github-actions[bot] 58d7decca4 chore: refresh models.dev snapshot (+30 -14 ~39) 2026-09-29 19:56:28 +00:00
github-actions[bot] 160584ba3a chore: refresh models.dev snapshot (+38 -14 ~95) 2026-09-29 09:56:04 +00:00
github-actions[bot] 5ac741bacf chore: refresh models.dev snapshot (+206 -65 ~214) 2026-09-28 06:38:01 +00:00
github-actions[bot] 4210ed4e3c chore: refresh models.dev snapshot (+58 -0 ~74) 2026-09-23 08:22:11 +00:00
github-actions[bot] b4d72dd313 chore: refresh models.dev snapshot (+247 -54 ~151) 2026-09-22 19:25:31 +00:00
github-actions[bot] ed5b152e99 chore: refresh models.dev snapshot (+262 -186 ~399) 2026-09-21 06:35:25 +00:00
David Gageot 44cd062b84 Merge pull request #4275 from dgageot/lint/atomic-write
feat(lint): require atomicfile.Write for marshalled state
2026-09-14 10:32:02 +00:00
David Gageot 8fa421a615 feat(lint): require atomicfile.Write for marshalled state
Assisted-By: docker-agent
2026-09-14 12:15:59 +02:00
github-actions[bot] 7ce42ad3a6 chore: refresh models.dev snapshot (+310 -83 ~331) 2026-09-14 06:34:39 +00:00
David Gageot 6e704c874a refactor: inline the single-use context tier constant 2026-09-07 17:46:22 +02:00
David Gageot 30d951b2b5 test: cover tier pricing boundaries and config overrides 2026-09-07 17:46:21 +02:00
David Gageot 900335b6ba docs: keep tier-pricing comments concise 2026-09-07 17:45:34 +02:00
David Gageot ebfebd4411 fix: limit catalog refresh to long-context pricing tiers 2026-09-07 17:45:11 +02:00
David Gageot 03b395afd7 fix: account for long-context model pricing tiers
Assisted-By: Claude
2026-09-07 17:44:29 +02:00
github-actions[bot] 64c6d9b1f2 chore: refresh models.dev snapshot (+129 -67 ~322) 2026-09-07 06:23:31 +00:00
Arnaud Héritier 99e92384e0 feat(modelsdev): add EmbeddedSnapshot and Fetch helpers
EmbeddedSnapshot exposes the build-time snapshot.json catalog as a
read-only singleton, and Fetch hits the live models.dev API directly,
surfacing a network failure instead of silently degrading to a cache
or the embedded snapshot.

Together with the existing NewDatabaseStore these let callers build a
Store that is either provably hermetic or provably live, instead of
Store's usual best-effort network-then-cache-then-snapshot fallback.

Groundwork for #4134.
2026-09-03 14:49:49 +00:00
github-actions[bot] b97924c00b chore: refresh models.dev snapshot (+79 -75 ~196) 2026-09-02 21:40:35 +00:00
dgageot c5740774ad chore: refresh embedded models.dev snapshot 2026-08-31 13:05:08 +02:00
Arnaud Héritier 8b08b30b19 fix: replace removed deepseek-chat with deepseek-v4-pro
models.dev removed deepseek-chat and deepseek-reasoner from the deepseek
provider. Update all references to use deepseek-v4-pro (the current
flagship model) and refresh the embedded snapshot to match the live
catalog.

Fixes: TestParseExamples/../../examples/deepseek.yaml
2026-08-25 12:47:56 +00:00
dgageot 6d8e7bd825 chore: refresh embedded models.dev snapshot 2026-08-24 09:48:19 +00:00
dgageot 80b7669f37 chore: refresh embedded models.dev snapshot 2026-08-17 10:43:05 +02:00
Arnaud Héritier 95f3d1aba9 fix: update gopher examples to gemini-3.1-pro-preview
gemini-3-pro-preview was removed from the live models.dev catalog,
causing TestParseExamples to fail on both Linux and Windows CI runners
with: 'model "gemini-3-pro-preview" not found in provider "google"'.

Switch the reviewer agent in examples/gopher.{yaml,hcl} to
gemini-3.1-pro-preview, its direct successor in the catalog.

Also regenerate pkg/modelsdev/snapshot.json so the baked-in fallback
snapshot stays in sync with the current live catalog.
2026-08-10 14:59:42 +00:00
dgageot f0336d4103 chore: refresh embedded models.dev snapshot 2026-08-04 11:35:45 +02:00
dgageot 6f16cd7fd8 chore: refresh embedded models.dev snapshot 2026-07-27 10:04:20 +02:00
Arnaud Héritier 0d3a5c6fcf chore: refresh models.dev snapshot to 2026-07-24
Runs go generate ./pkg/modelsdev/... to pull the latest catalog from
models.dev. The only change to the anthropic provider is the addition of
claude-opus-5 (family claude-opus, 1M context, 128k output, $5/$25
pricing, text+image+pdf input). Five new niche providers are also added
as part of the wholesale refresh.

Adds TestEmbeddedSnapshotIncludesClaudeOpus5 to guard against a future
stale snapshot silently dropping the new model, mirroring the existing
GPT-5.6 regression test.
2026-07-24 19:41:40 +00:00
David Gageot e933dea557 refactor: move Desktop proxy transport to leaf package pkg/desktop/transport
pkg/modelsdev, pkg/gateway and pkg/httpclient only needed
remote.NewTransport, but importing pkg/remote drags the whole OCI
registry stack (go-containerregistry, docker/cli, credential helpers)
into every consumer of pkg/model/provider, pkg/session and pkg/agent.

Move the transport (and its proxy fallback logic) to
pkg/desktop/transport, which only depends on pkg/desktop and
pkg/memoize. remote.NewTransport is kept as a deprecated forwarder so
existing integrations keep compiling and behaving identically.

pkg/model/provider now pulls 24 external modules instead of 31.
2026-07-21 22:32:10 +02:00
dgageot 55d09e905b chore: refresh embedded models.dev snapshot
Signed-off-by: David Gageot <david.gageot@docker.com>
2026-07-20 09:55:51 +02:00
Arnaud Héritier 99a3c80532 feat: optimize GPT-5.6 defaults and reasoning
Make GPT-5.6 easier and more efficient to use by updating provider
defaults, model-specific reasoning levels, built-in agents, examples,
and the embedded models.dev catalog.

References:
- https://developers.openai.com/api/docs/guides/latest-model
- https://developers.openai.com/api/docs/guides/reasoning
- https://developers.openai.com/api/docs/models/gpt-5.6
- https://developers.openai.com/api/docs/models/gpt-5.6-sol
- https://developers.openai.com/api/docs/models/gpt-5.6-terra
- https://developers.openai.com/api/docs/models/gpt-5.6-luna
- https://developers.openai.com/codex/models
- https://models.dev/models/openai/gpt-5.6-sol
- https://models.dev/models/openai/gpt-5.6-terra
- https://models.dev/models/openai/gpt-5.6-luna
2026-07-10 11:38:14 +02:00
David Gageot a0738d9d4f fix: make model picker refresh async and non-blocking
Prevent picker stacking on ctrl+r, preserve the search query across
refreshes, and avoid holding the store mutex during network I/O.
Coalesce refreshes with a dedicated refreshMu, improve error handling
for in-memory and not-modified edge cases, and add covering tests.

Assisted-By: Claude (Anthropic)
2026-07-09 20:46:49 +02:00
David Gageot bf7f65ddba feat: add Ctrl+R force-refresh to the model picker
Pressing Ctrl+R in the model picker bypasses the models.dev cache TTL,
re-fetches the catalog, and reopens the picker with updated choices.

Assisted-By: docker/docker-agent
2026-07-09 20:32:52 +02:00
David Gageot ddbdb726fc fix: guard nil fetch funcs and fix misplaced godoc in store and catalog 2026-06-30 16:13:43 +02:00
David Gageot 4914d81fca refactor: replace package-level globals with dependency injection for parallel-safe tests 2026-06-30 14:44:24 +02:00
David Gageot febcdb9e5e fix: adapt context call sites after rebase on main
Restore the context.Context parameter on app.New (the rebase auto-merge
silently dropped it while keeping the ctx-using body) and thread the
caller's context through all call sites, including tests.

Annotate the build-time root context in the new
pkg/modelsdev/internal/gen snapshot generator (landed from main) for the
ContextConnectivity cop: it is a standalone main with no parent context.
2026-06-29 10:24:18 +02:00
David Gageot 2d157247ba feat(modelsdev): embed models.dev catalog snapshot as binary fallback
Adds a build-time snapshot of the models.dev catalog baked into the
binary via go:embed, used as last-resort fallback when the cache and
live fetch are both unavailable. A generator (pkg/modelsdev/internal/gen)
refreshes the snapshot; task update-models and a weekly GitHub Actions
workflow keep it current.

The fallback snapshot is not memoized on transient fetch failure, so the
Store retries the fetch once the network recovers. Context windows for
Fable and Opus 4.6-4.8 now come from the embedded snapshot (always
available, even offline); the Anthropic client falls back to the flat
200k floor only when no catalogue entry exists. A warning is logged when
the embedded snapshot fails to parse so a bad build artifact is
discoverable.

The snapshot freshness check is opt-in: TestSnapshotDateParses always
runs (time-independent) while TestSnapshotDateIsFresh is skipped unless
CHECK_MODELS_SNAPSHOT_FRESHNESS is set. A 'task check-models-fresh'
target provides the CI backstop.

Assisted-By: Claude
2026-06-27 16:00:08 +02:00
Sayt-0 7acef6c28a fix(modelsdev): skip models.dev fetch for custom providers (#3165)
Resolving a model for a user-defined custom provider (a name that is not a
built-in or alias, e.g. mistral_gateway) loaded the full models.dev catalog,
which performs a blocking 30s GET to https://models.dev/api.json. In
internet-restricted environments this hung the request loop (loop.go) and
session compaction on every turn, making a self-contained custom-provider
config (base_url + token_key) unusable.

modelsdev.Store gains WithKnownProvider: a provider the predicate rejects is
resolved from the cache only and never triggers an outbound fetch (a missing
cache yields an empty catalog, so the lookup returns a clean "provider not
found"). The cache-only snapshot is memoized separately from the authoritative
catalog, keeping the per-turn hot path cheap (no repeated catalog re-parse)
without ever satisfying a fetch-eligible lookup for a known provider.

The runtime's default store (lazyModelStore) and RuntimeConfig.ModelsDevStore()
are wired with provider.IsKnownProvider, so only catalog providers (built-ins
and aliases) can reach the network; custom providers resolve locally and the
agent stays usable air-gapped.
2026-06-19 11:18:14 +02:00
David Gageot 6d7fd025b2 refactor: derive ModelsDevAPIURL from APIHost to prevent drift 2026-06-09 19:54:54 +02:00
David Gageot 397bc99032 Allow models.dev in sandbox proxy for catalog metadata resolution 2026-06-09 19:52:55 +02:00