ESern29751 on X (v0.1.4341): in a routing group with intent recognition, magpie often 499-cancels the intent classifier's request, with MiniMax, GPT-6 Luna and Grok 4.6 as the classifier. Cause: those models reason before they answer. The classifier asks for reasoning_effort none, but MiniMax thinks anyway and Grok 4.6 and Luna go no lower than low. Through the live gateway with the classify prompt over a real routing prompt (~5k tokens of context): grok-4.6 took 4.7-8.1s (288-462 reasoning tokens), minimax-m2.5 3.7-10.3s (439-1012 output tokens), gpt-6-luna 1.2-7.2s; cold calls reached 12-29s. The unset classifier timeout was 8 seconds, so most turns were cut off, fell back to the group's order and lost their intent routing. Each cut call was then logged 499 "the agent canceled the request", which usage counts as no failure, though no agent had canceled anything: askChat's own context.WithTimeout had no cause, the mislabel #2318 fixed for an image's description but never for the classifier. Fix: - settings.ClassifyTimeoutDefault 8 -> 15 (an existing Settings segment). A user who saved 8 keeps 8; only the unset value moves. The GUI's fallback segment follows (app.js), and the docs (en/zh/ja intent and start, gateway-routing.md) say 15. - askChat's wait is context.WithTimeoutCause(..., sideTimedOut{"decision model", wait}): the usage row says "magpie stopped waiting: its decision model had no answer in Ns", a failure. - Siblings checked: the advisor and Codex titles use the client's context, compaction and vision already carry sideTimedOut; askJev (decision providers) logs no 499 row of its own. - Tests that assumed the 8-second unset wait now use 15 (classify, decide, decide_group, nested_classify_wait, settings). - app.js grows by the one byte of the fallback's second digit: both core budgets +1 with the reason (TestCoreScriptBudget was red at exactly 1 over without it). A shorter `|| 15` would show a hand-edited negative value as its own segment, so it wasn't taken. - site: llms-full.txt and the search indexes regenerated for the docs pages (node llms-full.mjs, node search-index.mjs). Test: TestReasoningClassifierAnswersInTheWaitUnset - a classifier answering in 10 units routes the turn with the timeout unset, and one slower than 60 units gives no answer with one 499 usage row that says magpie stopped waiting for its decision model and counts as a failure. Broken by hand (mica-run): with askChat back on a plain WithTimeout the test is red ("the classifier's cut call: 499 "the agent canceled the request""); with the default back at 8 it is red ("gave no answer in 400ms"). Run at 0479372b8, this commit's tree (mica, through ~/suite.lock; mote was over its cores): - gofmt -l: clean. go vet (darwin), GOOS=linux go vet -tags nogui, GOOS=windows go vet: rc 0 (darwin vet rc 0 at the first try on mote). - go test -tags nogui -count=1 -timeout 45m ./...: rc 0, 103 ok. (The first run, on mote before the budget raise and the rebase ontoadfa196db, was red on TestCoreScriptBudget alone.) - node --test site/*.test.mjs: 132 of 132. - GUI (node --test, Chromium and WebKit, five languages, 1100 and 420): classify-timeout-setting, settings-places, i18n-en-no-cjk green; i18n-keys red only on "a plugin's words are its own" over claude_image_budget_test.go's ", with an image", already #6877 from2896e82cc, untouched here. Not tried: the real reporter's group in the GUI with these models after the change (the timings above were measured through the live gateway before it); the whole GUI suite (only a fallback value changed in app.js).
41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
package settings
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
// Settings' Classifier timeout (#2934: a Kiro subscription's haiku needed
|
|
// more than 8 seconds) is kept from 1 to 60 seconds, and 0, which is what
|
|
// a settings.json without it reads as, is the default: 15, room for a
|
|
// classifier that reasons (ESern29751 on X), where it was 8.
|
|
func TestClassifyTimeoutKeptAndBounded(t *testing.T) {
|
|
t.Setenv("XDG_CONFIG_HOME", t.TempDir())
|
|
if w := Load().ClassifyWait(); w != 15*time.Second {
|
|
t.Fatalf("unset: %v", w)
|
|
}
|
|
for _, n := range []int{1, 30, 60} {
|
|
if err := Save(Settings{ClassifyTimeout: n}); err != nil {
|
|
t.Fatalf("%d: %v", n, err)
|
|
}
|
|
if s := Load(); s.ClassifyTimeout != n || s.ClassifyWait() != time.Duration(n)*time.Second {
|
|
t.Fatalf("%d read back as %d, %v", n, s.ClassifyTimeout, s.ClassifyWait())
|
|
}
|
|
}
|
|
for _, n := range []int{-1, 61, 600} {
|
|
if Save(Settings{ClassifyTimeout: n}) == nil {
|
|
t.Fatalf("%d seconds accepted", n)
|
|
}
|
|
}
|
|
if Load().ClassifyTimeout != 60 {
|
|
t.Fatal("a refused value overwrote the saved one")
|
|
}
|
|
// a settings.json written by hand past the bounds still waits within them
|
|
if w := (Settings{ClassifyTimeout: 600}).ClassifyWait(); w != time.Minute {
|
|
t.Fatalf("600 waits %v", w)
|
|
}
|
|
if w := (Settings{ClassifyTimeout: -3}).ClassifyWait(); w != 15*time.Second {
|
|
t.Fatalf("-3 waits %v", w)
|
|
}
|
|
}
|