main
66
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
21c3f948f1 |
factory 0.1.52: "harness" reads runtime in a client's prompt and tool descriptions, and Claude Code's tool search goes as tools declared in full
@DennisYan4 on X (2026-11-19): Claude Code, Pi and Codex through Factory answer 400 content_policy_rejected since 11-17, and Claude Code's deferred tools fail. Factory's policy check refuses a client describing itself as an agent harness; Pi passed once its prompt said "runtime" for "harness". The word alone changes (names like harness_key and the user's own turns are left), in system prompts, system messages, the update-config entry and tool descriptions. Claude Code's tool search (defer_loading, the DeferredToolPlaceholder tool, tool_reference/tool_definition/tool_addition blocks) is turned into what its own no-tool-search path sends: every loaded tool declared in full, a reference answered as text so the pairing stays. Run: bun test packages/factory on mote (226 tests, green); the 5 new harness tests are red on the previous index.mjs. The root `bun test` was left to CI (a one-hour run on mote). |
||
|
|
e6c457112a |
factory 0.1.51: dsh's web_search goes out as WebSearch, and a tool set refused for a name not listed yet goes once more renamed in full
@a1pha1nthefog on X (2026-11-19): dsh (DeepSeek Harness) on Factory's
claude-opus-5-5 is still refused (content_policy_rejected) on magpie
v0.1.4532, whose Factory mover installs 0.1.50. 0.1.50 renamed the six dsh
tools on our list, but dsh also declares web_search, and two real accounts
saw Factory refuse web_search, read_file and execute_command the same day,
and every listed name behind leading underscores (_read, _web_search), while
omp_read and WebSearch pass (can1357/oh-my-pi#19553, single-tool probes with
a passing system block). 0.1.50's dsh test passed because its fake Factory
refused only the names the plugin itself listed.
- tool-names.mjs lists web_search, read_file and execute_command (as
WebSearch, Read and Execute, droid's own names) and refuses a listed
name behind leading underscores (refusedName).
- Factory adds names without notice, so one more missing name would refuse
every request again. A 403 content_policy_rejected for a request that
declares tools now goes once more with every tool renamed (droid's
names and mcp__ tools kept): if Factory takes it, that tool set goes
renamed in full for the rest of the process (at most 256 sets kept); if
it refuses again, the refusal is about the content and is the answer, as
before. A request with no tools is never sent twice.
- The tests' fake Factory now refuses what real accounts were seen
refusing (SEEN_REFUSED), apart from the plugin's own list, and dsh's
first request must be taken on the first try.
Only name fields change, as in 0.1.50: descriptions, schemas, arguments and
dsh's prompt go as written, and replies carry the caller's names back.
Run (mote, at origin/main
|
||
|
|
bb849910ac |
factory 0.1.50: tools Factory refuses by name go out under droid's names, so dsh is not refused
@a1pha1nthefog on X (2026-11-19): dsh (DeepSeek Harness) through magpie on
Factory got "This request was blocked by Factory's usage policy check"
(content_policy_rejected) on its first turn, the user message "1". It reads
like dsh's prompt or skills are blocked, but they are not. Since 2026-11-18
Factory refuses any request that declares a tool under certain exact names,
on every route (#1291, #1306), and dsh 0.2.1 declares six of them: bash,
read, write, edit, glob and grep. It is the request's tool names, not the
account, the model, or dsh's prompt text.
This takes heggria's #1314 (closed unmerged) with credit: tool-names.mjs
declares such a tool under droid's own name for the job (Execute, Read,
Create, Edit, Glob, Grep, Task) or, when droid has none or the request
already declares that name, under its own name with a per-process suffix.
It renames earlier calls, tool_choice, allowed_tools and Gemini's function
names to match, and gives the caller its own names back in JSON and SSE
replies. Only name fields change: descriptions, schemas, arguments and the
prompt go as dsh wrote them. On top of #1314, agent, Shell and StrReplace,
which #1291 also saw refused on 11-18, are in the list, and
testdata/dsh-0.2.1-chat.json is dsh 0.2.1's real first request (captured
as it left dsh in a sandbox HOME, then sanitized), tested on chat
completions and on Messages.
Co-authored-by: heggria <34475327+heggria@users.noreply.github.com>
Run (mote, at
|
||
|
|
ec1c675f72 |
factory: a Gemini request opens with its model, as droid's does (0.1.49)
marovole on X, on 0.1.48 (magpie v0.1.4504, Droid BYOK, Factory API key
sign-in): three gemini-4-hydrogen requests came back 400 "Invalid model
ID in request body", each again on 2 or 3 retries, while the same setup
went through 83 times on hydrogen and 28 each on carbon and sonnet that
day. The failing bodies were 0.6 to 1.6 MB, long Droid sessions. 0.1.48's
per-conversation x-session-id did not change it.
What differs from droid, and grows with the body, is where the model
sits. droid 1.14.0 builds its Gemini request as {model, contents,
systemInstruction, tools, generationConfig} (testdata/droid-1.14.0-
gemini-body.txt, from the release binary). magpie's gateway marshals a
Gemini body from a Go map, so its keys come sorted: contents,
generationConfig, model, ... The plugin's geminiBody set m.model on that
object, which keeps the key where it was, after the contents; a body
from the AI SDK's Google package has no model, so it went last. Either
way the model came after the whole conversation. A route that
reads the model from the first part of a body would find droid's at
once and miss ours past some size, every retry alike, which is the
reported pattern.
geminiBody now writes the fields in droid's order (GEMINI_ORDER), the
model first, and any other field (toolConfig, safetySettings) after them
in its own order. Only the Gemini route changes; droid's Chat body puts
messages before model, so the other routes keep theirs.
Not proven: there is no Factory account here, so the 400 was not
reproduced against Factory, and Factory's server code is not readable.
The cause is the one byte-layout difference from droid that matches
"Gemini only, large only, every retry". The reporter is asked for the
raw lines to confirm.
Run (HOME a fresh folder; the focused runs on mote, the suite on the
Linux box, magpie-desktop, as mote and mica each had a full Go suite
running):
- bun test packages/factory/gemini.test.mjs size.test.mjs
session.test.mjs request.test.mjs: 86 pass, 0 fail.
- The new test on the old index.mjs: red (the body did not open with
{"model":"gemini-4-hydrogen","contents":), the other 5 Gemini tests
green.
- The root bun test (Bun 1.4.2): 9060 pass, 19 skip, 0 fail (9079
tests, 636 files); scripts/check.mjs ok.
|
||
|
|
63c2ff93f4 |
factory: each conversation is a Factory session of its own (0.1.48)
marovole on X: on Factory, Gemini 4 Argon, Hydrogen and Carbon answer
400 "Factory: Invalid model ID in request body" now and then. Success
and failure take turns within one conversation (Droid, v0.1.4404).
The plugin sent one x-session-id, a random UUID made when the plugin
loaded, on every request of its process. So every conversation, every
model and every subagent shared one Factory session. droid makes its
x-session-id per conversation (createProxyHeaders' sessionId in droid
1.14), and a subagent's Task gets a session of its own. Gemini is the
one route where droid locks the provider itself (getNextProvider with
lockedProvider "google"). A session that a Claude or GPT request opened
and that a Gemini request then joins is a state droid never sends.
x-session-id is now a v4 UUID hashed from the conversation magpie
names. A chat.headers hook is told the conversation (its session, else
the hash of its first message). If no hook runs (OpenCode 2), the
x-magpie-session or x-opencode-session header names it. Each subagent
(x-magpie-subagent) gets its own id. A request that names no
conversation keeps the process's id, as before. The header that carries
the conversation, x-magpie-factory-conversation, is taken off before the
request leaves.
Not proven: there is no Factory account here, so the refusal was not
reproduced against Factory itself. session.test.mjs reproduces it with a
fake Factory that holds a session to the provider it was opened with.
That is the hypothesis, not Factory's code. The feature flags droid's
registry puts on exactly these three models (Gemini4Argon/Hydrogen/
Carbon) are the other candidate. Nothing on magpie's side can change
those.
Run (mica, HOME=$(mktemp -d)):
- bun test packages/factory/session.test.mjs gemini.test.mjs: green.
- With session.test.mjs on the old index.mjs: all red. The fake answers
the Gemini conversation's requests 400 and the ids are shared.
- The root bun test and scripts/check.mjs: 9055 pass, 20 skip, 0 fail (9075 tests, 636 files); check.mjs ok.
Not changed: commandcode keeps one x-session-id for each process ("as
one CLI session has"); filed as plugins#1313. minimax already names
its session per conversation.
|
||
|
|
d24fd5d182 |
factory 0.1.47: add Gemini 4 Hydrogen (#1073)
Droid 1.10.0 adds gemini-4-hydrogen on Factory's Google route, behind its Gemini4Hydrogen flag: 1M context, 65536 output, low/medium/high, a 0.6x multiplier and no promotion. Without it a request to factory/gemini-4-hydrogen went to the Anthropic route and was refused. It sits after the first 24 like Carbon, so GLM-5.3-Flash stays in them (#119); grouped by company it sorts first among Gemini, by id as the others do. Checked: Droid 1.10.0 darwin/arm64 downloaded on mote, SHA-256 2b6b467e…6bf7f as the issue says. The testdata line is grepped from that binary, and matches the issue's text byte for byte. Run: bun test packages/factory on WSL with a temp HOME, 0 fail; bun scripts/check.mjs factory ok. Hydrogen is index 49 of 60. Broken by hand: Hydrogen at 0.5x turns 3 rate tests red. Not tried: a real request (no Factory account with the flag here). Reported-by: hitbear518 |
||
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
92c20ffef6 |
Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce), factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own code says the vendor refuses a spent refresh token. magpie then stops carrying these sign-ins to another computer through Sync, a backup or a Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh keeps the old token when the answer has none, and there is no evidence it rotates. Each package's patch version is bumped (cline 0.1.15, codearts 0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova 0.2.3, workbuddy 0.2.30). Each was checked against npm, or against origin/dist for the dist-only packages, before the merge. Fixes #884. Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME: bun test over the eight packages gave 1588 pass, 0 fail, and scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4, mote gave 1834 pass with Trae included. Not tried: a real refresh against each vendor. Co-authored-by: yetihan <yetihan@users.noreply.github.com> |
||
|
|
86d3febf9b |
factory 0.1.45: optional model ordering by company (#959)
An opt-in switch, "Group models by company", orders Factory's models by maker: Claude (Fable, Opus, Sonnet, Haiku), GPT, Gemini, Grok, GLM, Kimi, then the rest. Within a family, newer versions come first, and each Fast Mode model sits right after its base. Off, which is the default, keeps main's order byte for byte. Only a strict `true` from magpie's option turns it on. factory 0.1.45.
Run at the reviewed head fe96f7eb67b308a31ce33492fd3c5d5f19a4f5b1:
- On mote at 9b19aa76: bun test packages/factory 196 pass (main 194). Main's and this index.mjs were compared as JSON of the config hook and provider.models: off is identical to main for absent, {}, false, "true", 1, null, a throwing option and `option: 5`; on, there are 59 models, the same set, with no duplicates.
- On the Windows box at fe96f7eb (mote's sshd was refusing connections): bun test packages/factory 196 pass, bun scripts/check.mjs exit 0.
- Broken by hand at fe96f7eb: grouping always on turns both order.test.mjs tests red. Before the review's fix, it stayed green.
- npm has 0.1.44.
Not tried: in a real magpie window.
|
||
|
|
9001e6f082 |
factory: every droid promotion is checked inside its own window (#954)
The rate tests held one date, 2026-10-14, so a promotion starting after it was never compared with PROMOTIONS. Dropping gemini-4-carbon's line (#953, from 2026-11-10) left every test green. The new test checks each promotion droid's registry lists, inline or named, a minute after it starts, a minute before it ends and a minute after, against what configModels gives then. GPT-6 Astra's 60% off ended 2026-09-05, before PROMOTIONS was kept, and is skipped by a fixed LISTED_SINCE (2026-10-01); with no cutoff the test was red on it. 7 promotions are checked. Run on mote with a sandbox HOME: bun test packages/factory, 194 pass. Broken by hand: deleting Carbon's PROMOTIONS line turns the new test red (the old ones stay green); Argon at 0.4 turns it and two more red; the count bar at 99 shows 7 checked. Not run: the root suite (test-only change in one package; CI runs it). |
||
|
|
8ae971dedb |
factory 0.1.44: add Gemini 4 Carbon (#953)
Registers gemini-4-carbon on Factory's Google Gemini route, with the same shape as gemini-4-argon: 1M context, 65536 output, low/medium/high, a 1.6x multiplier and 50% off from 2026-11-10T16:00Z to 2026-12-01T08:00Z. Factory 0.1.44. Reviewed and run at fd9b634f41d7021715842f3db7bde28a9e8e6888: - Downloaded Droid 1.7.1 (darwin/arm64) on mote: SHA-256 761730017d94…7bd4, as the testdata says. The Carbon entry in the binary is byte for byte the testdata line, and it differs from Argon's only in id, name, the feature flag, the pricing note and the dates. - mote, sandbox HOME: `bun test packages/factory` 193 pass; `bun scripts/check.mjs factory` ok. PR CI (root suite under a temp HOME) green. - Broken by hand: Carbon at 1.5x turns 3 rate tests red. Carbon sits at index 48 of 59, after the Fast Mode block's rule; the first 24 are unchanged. - Not caught: dropping Carbon's promotion leaves every test green, since the promotion test reads only named promotion variables, not inline `promotions:[…]`. Argon has the same gap on main. Not tried: a real request. Carbon is behind Factory's Gemini4Carbon flag, unreleased in Droid 1.7.1. Co-authored-by: Mars-Sea <Mars-Sea@users.noreply.github.com> |
||
|
|
d8f8981d33 |
factory 0.1.43: droid 1.7.0 models (#927)
droid 1.7.0's new models in the Factory plugin: Fable 5.2, Kimi K3.1 Pro, MiniMax M3.1 Flash, Nemotron 3.5 Super, Inkling, Muse Spark 1.2, Beam 1.0, and GPT-6 Sol/Luna, GPT-5.6 Sol and GLM-5.2 Fast. Each is at droid's limits, efforts, images and token multiplier, with apiProviders[0] as the upstream. gpt-6-sol/gpt-6-luna at service_tier "priority" now go to their Fast Mode models. GLM-5.2 Fast is its own chat model and is not a tier of GLM-5.2. GPT-5.6 Sol Fast Mode gets Sol's 20% promotion until 2026-11-22. Muse Spark 1.2 is left out of CORE (no billingPool "core"). GPT-6.1 Terra, Muse Spark Open, GPT-6.1 Sol Ultra Fast and Muse Spark 1.3 are left out, each with a reason. The first 24 models are unchanged (#119). Review at 9524dcfc6e45b7c2c15245bd1e200d72aeebe17f: - droid 1.7.0 linux-x64 downloaded in WSL (magpie-desktop). SHA-256 4700746f52ec88e3758a18737be13bb74519276de97bc329054e8dae08f15f42 matches. All 24 excerpt lines of testdata/droid-1.7.0-models.txt are in the binary byte for byte (grep -F). The base entries gpt-6-sol (0.8), gpt-6-luna (0.04), gpt-5.6-sol (2) and glm-5.2 match the plugin's. - Each new row was checked against its entry: id, context/output, efforts (off dropped, or kept as none only for GLM-5.2 Fast), images, multiplier, upstream and wire. - First 24 ids are equal on main and the PR, and main's order is kept. CORE gains exactly kimi-k3.1-pro, minimax-m3.1-flash, nemotron-3.5-super, inkling, beam-1.0 and glm-5.2-fast. - In WSL, bun 1.4.2, HOME a temp dir: `bun test packages/factory` gave 193 pass, 0 fail. `bun scripts/check.mjs` passes. - Broken by hand. main's index.mjs with the new tests: 14 fail. Muse kept in CORE: 7 fail. The Sol Fast promotion removed: 2 fail. Fable 5.2 moved first: the first-24 test fails. Luna Fast at 0.04: 3 fail. Beam with images: 1 fails. Not tried: real requests to Factory. Kimi K3.1 Pro, Nemotron 3.5 Super, MiniMax M3.1 Flash, Beam 1.0, GLM-5.2 Fast and Fable 5.2 are behind statsig gates whose default is off in the binary. The author's account listed them, but other accounts may not, as with Gemini 4 Argon. Co-authored-by: garry569 <garry569@users.noreply.github.com> |
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
b83e3dee36 |
factory 0.1.41: ZCode's environment paragraph reaches Factory as runtime context, not refused (#211, William-AIdev)
ZCode embeds its generated environment paragraph, with unindented bullets, inside a larger system prompt. No runtime-context adapter matched it, so "You have been invoked in the following environment:" and "You are powered by the model named" reached Factory unchanged in the system prompt (403). This renames a complete standalone paragraph in system prompts, later system messages and Gemini's system instruction, keeping every value. Also releases factory 0.1.41, which carries #213. Reviewed at d4ef7d4e; the maintainer commits on top (eb016a4d) merge main |
||
|
|
b76a577567 |
factory: ZCode's restored-read reminder reaches Factory renamed, not refused (#213, William-AIdev)
Factory refuses the fixed "Called the Read tool with the following input:" opening. ZCode restores a pre-compaction read as one reminder carrying the arguments and the file's text, a shape no adapter matched, so it reached Factory unchanged (403). This renames that opening, as COMPACT_READ already does for Claude Code's arguments-only reminder, and adapts the file text as a read result. Reviewed at d2d81da0, merged onto main |
||
|
|
374b1fe186 |
factory 0.1.40: a usage policy refusal is a 400 with Factory's code, not a 403 (#494)
sweanng (yetone/magpie, Discord #general, 10-29): ZCode on Factory's GLM 5.3 got Factory's usage policy check refusing the conversation (403, code content_policy_rejected). The plugin handed it on as a 403 permission_error with code null, so magpie passed the 403 through and ZCode showed "Provider authentication failed" (reason=auth_failed status=403), as if the account were broken. The plugin now answers that refusal (only content_policy_rejected without an x-factory-upstream-error header, as droid 0.245.0 tells it) as a 400 invalid_request_error with code content_policy_rejected kept on the error, on both the Anthropic (/llm/a) and OpenAI (/llm/o) routes, with Factory's words and the "start a new session" advice as before. Every other 403 stays a 403 permission_error. magpie reads the code as a refusal of the request (yetone/magpie, same day). Run (on mote): HOME=$(mktemp -d) bun test packages/factory: 178 pass, 0 fail. bun scripts/check.mjs: ok. Broken by hand: with index.mjs back at main, content-policy.test.mjs fails 3 of 6 (both 403 shapes on /llm/a and the new /llm/o case). Not tried: a real Factory refusal; the refusal's body comes from doubl4door's and sweanng's reports, not a live capture. |
||
|
|
fada6e0b98 |
factory 0.1.39: DeepSeek V4.1 Flash 1017 goes to its registry default, Fireworks
Follows Wangzehong111's commit (from #480), with the review's change: the plugin sends x-provider-routing-source: registry_default on every request, and droid 0.251.0 sends that only with apiProviders[0]. 1017's apiProviders is ["fireworks","baseten","databricks"], so Baseten with registry_default is a header pair droid never sends. 1017 now goes to Fireworks like every other model's first upstream; the droid test checks both headers, the README says so, and the fixture header names the binary the bytes were checked against. Reported on Discord by sweanng: the model list had DeepSeek V4.1 Flash but no 1017. Checked: droid 0.251.0 (LATEST) darwin-arm64 from downloads.factory.ai, sha256 d3c0b87f..., has the 1017 entry byte for byte as in testdata, with the c(o,t) helper and I()'s registry_default rule. Closes #480. Co-authored-by: Wangzehong111 <112800852+Wangzehong111@users.noreply.github.com> |
||
|
|
36f2d757c3 |
factory 0.1.39: add DeepSeek V4.1 Flash 1017
Offer deepseek-v4.1-flash-1017 on chat completions with the limits, reasoning variants, attachments and 0.12x rate in Factory.app's Droid 0.251.0 registry. Keep the original Flash entry and its Fireworks route. Use Baseten: authenticated Factory routing checked on 2026-10-29 orders 1017 as [baseten, fireworks]. Live plugin requests succeeded on both backends with the distinct 1017 response model IDs. Baseten accepted none and high; the arithmetic high sample reported 104 reasoning tokens. Keep the raw registry entry and context helper in a versioned fixture, including the binary SHA-256. Check both OpenCode config and Magpie's provider.models hook, retain price checks for every model across the 0.241.1 and 0.251.0 fixtures, and include 1017 in Droid Core usage tests. Validation: 176 Factory tests pass; all 30 plugins pass check.mjs. Pack dry-run and an unpacked-package smoke test confirm all five runtime files are present and the model hooks and request loader load correctly. |
||
|
|
b04cca35c8 |
factory 0.1.38: Standard usage only, a plugin option that stops an account once a Standard window is used up (#349)
A new switch in magpie's plugin options, standard_only ("Standard usage
only"), off by default, read at each usage reading. When on,
limitWindows reports the Standard 5 hours / 7 days / 30 days windows
with no notModels and never aside (extra usage or not), so they count
every model, Droid Core's open models included. Droid Core's windows
become aside (shown only) and Extra usage stays aside. Off, the windows
are exactly as before.
magpie only leaves an account out before sending when it is held at a
usage cap (gateway perKeyBarred/capHeld; order routing tries a used-up
account and benches it only after Factory refuses). The README says to
pair the option with an account cap (magpie provider account-cap
factory <account> 99): then a held account is out before affinity, the
next account takes the same model, and with every account held magpie
answers 429 without sending.
Run at this commit, rebased on origin/main
|
||
|
|
bb020ce804 |
factory 0.1.37: a billing header joined with instructions loses only its own line, not the instructions after it (#302)
poer2023 (#302): anthropicBody() dropped every top-level system text
block, and a string system, that starts with
"x-anthropic-billing-header: cc_version=". When the header and the
instructions after it arrive joined in one block or one string (Claude
Code's auto-mode classifier policy, for one), the instructions went with
it and Factory got only the Droid identity.
Fix: only the header's first line goes. The rest of the text stays, and
the block keeps its other fields (cache_control and the rest); the rest
then goes through promptText like any other system block, so an identity
line after the header is still made Droid's. A block, or string, holding
only the header (or the header and blank lines) is still dropped.
Siblings: grep -rn "x-anthropic-billing-header" packages/ finds only one
other plugin that strips it, workbuddy (FLAGGED), which already removes
just the line with /x-anthropic-billing-header:[^\n]*\n?/gi and keeps the
rest (unflag.test.mjs covers "header\nhello" -> "hello"). kiro and
antigravity-cloak only carry it in fixtures or escape it. No other
plugin has the bug.
Test: request.test.mjs "a billing header joined with instructions loses
only its own line (#302)" takes the reporter's literal inputs (billing
"cc_version=2.1.300; cc_entrypoint=cli;" + "Preserve this task
instruction. SYSTEM_POLICY_SENTINEL"): joined block with cache_control,
joined string, separate blocks, billing only, billing plus blank lines,
on /v1/messages and /count_tokens, checks the exact system sent, that
messages and max_tokens are unchanged, and that a second pass of the
sent body is byte-for-byte; plus a header followed by Claude Code's
identity line.
Run:
- packages/factory: H=$(mktemp -d); HOME="$H" bun test (bun 1.4.2):
172 pass, 0 fail across 16 files.
- Broken by hand: with index.mjs at origin/main
|
||
|
|
4564e890b2 |
factory 0.1.36: a content_policy_rejected 403 says Factory's check reads the whole conversation, and isn't sent again
doubl4door (Discord, factory 0.1.34): Claude Code on Factory's Opus got 403 "This request was blocked by Factory's usage policy check" (code content_policy_rejected), and the plugin's hint pointed at the org's model policy and plan. droid 0.245.0 tells this refusal apart by that code, only when Factory sent no x-factory-upstream-error header, and says the check covers the whole conversation. contentRefused does the same: explain() says to start a new session or remove the quoted text, and mendOrg's whoami-and-resend is skipped, since the same conversation is refused again under any org. Other 403s are handled as before. Run (sandbox HOME): - HOME=$(mktemp -d) bun test packages/factory: 171 pass, 0 fail - bun scripts/check.mjs factory: ok; git diff --check clean - Broken by hand: without the mendOrg skip 2 of content-policy's 4 tests fail; without explain's branch 3 fail. Not tried against Factory's server (no Factory account here); the body shapes tested are code at the top level and under error. |
||
|
|
97aea1739a |
factory 0.1.35: escape client phrases Factory's proxy gate refuses, in every body (#258, RoacherM)
Factory's proxy gate refuses a request whose body carries certain client phrases (pi's opening and compaction sentence anywhere; Claude Code's identity, env line, billing header, compaction opening and GLOBAL_INSTRUCTIONS inside tool output). The phrases now live in client-phrases.json; sanitizeBody escapes each phrase's first character as \uXXXX in every request body (only re-stringified when something changed), and the Gemini path escapes them too. Version 0.1.35. Run at the reviewed head f0e78b4 (sandbox HOME): - HOME=$(mktemp -d) bun test packages/factory: 167 pass, 0 fail - bun scripts/check.mjs factory: ok; git diff --check clean - npm pack lists client-phrases.json - Broken by hand: without sanitizeBody 5 new tests fail; without the Gemini escapeDeep 1 fails. Not tried against Factory's server (no Factory account here); the author's real-account A/B is in the PR. |
||
|
|
cdf45137d6 |
factory 0.1.34: Claude Code's re-read instructions reminder reaches Factory after compaction (#243)
zygs1083-dotcom (#243): after compaction, a long Claude Code session went 403 Forbidden on all three Factory accounts. Claude Code renders its instructions attachment two ways (n_t in 2.1.292 to 2.1.303): - first copy: "Codebase and user instructions are shown below. …" - changed copy (changed: true, reason compaction and others): "Instruction files were re-read after the conversation was compacted; these differ from their earlier copies — each replaces its earlier copy, and the instructions preamble above still applies:" (or "These instruction files changed — …" without a reason) Both list "Contents of ~/.claude/CLAUDE.md (user's private global instructions for all projects):", the phrase Factory refuses (magpie#634). Only the first opening was matched, so the changed copy went out as it was. - INSTRUCTIONS_REMINDER matches both openings, requiring the changed copy's full sentence and the "Contents of " that follows it. The rename is limited to the reminder itself: text joined after its close (chat completions' joined user text) stays as written. String user turns on /llm/a get it too; before, only text blocks did. - quotedToolText encodes tool output that quotes the phrase (the reporter's session read Claude Code's renderer source and went 403 from then on), losslessly, as for the other phrases. - A 403 the plugin rebuilds keeps Factory's request id (x-request-id, request-id, x-amzn-requestid, cf-ray, or the body's request_id) and the error's code and type in the message, and request_id on the Anthropic body. Headers already went back as they came. The fixtures are the literal texts the 2.1.303 bundle's n_t/Mje/bMr build and id() wraps; 2.1.301 and 2.1.302 have the same strings, and the 2.1.292 darwin-arm64 npm package has the same sentence pieces. What was run at this commit: - bun test packages/factory/: 161 pass, 0 fail. - bun scripts/check.mjs factory: ok. git diff --check: clean. - Broken by hand: with the old startsWith-only opening, the 4 changed- wrapper tests fail; without the phrase in quotedToolText, the tool-result test fails too; with upstreamIds returning nothing, the 403 test fails. - Not tried: a real Factory request with the changed reminder (no live account was used), so that Factory accepts the renamed copy is inferred from the first copy's fix in 0.1.12, not seen. |
||
|
|
571790bc22 |
factory: reword update-config's refused sentence in the guide agent's system prompt too (#198)
Factory refuses one sentence in Claude Code's built-in update-config skill description. The plugin reworded it only when the entry was a whole line in the skill-list reminders, and only without a slash. claude-code-guide's own system prompt renders the entry as `- /update-config: …` under "# User's Current Configuration", so its first request was 403. This change matches the entry by name, with or without the slash. It rewords only "not Claude" to "not the assistant" inside that entry. The rewording now also runs on system prompt blocks (promptText) and at the existing call sites (bareSkills, announcedSkills, announcedContext, generatedContext, userBlockText). factory 0.1.32 -> 0.1.33. What was run at af6422e (reviewer): - bun test packages/factory: 153 pass, 0 fail. bun scripts/check.mjs factory: ok. git diff --check: clean. - Broken by hand: with promptText's configSkillText call removed, 2 of the new tests fail. - magpie plugin host (magpie main cb05dc2d1), with a copy whose API/WorkOS hosts point at a local fake: - API-key sign-in worked. - /v1/messages with a claude-code-guide-shaped system prompt went out with block 0 as the Droid identity and the update-config entry reworded. A user's "/custom: Keep not Claude" entry was left unchanged, and the stream came back 200. - No new hosts, telemetry or dependencies. |
||
|
|
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 |
||
|
|
4e64f2680c |
factory 0.1.31: an OpenAI model's request goes without temperature and top_p, not 400 (sweanng424, Nowledge Mem on gpt-6.1-sol, magpie's Discord)
OpenAI's reasoning models turn temperature and top_p away with a 400, and droid sends neither. droidBody now takes both out of a Responses request for a model whose upstream is openai, also when the body already opens with droid's line. configModels says temperature: false for those models, so OpenCode doesn't send it either. Grok and the chat-completions models keep theirs. Run: bun test in packages/factory, 144 pass. The new test fails on 0.1.30's index.mjs (temperature still in the body). Not tried against Factory's API with a real account. |
||
|
|
b8717aa860 |
factory 0.1.30: requests say droid 0.242.0, the current release (sky杨 on magpie's Discord: every model 403 "Factory: Forbidden" from Claude Code on 0.1.29)
sky杨, on magpie 0.1.1254 with this plugin at 0.1.29, got 403 "Factory: Forbidden" from Claude Code on every model, GPT, Claude and Gemini alike. Factory's body was a bare "Forbidden", not a phrase-specific refusal. Header diff against droid 0.242.0 (npm droid and @factory/cli-darwin-arm64 0.242.0, unpacked with --ignore-scripts into an empty directory and read with strings, never run). Its model requests carry: Authorization, X-Factory-Client: cli, X-Client-Version, X-Factory-Org-Id, User-Agent factory-cli/<ver>, x-session-id, x-assistant-message-id, x-api-provider, x-provider-routing-source (registry_default without a routing claim), OpenAI-Platform: org-bHuLtG1fGmYk5YaOihAAXFBw for openai/azure_openai, and X-Api-Key "placeholder" from its Anthropic client. The plugin sends each of these with the same value, apart from the release: 0.233.0, nine releases behind. The WorkOS client id is unchanged. droid's binary still reads a server-side min_cli_version flag and runs a forced auto-update. 0.1.16 was the same case (JL: every model 403 "Forbidden" from pi and Claude Code while droid worked; the plugin said 0.231.0, two behind), and JL's later reports (0.1.25) were about models, not refusals. Whether Factory refuses an old release with a 403 is still not confirmed: there is no Factory account to try with. This is the one header difference found. Run: bun test in packages/factory, 143 pass. With VERSION put back to 0.233.0, droid.test.mjs goes red (Expected "0.242.0", Received "0.233.0"). bun scripts/check.mjs factory: ok. Not tried against Factory itself. Full suite: bun test (packages/factory) 143 pass |
||
|
|
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.
|
||
|
|
95af6cf375 |
factory 0.1.28: the Fast Mode models are listed last, so a provider with nothing picked shows GPT-5.3-Codex, Grok and GLM again (#119, psylch)
magpie shows a provider with no models picked only the first 24 of its
list. 0.1.27 placed each Fast Mode model beside its base model, which
pushed GPT-5.3-Codex, Grok 4.7, Grok 4.6, GLM-5.3 and GLM-5.3-Flash past
24 ("not exposed"). The six Fast Mode models now come after every other
model, so the first 24 are 0.1.26's again. Asking a base model for fast
still reaches its Fast Mode model (fastBody), and a Fast Mode model can
be picked by name.
Run: bun test packages/factory (138 pass), bun scripts/check.mjs (all
plugins pass). The new fast.test.mjs case fails on 0.1.27's order (put
back by hand: 3 pass, 1 fail) and passes with this one.
Not tried: a real Factory account; magpie's exposure was not run against
the published package, only the list order checked.
|
||
|
|
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. |
||
|
|
e7d37b0801 | factory 0.1.26: Gemini 4 Argon and Gemini 3.x on Factory's Gemini route (yetone/magpie#2080), a 413 retried with older images left out and said as Factory's byte limit (yetone/magpie#2082) | ||
|
|
1bd6d172c1 |
factory: a 413 is asked once more with older images left out, then said as Factory's byte limit (yetone/magpie#2082)
Ziqi-Cui's Codex session on Opus 5.5 gathered nine screenshots, ~4.5 MB of data URLs, and Factory answered every request after with 413 "Request Entity Too Large". The plugin passed the 413 on as it came, which reads as the context window; it is Factory's limit on a body's bytes. On a 413 from Factory the plugin now sends the request once more with every image and file but the newest replaced, in place, by a line saying it was left out (droid 0.239.0 removes older images/PDFs from large requests the same way). Anthropic image/document blocks, Responses input_image/input_file, chat image_url/file and Gemini inlineData/fileData are found wherever they are, tool results included, so every tool call keeps its result; a Gemini function response's parts, which take inline data alone, drop the image instead. One retry, never more; none when there is nothing older to leave out. If the 413 stands, or nothing could be left out, the error (Anthropic's request_too_large, else invalid_request_error) gives Factory's words, says the limit is on the body's bytes and what was left out, and carries magpie's gateway 413 hint word for word (compact, or start a new session), so the gateway, finding it, doesn't add it twice and OpenCode users get it too. The words avoid what the gateway reads as a context overflow, so it stays a 413. The caller's own session and files are untouched: only the body sent to Factory changes, and only on the retry. Run: bun test in packages/factory (134 pass), bun scripts/check.mjs. Broken by hand: without the 413 branch, three of size.test.mjs's four tests fail. Not tried: a real Factory account (none here) or Factory's real limit, which neither droid's binary nor its changelog states; the fake upstream refuses over a chosen size. |
||
|
|
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. |
||
|
|
86b4760f55 |
factory 0.1.24: a session continued after Claude Code compaction reaches Factory (#66)
* factory 0.1.23: a resumed turn's restored skills reach Factory wherever they sit
#68 took 0.1.22, so this moves to 0.1.23.
Claude Code 2.1.292 session 1a2063e5 is the turn Factory answered 403.
Its transcript renders the post-compaction attachments, in order, as system
reminders: a token marker, a restored Read and its result, an omitted-file
note, the invoked-skills reminder, the agent-type list, MCP server
instructions, the environment paragraph and the model line. No token marker
follows the skills reminder. The snapshot's contextRendering is "announced",
so the same paragraphs also travel unwrapped in one system turn. The request
bytes were not in the routing log; the fixture is those rendered paragraphs,
unwrapped, in that order.
announcedContext used to reassemble the reminder only when a token marker
came right after it, and then treated everything up to that marker as skill
text. A reminder at the end of the turn, or followed by a Read, the
environment or a hook, kept the refused opening. A reminder with other
attachments and a later token swallowed those attachments into the skill
encoding.
The refused part is the fixed opening plus the complete IMPORTANT paragraph.
That complete reminder is rephrased wherever it sits. Skill text now ends at
the next paragraph the adapter already knows (token marker, hook, restored
Read, omitted-file note, Read result, environment, model line, skill-list
header, changed-file note, agent-type list, MCP instructions) or at the end
of the turn. Those following paragraphs stay themselves and are adapted on
their own. A second pass is byte-for-byte. Quoted fragments, an incomplete
IMPORTANT paragraph, a hook that owns the reminder and assistant content stay
untouched.
0.1.22 was not tried against Factory: the installed copy stayed 0.1.21, and
this change was not sent to Factory either.
Run: HOME set to an empty temp dir, bun test packages/factory: 120 pass,
0 fail. node --check packages/factory/index.mjs, bun scripts/check.mjs
factory, and git diff --check are clean. The new test covers the captured
order plus a reminder at the end of the turn, a reminder followed by Read,
environment and a hook, and a quoted skill body. Fetch is stubbed.
* factory 0.1.23: restored skills open a resumed turn without token metadata
A resumed turn can start with the complete invoked-skills reminder when no
files were restored and totalTokensReminder is off. restoredContext now
recognizes its exact opening and IMPORTANT paragraph through the existing
invokedSkillsMatch and attachment boundaries. A restored-file opening can
also use the complete skills reminder as evidence when it ends the turn.
Adapted openings, incomplete reminders, quotations and hook-owned output
retain their existing behavior.
Cover no-token system turns and folded user text on inference and token
counting, including standalone reminders, trailing tokens, omitted-file and
Read prefixes, exact skill decoding, cache metadata and byte-for-byte second
passes. Each of the six boundaries missing independent regression coverage
now follows a quoted skill directly. README documents the no-token forms.
Run with HOME set to an empty temporary directory: bun test packages/factory,
121 pass, 0 fail. node --check packages/factory/index.mjs,
bun scripts/check.mjs factory and git diff --check pass.
Removing each of the omitted-note, Read-result, model, skill-list, MCP and
changed-file boundaries makes the new independent regression test fail.
The whole-project test suite is left to CI. Fetch is stubbed; no request was
sent to a real Factory account.
* factory 0.1.24: main already published 0.1.23 (#71), so this change takes the next version
#71 shipped factory 0.1.23 while this PR waited, so npm has 0.1.23. This
only moves the version, so the squash publishes as 0.1.24.
Run: merged onto main
|
||
|
|
07897c8c58 |
factory 0.1.23: a streamed Claude Code request with context management is no longer refused (#71, Vigilans)
Claude Code with the context-management beta sends context_management (here clear_thinking_20251015, keep all). Factory's streaming route answers it with 400 "context_management: Extra inputs are not permitted"; the same body with stream false, or without the field, gets 200 (the reporter's three cases). A streamed /messages request now goes without the field; an unstreamed one keeps it. The server then clears nothing, and Claude Code's own compaction still runs. The version bump also releases the previous commit's #72 fix. Run: HOME=<tmp> bun test in packages/factory, 119 pass (1 new from the reporter's body; the existing all-fields test now expects the field gone on its streamed request). With the deletion disabled by hand both go red. Not sent to Factory: no Factory account here. |
||
|
|
9d4bc83400 |
factory: a skill list Claude Code sends alone as a system message is no longer refused over update-config's "not Claude" (#72, Vigilans)
Claude Code also sends the skill list as a standalone system message with only its entries: no header, no <system-reminder> wrapper, no <total_tokens> tail, as text blocks and (later in the same session) as a plain string. The adapter only knew the headed and token-terminated forms, so the update-config line went through unchanged and Factory answered 403; the reporter got 200 with only "not Claude" -> "not the assistant". bareSkills applies that same known-line change to a system message that opens with a "- " entry, both content shapes. User messages, quoted lists and other skills' lines are left alone. Run: HOME=<tmp> bun test in packages/factory, 118 pass (2 new, the reporter's body byte for byte as fixture). With bareSkills made a no-op by hand the new test goes red. Not sent to Factory: no Factory account here. |
||
|
|
0437abbe30 |
factory 0.1.22: Claude Code's restored-context turn after /compact reaches Factory adapted (#68, Vigilans)
After /compact, Claude Code 2.1.280 sends the files it restores and the
session's runtime context as one system text block with no reminder
wrappers and no opening token marker: restored-file notes ("Note: <path> was
read before the last conversation was summarized…"), "Called the Read tool
with the following input: {…}" and its result, "# Environment\nYou have been
invoked in the following environment:", the model line, token and date.
The reporter's bisect shows Factory 403s on each of those fixed fragments,
and 0.1.21 matched none of them: SYSTEM_ENV_CONTEXT is anchored at the
block's start, COMPACT_READ / COMPACT_FILE need a standalone wrapped
reminder, and the token-prefixed bundle path needs a leading token marker.
restoredContext recognizes the complete turn: its first paragraph is a
generated restored-file note or Read call (as COMPACT_FILE / COMPACT_READ
would match it wrapped), and a later paragraph, before any hook output, is
the generated environment paragraph or a token marker. Then
announcedContext adapts every paragraph from the first on, with the
existing compat spellings (Previously read file…, # Runtime context / The
session environment is:, Current model name / Model ID / Model knowledge
cutoff) and the lossless JSON encoding of Read results; everything else
stays byte-for-byte. It runs for system-role strings and text blocks and
for the same block folded into user text. An adapted turn no longer opens
with the generated note, so a second pass is byte-for-byte.
Quoted, incomplete (no environment or token), hook-owned and assistant
forms are left untouched.
Run: bun test (packages/factory: 116 pass; repo: 1010 pass, 0 fail),
bun scripts/check.mjs (all pass). The two new tests use the issue's literal
fragments (several notes, Read call + result, environment, model line with
claude-opus-5-5[1m], token, date); the adapting one fails on 0.1.21's
index.mjs, and removing the env/token requirement, the hook guard, the
user-text path or starting at paragraph 1 each turns a test red. PR #66
applied on top passes too (119 factory tests). Stubbed fetch only; no
request was sent to Factory (no Factory account here).
|
||
|
|
f4c0d96c9c |
factory 0.1.21: pi's compaction summary reaches Factory without its fixed opening sentence (yetone/magpie#1316, Eriice)
After pi compacted a session, every turn on factory/claude-opus-5-5 was 403
"Factory: Forbidden". The reporter's replays through magpie found the
refused part: the sentence pi opens its summary message with,
"The conversation history before this point was compacted into the
following summary:" (pi-coding-agent dist/core/messages.js
COMPACTION_SUMMARY_PREFIX, the same in 1.0.4 and 1.1.0), whole; with it
removed, reworded or halved the request was answered.
A user text that is pi's whole summary message (the sentence, a blank line,
<summary>, and </summary> last) now opens "Earlier conversation context is
summarized below:", the summary itself unchanged. pi's other fixed summary
opening, BRANCH_SUMMARY_PREFIX ("The following is a summary of a branch
that this conversation came back from:"), is reworded the same way; that
Factory refuses it is not confirmed. On Messages (string content and text
blocks), chat completions and Responses user messages alike. The sentence
quoted by a user, without pi's summary around it, or in an assistant turn
goes on as it is.
pi.test.mjs: 3 new tests; the two adaptation tests fail on 0.1.20
(Expected/Received differ on the summary text), the third checks what is
left alone. bun test (114 pass) and bun scripts/check.mjs factory pass.
Not tried against Factory itself (no Factory account here).
|
||
|
|
ce9755092b |
fix(factory): quote repeated summaries and changed-file context (#42)
* fix(factory): 无损适配摘要引用和文件变更通知 * fix(factory): 保留 hook 后元数据适配并补齐编码边界 |
||
|
|
3a9533aacb |
fix(factory): adapt Claude Code compaction and runtime metadata (#37)
* fix(factory): adapt Claude Code compaction and runtime metadata * fix(factory): adapt standalone skill updates with trailing token context * fix(factory): adapt runtime context after subagent startup hooks * fix(factory): adapt skill paragraphs after runtime notifications * fix(factory): encode compaction quotes in tool results for 0.1.19 * fix(factory): cover provenance summaries and restored Read content |
||
|
|
4d6dcca173 | factory 0.1.18: pi's opening sentence reaches Factory as its first half (yetone/magpie#952, mxzs123) — pi 1.0.4 got 403 "Factory: Forbidden" on DeepSeek (chat completions) and Claude (Messages) for "hi"; the reporter's replays through magpie found the refused part: "You are an expert coding assistant operating inside pi, a coding agent harness." whole (either half passes, and pi's full request with it cut to "You are an expert coding assistant." is answered on both routes). That sentence, at the start of a line of a system or developer prompt (chat completions' messages, Responses' instructions and input, Messages' system blocks and system messages), is cut so; the rest of pi's prompt, its tools and a user quoting the sentence go on as they are. pi.test.mjs is new (pi's two captured shapes; 3 of its 4 fail on 0.1.17, the 4th checks what is left alone); bun test (85 pass) and check.mjs factory pass. Not tried against Factory itself (no Factory account here). | ||
|
|
5d2621db88 | factory 0.1.17: DeepSeek V4.1 Flash, Kimi K3 and GLM-5.2 offer none, so a request turning reasoning off stops their thinking (yetone/magpie#899, tedestar) — they offered only low/high/max (GLM-5.2 high/max), so magpie asked for low and they thought anyway. droid 0.231.0 lists off for them and sends reasoning_effort "none"; Fireworks (via OpenRouter, pinned) answered none with 0 reasoning tokens on DeepSeek V4.1 Flash (2 completion tokens, 19 at default) and Kimi K3 (8, 71 at default), and turns none away on GLM-5.3 and GLM-5.3-Flash ("Reasoning is mandatory"), whose least stays low. effort.test.mjs is new (the levels fail on 0.1.16); bun test and check.mjs pass. | ||
|
|
9fefe75f15 | factory 0.1.16: requests say droid 0.233.0, the current release (Discord, JL on magpie 0.1.824 with plugin 0.1.15: every model 403 "Factory: Forbidden" from pi and Claude Code, while droid itself works) — droid 0.233.0's model requests carry the same headers, paths and body shape as 0.231.0's apart from its version (X-Client-Version, User-Agent factory-cli/<ver>), and its binary reads a server-side min_cli_version; the plugin said 0.231.0, two releases behind. Whether Factory refuses an old version with a 403 is not confirmed (no Factory account to try with); this is the one difference found. bun test (79 pass) and bun scripts/check.mjs factory pass. | ||
|
|
4a368481b0 |
factory 0.1.15: GPT-6.1 Sol, in droid 0.233.0's picker, reaches Factory through magpie (#15)
MODELS predated GPT-6.1 Sol, so a droid account whose policy allows the model could not reach it through the plugin. droid's built-in picker, read by giving "droid exec -m" an id it rejects (it prints the whole list), names it gpt-6.1-sol — droid spells the minor with a dot, as it does gpt-5.6-sol, not the gpt-6-1-sol other providers' plugins carry. It goes on RESPONSES with openai as its vendor, 1050000 context and 128000 output like the rest of the GPT-6 family, images on. Factory's docs list low, medium, high, xhigh and max for it and no none (gpt-6-sol and gpt-6-luna have one), so it takes E5 rather than E6. The same docs were read against the other 30 entries: their efforts are correct. The picker also offers 19 models this list lacks: Claude Opus 4.5, 4.6 and 4.7, Claude Sonnet 4.5, GPT-5.2, GPT-5.4 Mini, GPT-5.5 Pro, Grok 4.5, DeepSeek V4 Pro, the DeepSeek V4 Flash 0731 snapshot, Inkling, and nine -fast variants. The superseded ones were left out, and the rest carry no context or output figure from Factory, from the picker or from the other plugins here — writing a guessed limit would mislead. The list stays what droid offers, not what one organization's policy allows: of the entries already here, 21 are blocked by the account this was checked on. Tests: bun test (458 pass) and bun scripts/check.mjs factory pass. The id was confirmed against droid 0.233.0's picker and passes that account's policy and effort validation; no inference request was sent. |
||
|
|
16ec1b8ba9 |
factory 0.1.14: Claude Code 2.1.288's runtime context sent as a system message of text blocks is adapted as the string one is (yetone/magpie#658)
anthropicBody adapted a role:"system" message only when its content was a
string, so Claude Code 2.1.288's context as [{type:"text",...}] reached
Factory unadapted and was refused (403). Each text block of such a message now
goes through systemContext, its other fields and non-text blocks kept; a user
text block opening with the generated environment context (a system message
folded into the user's turn) is adapted too. The top-level system already
treats a string and an array alike, and the OpenAI route adapts no context.
Tests: the #658 shape (fails on 0.1.13), string/array parity, idempotence;
two tests that asserted array content was left alone now use text outside the
generated shape. Not tried with a live Factory account.
|
||
|
|
b541aaa766 | factory 0.1.13: tools whose schema is a root anyOf/oneOf/allOf reach Factory's Claude models, nested under one argument and unwrapped on the way back (#12, yetone/magpie#646) | ||
|
|
7a504148cf |
fix(factory): 保留联合工具 schema 的参数约束 (#12)
Factory 的 Anthropic 接口拒绝顶层联合工具 schema,导致 Codex 请求返回 400。 通过内部参数包装、响应解包及历史转换兼容该接口,保留分支约束、引用作用域和参数精度。 新增 21 项回归测试,覆盖流式分片、多轮调用、异常、并发和精度。 全库 420 项测试通过,并以 Factory Opus 5.5 验证三种联合 schema、流式调用及第二轮对话。 |