Files
magpie/docs
yetone 24fab123bb provider, gateway: a Remote magpie's model it offers Fast on can be picked fast
littlekk88 on Discord (#feedback): Claude Code on one computer, wired to
its magpie, which has another magpie as a Remote magpie. The remote's
/v1/models listed service_tiers [{id:"priority",name:"Fast"}] on
gateway/cursor/grok-4.6 (#1234), but the local picker showed no bolt on
it, SetFastPick refused it, and tier_sent was empty on both computers.

Two causes, both on the local magpie:
- provider.CanFast had no case for a Remote magpie, so it was false for
  every remote model. It now reads the tiers the remote's list gives the
  model (new provider.RemoteTiers) and is true where they hold priority.
  UltraOn offers Ultrafast where they also hold ultrafast. The picker,
  SetFastPick, routing groups and Codex's catalog all go through CanFast.
- A fast pick from an agent on Anthropic's Messages API carries Claude's
  speed "fast". Translated to the remote's Chat Completions or Responses,
  nothing turned that into service_tier. forwardTranslated now sets the
  tier the remote offers (priority, or ultrafast for an Ultrafast pick
  where offered) when the request is fast and names no tier. A request
  that names a tier is sent as before.
The remote side already serves a Chat request's service_tier priority to
Codex and to the Cursor plugin (TestChatFastTier,
TestPluginServiceTierReachesFetch), so a remote on an older version works
once the local magpie is updated.

Docs: the remote magpie service tiers row in
docs/subsystems/providers-accounts.md.

Run at this tree (rebased on origin/main):
- New TestRemoteMagpieFastPick: two httptest servers (the remote gateway
  and a Chat-only vendor, as the report's native_endpoints). Claude Code
  on /v1/messages and a Chat client both reach the remote with priority,
  and the remote sends its vendor priority. A model offered no tier
  can't be picked, and another agent's request goes without a tier.
- go test ./internal/gateway -run 'Fast|Tier|RemoteMagpie|Remote': ok.
- go test ./internal/codexcat: ok.
- go test ./internal/provider, ./internal/agent, ./internal/gui: the only
  reds are already filed and unrelated to this change:
  - #3632: the synctest crash in TestUnreadLoginsWriteErrorsKeepCredentials.
    Skipped on the rerun; everything else in provider passes except the
    three below.
  - #3854: TestFetchAsksOneListOnceForTwoBasesOfIt,
    TestFetchUnionsProtocolListsWithoutChat and TestFetchAsksASharedBaseOnce.
    Also red 3 of 3 at a fresh origin/main 6c063ac1b without this change.
  - #3884: TestFolderVarsAreListed (gui).
  - #3451: TestRestartHandsTheGatewayOver (agent).
- gofmt -l and go vet (darwin, linux, windows) on provider and gateway:
  clean.

Broken by hand: CanFast's remote case returning false turns the new test
red (SetFastPick refused, CanFast false). Turning off the
forwardTranslated block turns it red for /v1/messages (the remote got no
service_tier).

Not tried: a real Cursor or Codex account behind a real second magpie,
and the picker's bolt in a browser. GUI tests were not run, since no
GUI file changed.
2026-10-27 23:35:08 +08:00
..