zzzkl3994 on Discord: a video made through the magpie-image MCP was in
Usage → Requests but never on Routing → Requests. The MCP's requests do
go through the gateway, but `images`, `videosCreate` and `retrieve`
(embeddings, rerank, audio transcriptions) wrote their usage row and
began no route, so the routing trace never had them. Only the chat
path, the Codex backend, titles and System One began routes.
Each now begins one route (media_route.go, sideRoute) with the caller's
agent and session, the model as asked, the provider and the routing
group. Each key, account or group member asked is a try, put in Order
so the page finds its seat. The route ends with the status, error and
tokens, and the usage row names it in RouteID. Route.Usage is for
display and is not a second ledger row, so nothing is counted twice.
An image's accounts are tried in drawOnAccounts, which gets the route
through the request's context. A video's polls and its download are the
same generation; they add no route, as they add no usage row. A video
turned away before any vendor was asked ends its route as failed.
Route.Kind stays empty.
Run:
- New tests (media_route_test.go): TestImageIsOnRouting,
TestFailedImageIsOnRouting, TestVideoIsOnRoutingOnce (create, three
polls and the download give one route and one usage row),
TestRefusedVideoIsOnRouting and TestEmbeddingAndRerankAreOnRouting.
All are red at 5d24bc6cc without the fix ("Routing lists 0 routes")
and green with it (wsl-run). Their neighbours pass too:
TestVideoIsStartedPolledAndFetched, TestImageGroupMovesOnToTheNextMember,
TestCallerUsageVideos and TestEmbeddingsGoToTheModelsProvider.
- Broken by hand. With RouteID dropped from the image's usage row, both
image tests go red ("isn't the one the usage row names (0)"). With
sideRoute.end always writing status 200, TestRefusedVideoIsOnRouting
goes red.
- Full suite at 5d24bc6cc plus this change (wsl-run, `go test -tags
nogui ./... -timeout 45m -count=1`): 77 packages ok. internal/agent
has 4 reds (TestInstalledVersion, TestGrokInstalled,
TestCopilotFolderFromAnIDEPluginIsNotTheCLI and
TestOmpDetectedWithPiDir), all already filed for the WSL box at main
in #4033.
- GOOS=windows and GOOS=linux `go vet ./internal/gateway` (mote): ok.
- Rebased on 4d9058a98, then on 95b40fb2f (redact and library only).
internal/gateway and internal/imagemcp at the 4d9058a98
head (mote-run) are still running when this is pushed.
Not tried:
- A real generate_video through the MCP in the GUI. The Routing page's
GUI suite wasn't run, as no GUI file changed; the route has the shape
the page already reads (Order, Tries, Kind "").