Files
magpie/internal
yetone ab546a4eea draw: SenseNova's sensenova-u1.5-lite is an image model, and draws on its images API
lileo0668 (Discord, #help) added SenseNova's API (token.sensenova.cn/v1)
as a provider. sensenova-u1.5-lite showed in its model list but not in
Settings' image generation picker, so magpie's generate_image couldn't
use it.

SenseTime's launch post for U1.5 Lite on the Token Plan says it is an
image model only (no chat), served at /v1/images/generations and
/v1/images/edits in OpenAI's shape; an edit is JSON with
"images": [{"image_url": "<https URL or data URL>"}], and
response_format is url (a 24h link) or b64_json.

- catalog.DrawsID and ImagesAPI know "sensenova-u1" (u1.5-lite,
  u1.5-fast), so the model a vendor's /models lists is a drawer, listed
  in the picker and asked on the images API, not chat.
- drawImages, for those models only: ask for b64_json, and send an edit
  as JSON with the images as [{"image_url": data URL}], the shape
  ChatGPT's backend takes, instead of the multipart form other OpenAI
  images APIs get. No other vendor's request changes.

Test: TestSenseNovaU1Draws (internal/gateway) fetches a fake SenseNova
/models (a chat and the U1 model), checks Drawers lists the U1 model
alone, draws it (images API, b64 back, chat never asked) and edits it
(JSON images). Broken by hand: without "sensenova-u1" in DrawsID it is
red (drawers []); with senseNovaDrawer returning false it is red (the
fake answers a link, image ""), and the edit would go multipart.

Run at this head: gofmt -l (clean), go vet ./..., GOOS=linux go vet
-tags nogui ./..., GOOS=windows go vet ./..., go build, GOOS=linux go
build -tags nogui, GOOS=windows go build, and
go test -tags nogui -timeout 45m ./internal/catalog ./internal/gateway
./internal/provider ./internal/imagemcp ./internal/gui: catalog, gateway
(566s), imagemcp and gui ok; provider crashes in
TestUnreadLoginsWriteErrorsKeepCredentials (synctest channel closed
from outside its bubble in filememo.Forget), which is #3632, open and
red on main since 091153bf, and not touched here. After the rebase onto
origin/main 8b0132b3d: gofmt, vet (three OSes) and the catalog tests
plus TestSenseNovaU1Draws and the draw tests (-run 'Draw|Image|Edit')
again.

Not tried: a real SenseNova key (none here); its exact /models bytes and
the full answer JSON are from its docs, not a capture. Not run: the full
./... suite (load ~90) and the GUI Playwright suite (no GUI asset
changed). A mask on an edit is passed as in Codex's shape; SenseNova's
docs don't name a mask.

Reported by lileo0668 (Discord).
2026-10-27 16:01:10 +08:00
..
…
…
…