The loader's fetch answered every path but /chat/completions with
404 "only chat completions are served", so doubao-seedream-5-lite,
qwen-image-3.0-pro and Hy-Image-3.5-preview, which /api/v1/models lists
with output_modalities ["image"] and magpie offers in its image picker,
could not draw (lakegan measured 404 with no ep in usage.jsonl).
A request to .../images/generations now goes to
{modelBase}/images/generations with the session in token and
Authorization, Content-Type application/json;charset=utf-8 and
Accept: application/json (not text/event-stream), the body as magpie
wrote it, and the upstream's JSON comes back as it is. 401/403 say the
sign-in has lapsed (401), as the chat path does; another error keeps its
status with the upstream's text. The chat path is unchanged.
/images/edits is not served: magpie's gateway sends a plugin's edit as
multipart (internal/gateway/draw.go drawImages), and what Loomy's gateway
takes for an edit hasn't been measured. It still answers 404, now
"only chat completions and image generations are served".
The fake gateway answers /api/v1/images/generations with the reporter's
literal 200 body. Tests: a draw is sent with the session and JSON accept
and passes the body and reply through, a Request object's body too,
401/403 become 401, a 400 keeps its status, chat streams after a draw,
and embeddings and /images/edits still 404.
Run (mote, at this tree on 8db0a05):
- packages/loomy: bun test, 28 pass 0 fail.
- whole repo: HOME=$(mktemp -d) bun test, 4555 pass 9 skip 0 fail
(352 files); bun scripts/check.mjs loomy ok.
Broken by hand, each red on mote, then restored:
- draw route off (old guard): the 5 new image tests red.
- Accept: text/event-stream on the draw: the forward test red.
- draw's 401/403 mapping removed: the 401 test red.
Not tried: a real Loomy account (none here); the reporter's measured
call is the evidence the route works. Not done: #563 (an update-safe
local patch) is separate.
27 lines
650 B
JSON
27 lines
650 B
JSON
{
|
|
"name": "@magpie-community/opencode-loomy-auth",
|
|
"version": "0.1.2",
|
|
"description": "OpenCode & Magpie provider plugin for Loomy (讯飞, loomyad.xunfei.cn): SMS sign-in, chat, models, the two point wallets and the daily first-login grant",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"exports": "./index.mjs",
|
|
"files": [
|
|
"index.mjs",
|
|
"README.md"
|
|
],
|
|
"keywords": [
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"magpie",
|
|
"loomy",
|
|
"xunfei",
|
|
"讯飞"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/loomy"
|
|
}
|
|
}
|