5fa537146ef7529f8317a083eab3064b7f685cce
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
4a35799021 |
factory 0.1.32: a model's token multiplier reaches magpie as its rate (#158)
Every model in MODELS carries the tokenMultiplier droid 0.241.1's registry has for it (testdata/droid-0.241.1-costs.txt, byte for byte). A promotion running takes its discount off it, with the multiplier before it as rateWas; one that has ended or not begun is no discount. The rate reaches magpie through a provider hook (host.js reads rate/rateWas from its models; a config hook's models carry no rate there). Fast Mode entries stay last. Reviewed at 498b8723e5350657aa26f8f0e2bb1d859f59803b: - each multiplier and promotion checked against the testdata excerpt; gpt-5.6-sol's expired M promotion is skipped and Pt (20%) applies, as droid's first-running-promotion rule gives - host.js info(): the provider hook's list replaces the config list, and the request path strips temperature for OpenAI models in droidBody, so capabilities.temperature=true in providerModel changes nothing sent - factory unchanged on main between the PR's base |
||
|
|
b015ee515e |
factory 0.1.29: Claude Code on GLM and other /api/llm/o models goes without the phrases Factory refuses, not "403 Factory: Forbidden" (Echoo on magpie's Discord)
Echoo, with Factory moved onto this plugin, got "API Error: 403 Factory:
Forbidden" from Claude Code on GLM-5.3-Flash, while Codex worked on the
same account and model. GLM is a chat model Factory serves on /api/llm/o,
so magpie translates Claude Code's Messages request into chat completions
(or Responses) before the plugin gets it. Only anthropicBody, the
/api/llm/a route, adapted Claude Code's fixed phrases Factory refuses (its
identity line, "You have been invoked in the following environment", "You
are powered by the model", update-config's "not Claude, so memory", tool
output quoting them). droidBody, for /api/llm/o, only added droid's line,
so all of them went to Factory as they were. The headers, the model and
the account are the same for both agents; Codex's prompt has none of the
phrases.
anthropicBody's per-text adapters are now functions of their own
(claudeIdentity, promptText, systemMessageText, userBlockText), and
droidBody applies them to chat completions and Responses:
- chat's first system message and Responses' instructions as a system
prompt; other system and developer messages as system messages;
- user text as a user block; a chat user string, where magpie joins a
turn's blocks with nothing between them, also reminder by reminder;
- chat's tool messages and Responses' function_call_output as tool output.
The Messages route is unchanged: the refactor kept every earlier test
green before the new code went in.
testdata/claude-code-2.1.300-glm-{chat,responses}.json are magpie's
translations of a real Claude Code 2.1.300 request, captured in a sandbox
HOME (paths changed to /Users/me, tools left out).
Run: bun test in packages/factory, 143 pass. With index.mjs at 0.1.28 the
new claude-chat.test.mjs fails 4 of 5 (the Codex one passes on both).
bun scripts/check.mjs factory: ok. Routed the captured request through the
plugin: each refused phrase is 0 in the chat and Responses bodies now, as
on /api/llm/a (1 each with 0.1.28).
Not tried against Factory itself: there is no Factory account to try with.
|
||
|
|
2170a3781e |
factory 0.1.27: droid's Fast Mode models, and fast asked of their base model goes to them (#119)
psylch on #119 (plugin 0.1.26): claude-opus-5-5-fast answered "Factory: Not found.", and Opus 5.5 asked with speed "fast" was recorded as tier_asked fast, tier_served standard, with nothing said. The plugin now offers droid 0.240.0's Fast Mode models: Opus 5.5/5/4.8 Fast on Anthropic's API, GPT-5.5/5.4/5.3-Codex Fast on Responses, each at its base model's limits and efforts. They go out as droid 0.240.0 sends them (read from its binary, saved in testdata/droid-0.240.0-fast.txt): the Fast Mode id itself as the model, with speed "fast" and the fast-mode-2026-02-01 beta for anthropicFastMode models, at service_tier "priority" for the GPT ones (their apiRequest Ee). A request asking a base model for fast (speed "fast" on Messages, service_tier "priority" on Responses) is sent to its Fast Mode model, as droid's fast toggle switches to it. A model with no Fast Mode model is sent as asked. Left out: Opus 4.6/4.7 Fast and GPT-5.4 Mini Fast (base not offered), GPT-5.6 Sol Fast (unreleased:!0), GLM-5.2 Fast (feature flag, a Baseten id). Run: the full bun test (1222 pass, 0 fail) with a sandbox HOME; the new fast.test.mjs and the picker test fail on the old index.mjs (4 fail). Not tried: a real Factory account (none signed in here), so whether Factory serves the Fast Mode ids at fast speed to a plan, and what its usage says about speed, is unverified. A non-stream request magpie translates for a plugin account drops speed before the plugin sees it, so there only the -fast ids reach fast. |
||
|
|
60c905410e |
factory: Gemini 4 Argon and Gemini 3.x reach Factory's own Gemini route (yetone/magpie#2080)
The plugin offered no Gemini model, so Gemini 4 Argon, new in droid 0.241.1's picker, and the Gemini 3.x models magpie's built-in has were missing for everyone moved onto the plugin. - Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8/3.7/3.6/3.5 Flash and Gemini 3 Flash are offered on @ai-sdk/google at /api/llm/g/v1, with droid 0.241.1's names, total context 1M, output 65536, efforts and images. Each effort is a thinkingConfig thinkingLevel, as the zed plugin sends Gemini's. - send() takes the Google package's models/<id>:streamGenerateContent to Factory's /api/llm/g/v1/generate, as the built-in does (pathOf Gemini, FactoryGemini): the model in the body, no stream field, the system instruction without a role and opened with droid's line like factoryDroidGoogle. x-api-provider is google; the Google package's x-goog-api-key is dropped. A rewritten body no longer keeps the caller's content-length. - Gemini counts in standard's windows, not Droid Core's, as the built-in's factoryCore has it. - Gemini 4 Argon is behind a Factory feature flag (featureFlag Gemini4Argon, unreleased) in droid 0.241.1; an account it isn't on for may be refused it. testdata/droid-0.241.1-gemini.txt is droid 0.241.1's picker and Gemini entries, byte for byte from @factory/cli-darwin-arm64@0.241.1 bin/droid (each line checked present in the binary). muse-spark-1.2, also new in that picker, is not added here. Run: bun test in packages/factory (130 pass), bun scripts/check.mjs. Broken by hand: without the route rewrite the three gemini.test.mjs tests fail; without google in CORE's exclusion usage.test.mjs fails. Not tried: a real Factory account (none signed in here), so neither Factory's answer to these bodies nor Gemini 4 Argon's flag was seen. |
||
|
|
e4023d9912 |
factory 0.1.25: Haiku 5.5 and Mistral Large 4, in droid 0.240.0's picker, reach Factory through magpie (JL on Discord)
JL (Windows, droid 0.240.0, Factory desktop 0.197.1, magpie 0.1.1226, plugin 0.1.24): droid and Factory desktop offer claude-haiku-5-5, droid through magpie didn't, as the plugin's model table didn't have it. How droid gets its models: its npm package (@factory/cli 0.240.0, the platform binary @factory/cli-darwin-arm64) bundles the model registry in bin/droid; the picker lists that registry (order `y`), gated by availableInCLI, unreleased, feature flags and legacy grouping. Diffing the registry of 0.233.0 (the release the plugin's table was last matched to) against 0.240.0 gives three new models: claude-haiku-5-5, mistral-large-4 and gpt-6-astra-ultrafast. - Haiku 5.5: Anthropic Messages, x-api-provider anthropic, context 872000 / output 128000 (contextLimits ce, as Sonnet 5.5 and Opus 5.5), efforts low..max (droid's "off" is the request without a level). - Mistral Large 4: generic chat completions, x-api-provider mistral, Droid Core (billingPool core), 524288 / 64000, images, effort high. - GPT-6 Astra Ultra Fast stays out: droid offers it only once the user has accepted Factory's high-cost terms (explicitOptInRequirement high_cost). models.test.mjs is new; its fixture (testdata/droid-0.240.0-models.txt) is the registry's own bytes: the picker order, the context helper and the three entries. It checks the two models as droid has them and that every model in droid's picker is offered or on a named list left out (router, Gemini, unreleased, opt-in, the older generations the plugin never offered). With the Haiku 5.5 line removed both tests fail. usage.test.mjs's Core list gains Mistral Large 4. Run: bun test in packages/factory (126 pass), bun scripts/check.mjs factory; a fake Factory saw /api/llm/a/v1/messages with x-api-provider anthropic for claude-haiku-5-5 and /api/llm/o/v1/chat/completions with mistral for mistral-large-4. Not tried against Factory itself (no Factory account here); droid itself was not run. |