ac4af582301a4e8a29245dbba767eba31334ddf9
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fc43c69e53 |
gateway: a Codex thread switched to another effort is shown and sent at it
zzzkl3994 (Discord #feedback): Codex switched from medium to xhigh
mid-session, and Routing still showed medium. Their rollout had
{"type":"configuration_update","reasoning":{"effort":"xhigh"}}.
What Codex sends, captured from the real codex 0.162.1 TUI in a sandbox
CODEX_HOME against a local Responses server (built-in openai provider
via openai_base_url, /model -> Extra high -> "s"):
- reasoning_effort_override off (the default): reasoning.effort at the
top goes xhigh; no item.
- reasoning_effort_override on: the top stays at the thread's first
(medium), and every turn carries a configuration_update after its user
message, the last one {"effort":"xhigh"}. This is the reporter's case.
magpie read only the top, so for such a thread:
- Routing's route and try showed medium (requestEffort/bodyEffort);
- a Responses vendor not OpenAI's got the items taken out (forVendor)
and was asked at medium;
- a translated request (parseResponses) was asked at medium;
- magpie's own pick (withEffort, a fixed member) set the top, which an
upstream reading the items overrode.
Now the effort of a Responses request is its last configuration_update's
when it has one (effortUpdated):
- bodyEffort/requestEffort read it, so Routing, tries and usage say xhigh;
- parseResponses takes it as the request's effort;
- forVendor puts it at the top where it takes the items out;
- withBodyEffort and withFixedEffort rewrite the last update (the top
stays, so the thread's prefix does too);
- withoutAnyReasoning drops the items with the reasoning ask.
OpenAI's API and the ChatGPT backend still get the body as Codex sent it.
No Codex prompt or base_instructions is touched.
Tests (codex_effort_change_test.go), built from the captured request:
- TestCodexEffortChangeShownAndSent: route and try at xhigh, a Responses
relay asked xhigh with no item;
- TestCodexEffortChangeReachesChatVendor: Chat vendor asked xhigh;
- TestCodexEffortChangeReaders: readers, magpie's pick, a fixed effort,
reasonless, and OpenAI/ChatGPT bodies byte for byte.
Red on the old code (fix files stashed, two stub funcs): all three fail,
route at "medium", sent medium.
Run at this head (rebased on
|
||
|
|
f074996d93 |
provider, gateway, gui: a model with none of its levels ticked is sent no reasoning field, on every route and in a routing group (yuexian7)
yuexian7 on Discord: models.dev lists their model as reasoning, and the
vendor answers any reasoning parameter with 422 while the same request
without it works. In a routing group they couldn't set an effort per
model, and the model editor refused to untick the last level ("Keep at
least one level"). The learned refusals (
|
||
|
|
173ab71e8b |
gateway: a Gemini client's thinkingConfig no longer reaches a quiet group member as reasoning_effort (#1253)
withoutReasoningAsk (#950) took the reasoning ask off Chat, Responses and Anthropic bodies sent to a group member known not to think, and passed a Gemini-protocol body through as it was. parseGemini then read generationConfig.thinkingConfig into the request's effort, and the quiet member was sent reasoning_effort. It now drops generationConfig.thinkingConfig when it asks to think, by the same reading parseGemini uses (gThinking.effort: a level, a budget, -1 as medium), keeping the rest of generationConfig. A budget of 0 is no ask and stays. A member the user fixed at an effort isn't quiet and is sent the ask as before. TestGroupQuietMemberGeminiThinking sends generateContent through lanGuard(s.Handler()) to a group whose thinking member fails over to a quiet one, for thinkingLevel, a budget and -1. Without the change it fails: "the quiet member was sent map[... reasoning_effort:high ...]"; TestWithoutReasoningAsk's new Gemini cases fail too. With it both pass, and the thinking member and a fixed quiet member still get reasoning_effort. go test -tags nogui ./internal/gateway passes under a temp HOME with pinned caches; the three group tests pass with -race -count=5; go vet and GOOS=linux/windows go vet -tags nogui pass. |
||
|
|
1b8c33b5e2 |
provider: a routing group reasons when any member does, not only when all of them do (#950)
* provider: a routing group reasons when any member does, not only when all of them do groupEntries started a group at Reasoning: true and intersected it with each member's (e.Reasoning = e.Reasoning && thinks), so one member that doesn't think made the whole group 不支持推理. Pi reads that off /v1/models and turns /thinking off for the model: a routing group of deepseek-v4-flash-0731-max (a Trae plugin model magpie read as one that doesn't reason) with a DeepSeek that does lost reasoning for both. The group now reasons when any member does. Images already worked this way (#756: a text-only member doesn't turn every image away), and the gateway fits a request's effort to the member that gets it (fitFor), failing over when a member refuses the level (failEffort). What the group offers as levels is not changed: a member known to take none still leaves the group none (#597), so such a group is Levelless — a shape magpie serves — rather than one that doesn't reason. group_reasoning_test.go (6 tests) fails without the change: TestGroupReasoningFromAMemberThatThinks, TestGroupReasoningLevels and TestGroupReasoningQuietMemberKeepsTheRest report reasoning off. TestModelsListReasoning, the /v1/models contract test, fails the same way and is updated to the new semantics. go vet, go build, GOOS=linux GOARCH=amd64 go build -tags nogui and GOOS=windows go build pass; go test -tags nogui ./internal/provider ./internal/plugin pass under a temp HOME. internal/gateway passes except TestPluginStreamStalledClientKeepsOther RequestsMoving, which fails on this machine with and without the change. * gateway, provider: a group's member that can't think is sent no reasoning, rather than a 400 A routing group reasons when any member does (#950, 533887c2), so an agent asks a group for reasoning that a member of it may not think at all. The effort reached every member, and some vendors turn a reasoning ask away with a 400 on a model that can't think — the review's second point: the comment said the gateway routes a reasoning request to the members that take it, and nothing did. The gateway now sends such a member no reasoning ask, in the agent's own protocol: Chat's reasoning_effort and reasoning, Responses' reasoning (with reasoning_effort, which some relays take), Anthropic's thinking when it asks to think — thinking disabled is no ask and stays — and output_config's effort alone, the rest kept. Everything else goes as the agent sent it, the Responses effort-update history is skipped for it, and the trace's Effort is "" (nothing was sent) with Fixed kept, so the user's own pin is still read. Which member goes first is unchanged: the group routes as it did, and only the body changes. provider.Entry.Quiet is the judgment: magpie has a word on the model — its vendor's or its maker's list, or its provider's own account list — and that word says no reasoning. A model nothing speaks for isn't quiet: it is sent the effort the agent asked for, as #597 leaves it. Nor is one that takes levels, which includes a model the user gave levels of their own: those take the effort the gateway fits to them. Direct requests outside a group are untouched, as TestPluginThinkingOff pins. TestModelsReasoningWithoutLevels (thinks_test.go) still expected group/mixed false; the review's first point. It is updated with a comment saying why the #402 expectation changes, and a group of two quiet members keeps the "none of them thinks" case. TestGroupNonThinkingMemberNoEffort (group_reasoning_test.go) fails without the change: with the withoutReasoningAsk call disabled it reports "B: the quiet member was sent map[... reasoning_effort:high]". TestEntryQuiet (provider) pins the judgment, and TestWithoutReasoningAsk the field set per protocol. go vet ./..., go build ./..., GOOS=linux go build -tags nogui ./... and GOOS=windows go build ./... pass. go test ./internal/provider, ./internal/catalog and ./internal/plugin pass whole; internal/gateway passes in three chunks covering every test (TestGroup|TestFixed|TestFast| TestModels|TestPluginThink|TestWithout|TestMember, TestEffort|TestResponse| TestReasoning|TestQuiet|TestTrace|TestRoute|TestRules|TestRule, and the rest), 43s + 36s + 790s. The whole suite in one process times out on this machine in an unrelated test (TestRuleDecidesAtTurnStartAndHolds here, TestRequestBodyProgressRenewsIdleDeadline on another run) — the base commit 533887c2 times out the same way, at 800s — so the chunks are what was run. The GUI is untouched, so no Playwright run. * gateway, provider: a member the user fixed at an effort keeps it, quiet or not The review's remaining point: Quiet() rests on magpie's catalog or an account's own model list, and what this PR is about is that word being wrong — the Trae plugin gave no capabilities, and magpie read a thinking model as one that doesn't. A member the user fixed at an effort ("provider/model:high", #189) is the user saying this model does think, so magpie's word doesn't override theirs: the gateway sends the fixed member its effort and strips the reasoning ask from the others as before. quiet := isGroup && c.effort == "" && quietTo(c.p.ID, c.model). c.effort is only ever the member's own fixed effort (Member.Effort, planLevel), never the agent's, a group's Group.Levels, the turn's pick or the Settings' — so those are stripped as they were. TestGroupNonThinkingMemberNoEffort's E is now the other way: the fixed quiet member is sent reasoning_effort "high", and the trace's Effort is "high" with Fixed "high". Dropping the c.effort == "" guard makes it fail with "E: the fixed member was sent map[... model:plain]". quiet.go and Entry.Quiet say why. gofmt, go vet ./..., go build ./..., GOOS=linux go build -tags nogui ./... and GOOS=windows go build ./... pass. The review's own set passes — go test -count=1 -run 'TestGroup|TestWithoutReasoningAsk|TestEntryQuiet| TestModelsReasoning|TestModelsListReasoning|Thinks|TestPluginThinking' ./internal/provider ./internal/gateway — and so does internal/provider whole (208s). internal/gateway passes in chunks (Test[A-D] 340s, Test[S-Z] 216s, Test[^A-DS-Z] split over TestEffort|TestResponse|TestReasoning|TestQuiet| TestTrace|TestRoute|TestRules|TestRule|TestFixed|TestFast 38s and the rest earlier): the whole suite in one process still hangs here on an unrelated test (TestCodexBodyReadsPastOldLimit this time, TestRuleDecidesAtTurnStart AndHolds and TestRequestBodyProgressRenewsIdleDeadline before), which the base commit does too and which passes alone in 0.9s. |