2 Commits
Author SHA1 Message Date
Charan Rathore 5f0490a4ad provider, catalog: a prompt cap above a model's window is held to the window (#1286) — a catalog row with limit.input over limit.context (opencode/hy3-free's 192K over 190K, Cloudflare AI Gateway's gpt-5 at 272K over 128K, venice/openai-gpt-52) was served past its window, to the gateway's /v1/models and to every agent compacting at it. The input limit still wins wherever it sits under the window (gpt-5's 272K of its 400K, a real prompt cap; OpenCode's own client compacts at input too), and a row naming only one number keeps it. TestPluginCatalogClampsInputAboveWindow and TestWindowClampsInputAboveContext fail without the change. go vet, go build -tags nogui and go test -tags nogui ./internal/provider ./internal/catalog under a temp HOME pass. (#1288) 2026-10-08 18:45:13 +08:00
yetone a0d41044bb providers: a provider's model list says the context window agents are told — the one set on it, else models.dev's for a prefixed id — not only its vendor's list's (Discord, ARNO on v0.1.815: provider的上下文窗口覆盖功能好像失效了。cline插件的模型都没有默认的上下文窗口大小 … 如zai/glm-5.3-flash,cline-free/mimo-v2.6-flash) — the Providers page's models (providerInfo's modelJSON.Context) took catalog.Model.Context as the vendor's list or the plugin gave it, while the catalog's entries (entryFor: /v1/models, every agent's config, routing) take the window the user set (Provider.ContextOf) over it, and models.dev's for the id (catalog.ContextOf, which already reads zai/glm-5.3-flash as glm-5.3-flash) where the list says none. So a window set in the editor or with magpie model context reached agents but not the page, the agents' model pickers (which read the same list) or a chip's 1M tag, and a model listed with no window — Cline's plugin gives every model 0 (fixed in its 0.1.2), a relay's prefixed ids — showed none. The window is now one function, Provider.WindowOf (the user's, else ListedWindow: the list's, else models.dev's), which entryFor and providerInfo both read; the page is also told the window before the user's (listed), which the context field's "Each model's most" pick compares against, so a model set to its most still offers it. Lookups by a prefixed id were not broken: in the owner's config 14 of 794 models had no window on the page and one from models.dev for agents (Gemini's, Kiro's auto), the same split. TestProviderModelWindowSaid (a relay serving zai/glm-5.3-flash and own-model: the page says 1M before a window is set and 200K/64K after, as Served does) fails on the old code (the page said 0 where agents were told 1000000); TestPluginModelWindow (Cline's plugin with cline-pass/glm-5.3-flash, cline-free/mimo-v2.6-flash: models.dev's window, then the one set) guards the plugin path, which was already right for agents. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass; model-rate and editor-short-window pass in WebKit. Not tried with the reporter's Cline account; an agent already running keeps the window it started with until it rereads its config. 2026-10-04 13:36:54 +08:00