changqiu4890 on Discord: the group smart-split has three Codex CPA chat
models, DeepSeek-V4.1-Flash and Codex CPA's gpt-image-2.5, and dsh,
Codex and Pi are set to it. Image requests went to other providers'
image models.
Two causes in magpie:
- drawingTries tried every member of a group named for a drawing in the
order chat routing plans them, so the chat members came first.
group/smart-split drew on cpa/gpt-6-astra, which was asked as a chat
for an image, before it reached the group's image member. A group
with members that make the kind (drawsModel, or servesKind for
video) is now tried on those members alone. The fallback between
them stays as it was.
- Codex's image tool drew on the provider that served the turn, else
on Settings' pick. A group's image member was never used: a turn on
DeepSeek, or on the relay, drew with Settings' model or with the
relay's other GPT Image. codexDrawingProvider now also returns the
routing group the turn asked for. When that group draws (GroupDraws),
the drawing goes to its image member through resolveDrawing, which
keeps the member's provider.
The reporter's Routing screenshot also shows explicit requests from a
client magpie names "Mozilla": x0-15/gpt-image-2.5, codex/gpt-image-2.5,
and bare gpt-image-1 and gpt-image-1.5. magpie routes a request that
names a provider to that provider, and a bare id to the first provider
whose Drawers list it. Nothing in such a request links it to the agent's
group, so this commit leaves those requests alone.
Tests:
- TestMixedGroupDrawsOnItsImageMemberOnly (new): the reporter's group
shape on fake upstreams, with another relay listing gpt-image-2.5
first. Red before the fix (drew on cpa/gpt-6-astra), green after.
- TestCodexDrawingTakesItsGroupsImageMember (new): red with the group
branch turned off by hand (drew on chat/gpt-image-2), green with it.
- TestMixedGroupMakesVideoOnItsVideoMemberOnly (new): a guard for the
video sibling. It passes with the filter turned off as well, because
video's mediaMembers already keeps only video members (KindGroup).
Run on mote (mote-run) at this tree:
- gofmt -l
- go vet ./internal/gateway on darwin, GOOS=linux -tags nogui and
GOOS=windows
- go test -count=1 -run 'Group|Draw|Image|Video|Media' ./internal/gateway
- go test -count=1 -timeout 45m ./internal/gateway ./internal/provider
Not tried:
- a real Codex CPA relay or a real dsh session
- the image MCP's default for a non-Codex agent set to a group: the MCP
call carries no link to the agent's chat route, so it still uses
Settings' pick
- chat routing to a group's image member when the member's provider has
no picks: the member's provider is still the pinned one, and this
commit doesn't change it