Commit Graph
3 Commits
Author SHA1 Message Date
yetone 19fafad16f provider: a test holds a plugin model and a group of it to one window (#3654)
mycf_711 (#3654) saw loomy/DeepSeek-V4.1-Flash told 1000000 (the "*"
window typed on the provider) and its group told 1048576 (the plugin's
declaration), and dsh then sent two histories in one request.

On main the member's entry is already the typed window (WindowOf, since
#2112 and 7aad6a50e), and buildGroupEntries reads that entry, so a group
of it that names no size is told 1000000 too. This test holds that. A
group told more than one member is told is a group with a larger member
in it (#700/#712), which is by design.

The doubling itself was not reproduced: in a sandbox HOME, dsh
0.2.1-rc.2 against a fake server, with the window flipped 1000000 <->
1048576 on resume, live (reload on and off), mid-request, after a
compaction, and with the model id flipped between a group and its
member, every request grew by its own two messages only. dsh builds a
request from session.deriveMessages() alone; a window change only adds a
request/context event.

Run (mote): go test -tags nogui -run
'TestGroupOfAPluginModelToldTheWindowSetOnIt|TestPluginModelWindow'
./internal/provider ok.
Not broken by hand: the test passes on main as it was; it guards, it
doesn't fix. Not tried: dsh's desktop/web profile, and the reporter's
own group (its other members).
2026-10-28 04:18:21 +08:00
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