Files
plugins/packages/factory/package.json
T
yetone 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.
2026-10-29 17:51:44 +08:00

12 lines
522 B
JSON

{
"name": "@magpie-community/opencode-factory-auth",
"version": "0.1.40",
"description": "Sign in to a Factory (Droid) subscription from OpenCode or magpie",
"type": "module",
"main": "./index.mjs",
"files": ["index.mjs", "anthropic-tools.mjs", "client-phrases.json", "README.md"],
"keywords": ["opencode", "opencode-plugin", "magpie", "factory", "droid"],
"license": "MIT",
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/factory" }
}