Commit Graph
3 Commits
Author SHA1 Message Date
yetone d82985eee1 agent: a routing group whose members are all best on Responses is asked there by Pi, omp, droid and dsh, so its tool-call arguments stream (#1594, ObsidianArch02)
magpieModels gave a routing group no native API, since its members may
each want another. Pi, omp and droid then asked every group on Chat
Completions, and dsh put it on its Chat route, even a group of GPT
members all served on Responses. The gateway translated each answer from
Responses to Chat, and that translation holds a tool call's arguments
until the call ends (#613), so Pi's Code Mode saw no code until the whole
call had been generated.

A group now has APIs ["responses"] when every member, nested groups'
included, is served best on Responses (allResponses over the group's
members, by Provider.Native). Any other group keeps none: one with a Chat
member, and a Messages-only group too, as the gateway knows whether a
Claude thinks adaptively by its own model id, not the group's. dsh moves
a start on such a group to its Responses route (dshStartOnItsRoute); a
dsh session resumed on it asks for the model once, as for any model that
moved routes.

The rest of the request (a protocol picked per group, conversion shown
per request) is not in this commit.

Verified:
- TestPiModelsAskedOnTheirNativeAPI: auto-gpt-5-5, a GPT group and a
  group of that group get openai-responses; a group with a Chat member
  and one of Messages-only members get none. Without the route.go change
  it fails for the three Responses groups.
- TestOmpModelsAskedOnTheirNativeAPI: the same for omp.
- TestGroupOnResponsesRelaysArgumentDeltas (gateway): a group of two
  Responses-only members asked on /v1/responses relays each
  function_call_arguments.delta as the vendor sent it, on /responses.
  It guards what this change relies on, and passed before it too.
- go test ./internal/agent ./internal/provider, gofmt -l, GOOS=linux and
  windows go vet -tags nogui.
- Not tried with a real Pi against a real group.
2026-10-11 21:00:29 +08:00
yetone 7caba10d9c omp: a model's or group's max is offered as max to omp 16.4.0 and later (whqtian on Discord: a routing group with max ticked showed only xhigh in oh-my-pi, while Pi had max) — magpie wrote every model's thinking efforts into omp's models.yml with max taken out and xhigh in its place, since omp 16.3.5's schema stops at xhigh and turns the whole file away over a max; but a group whose levels name both xhigh and max then had no way to max at all, as the gateway keeps an xhigh asked for. omp has taken max since 16.4.0 (pi-ai's changelog; 18.4.8's EffortSchema has it), so an omp on PATH at 16.4.0 or later is now given max as it is; an older one, or one whose version isn't known, keeps xhigh standing in. omp 18.4.8 in a sandbox HOME lists the group's thinking as high,xhigh,max and sends reasoning_effort max with --thinking max. TestOmpGroupOffersMax fails without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-01 20:18:02 +08:00
yetone 69b366adec omp: each model is asked on its provider's own API (#329) — magpie wrote every model into omp's models.yml as openai-completions, so a Claude's thinking signatures had no place between tool turns. As for Pi, a Responses model now gets api: openai-responses and an Anthropic one api: anthropic-messages at the gateway's /v1/messages, thinking adaptively on Claude 4.6 and later, else on a budget (budget-effort would send output_config.effort, which Sonnet/Haiku 4.5 refuse); groups and the rest stay on Chat. A model offering max made omp 16.3.5 reject the whole file, so every magpie model vanished; max is now offered as xhigh, which the gateway fits to max. Checked with the real omp 16.3.5 in a sandbox HOME against a fake upstream: Claude → POST /v1/messages, deepseek → /v1/chat/completions. TestOmpModelsAskedOnTheirNativeAPI fails without the change; TestOmpMessagesRelayedAsSent guards the relay. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-09-30 22:27:11 +08:00