ac4af582301a4e8a29245dbba767eba31334ddf9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f37de8cc4e |
provider: the saved Claude accounts' files are listed once per request
claudeCodePrice and claudeModelsOf listed claude-accounts/*/.claude.json with filepath.Glob on every call, and each Claude model's price asks. Building an agent's model list (the window's drift poll rebuilds it each minute, buildClaudeVia and Pi's list) read the folder once per model. The listing is now held while a request holds the catalog (heldOf, 1 s), so a build lists it once; outside a hold it is listed afresh, as before. Measured on mote, real-account copy, GUI page open in Playwright Chromium, network blocked, 115 s CPU profile (acgui.sh), v0.1.3425-era build vs this change: - filepath.Glob: 50 ms -> gone; agent.buildModels 90 ms -> 50 ms - total samples 320 ms -> 290 ms; footprint 197 MB -> 172 MB (one run each) Test: TestClaudeCodeFilesListedOncePerHold saves a folder during a hold and checks the hold's second listing is the first one (same array), and that after the hold the new folder is seen. Broken by hand (the old claudeCodeFiles): red, "listed again within one hold". Run (mote): go test ./internal/provider ./internal/agent ok; go vet native (provider, agent), GOOS=linux and GOOS=windows (provider) ok; gofmt clean. |
||
|
|
f51ab771f6 |
catalog, provider: a model only models.dev's lab lists is known, and a Claude account lists the gated models Anthropic told its Claude Code of (iebb on Discord)
iebb on Discord (10-27): his account has Claude Mythos 5.1, magpie doesn't list it. models.dev took the gated Mythos 5.1 out of anthropic's provider list (models.dev #11327) and kept only its lab file, models/anthropic/claude-mythos-5-1.toml (#11328). Cause. magpie read only models.dev's api.json (providers -> models). The Claude subscription's list was exactly catalog.Provider("anthropic"), so Mythos 5.1 left it with that PR. And a vendor list that still returns it (an Anthropic key's /v1/models) got no window, reply limit, name or thinking for it, since nothing read the lab catalog. Fix. - catalog: Sync also keeps models.dev's lab catalog (models.json) as labs.json beside the cache, through temp+rename; a failed fetch keeps the last one, and a cache without it is Stale once a process. A model only a lab lists votes into the same tables as a listed one (ContextOf, OutputOf, NameOf, Thinks, SeesImages); a model a provider lists keeps what providers say. A thinking lab-only model with no levels takes those of the newest of its family a provider gives (labKinEfforts: Mythos 5.1 takes Mythos 5's). catalog.Describe builds a Model from an id for lists that name ids alone. - provider: the Claude account's list is models.dev's anthropic list plus what Anthropic told the account's Claude Code beyond it, read from .claude.json's additionalModelOptionsCache / modelAccessCache / additionalModelCostsCache (Claude Code's own sign-in and each saved account's directory). Account.Lists honours modelAccessCache's entitled per account, ListPrice falls back to Anthropic's price from additionalModelCostsCache, and the agent's own Claude Code picker (claudeOwn) offers the signed-in account's extras. WSL keeps the catalog list. magpie still asks Anthropic nothing with a Claude sign-in; nothing is sent differently, no Claude Code mimicry change. - docs/subsystems/providers-accounts.md: two rows, the lab catalog and a Claude account's models. Testdata: models.dev's api.json and models.json as served on 10-27, cut to the anthropic and azure providers' Claude models and the anthropic lab. Tests never reach the network. Run: - TestLabOnlyModelIsKnown, TestLabsLeaveListedModels, TestSyncKeepsLabs, TestClaudeAccountListsGatedModels, TestAnthropicKeyGatedModelDescribed: pass. - go test -count=1 -timeout 45m ./internal/catalog/ ./internal/provider/ ./internal/agent/ ./internal/gateway/ at |