Commit Graph
1 Commits
Author SHA1 Message Date
yetone d29f02d650 agent: omp's image role lists magpie's image models (treeman_26897)
treeman_26897 on Discord: omp's ROLES -> IMAGE offered none of magpie's
image models. omp's image role takes a model of kind image alone
(pi-coding-agent model-roles.ts), and every model magpie wrote to
~/.omp/agent/models.yml was a chat model.

magpie's image models (gateway.ImageModels: Settings > Images, as Pi's
extension and the magpie-image MCP have them) now go into magpie's
provider as kind: image on api openai-images. omp's generate_image
posts those to baseUrl + /images/generations (or /images/edits), the
gateway's /v1/images (pi-ai images/openai-images.ts). Only for omp
18.7.0 and later, the first whose models.yml takes kind and a runner
api; 18.6.3's schema turns the whole file away over openai-images, and
an omp whose version isn't known gets none, as ompTakesMax. An image id
a chat model already has is left out.

With an image model listed, the provider carries the gateway's key
(apiKey: magpie) instead of auth: none: generate_image skips a keyless
provider's model as "credentials unavailable" (isAuthenticated turns
kNoAuth away), while chat goes without one. Without an image model the
entry is as before.

Run at this head (rebased on f3551387c), on mote:
- go test ./internal/agent ./internal/library ./internal/sessions: ok
- go test ./internal/gui -run 'Omp|omp|AgentConnect': ok
- go test ./internal/cli: TestEveryRouteHasACommandOrIsNamed red on
  /api/usage/checkin-account, the same on f3551387c, filed as #4826
  (from e87140242); nothing else red
- go vet ./internal/agent for darwin, linux, windows; gofmt -l: clean
Broken by hand: without the line adding the image models,
TestOmpListsImageModelsForItsImageRole is red; with it, green.
Real omp 18.15.0 in a sandbox HOME on mote (Bun 1.4.4 in the sandbox),
against a stand-in gateway: `omp models magpie --kind image` lists
art/gpt-image-2 (not among chat). `omp -p` with the image role on it:
under auth: none the tool said "credentials unavailable"; with apiKey
magpie it posted {"model":"art/gpt-image-2","prompt":"a red square.",
"n":1} to /v1/images/generations and saved the PNG.

Not tried: a real magpie gateway drawing with a real image provider
through omp; omp 18.7 to 18.14 as binaries (source read only); omp's TUI
Roles picker itself (its pool is the same registry --kind lists);
/images/edits; an image model whose id is also a chat model (left out);
a WSL omp (it already had a key).
2026-11-02 21:33:06 +08:00