Files
magpie/internal/provider/kiro_toolong_min_test.go
T
yetone 0c31638045 kiro: the mover installs 0.1.24, which says a too-long conversation as one
ergou0954_54426 on Discord routes by intent across Kiro's Claude and GPT
models and DeepSeek, and sometimes a turn failed with Kiro saying the
context was exceeded. Kiro says a conversation is past the model's window
in three ways, and the plugin up to 0.1.23 turned only the HTTP 400 into
the "input is too long for the model's context" that the gateway reads as
an overflow (tooLong). The same ValidationException as an exception in
Kiro's event stream came out as a 502, so the gateway took it for a
passing vendor fault: it rested the account, asked Kiro again (15 asks
for a lone provider in a probe), and never told the agent
context_length_exceeded, so the agent never compacted. A reply Kiro
stopped with MODEL_CONTEXT_WINDOW_EXCEEDED came out as finished.
plugins e8050e8 (kiro 0.1.24, on npm) answers both as the 400 that says
too long. Routing was already right: roomy skips a member whose known
window the request is past, and withRoom moves an overflow to a member
with room.

The min goes to 0.1.24 so keepMovedCurrent updates every moved user.
TestKiroMoverHasTheTooLongFix holds it there.
TestKiroPluginOverflowGoesToAMemberWithRoom pins what the gateway does with
0.1.24's two wordings: in a group the other member answers, the try is
failOverflow with no rest, and alone the agent gets context_length_exceeded
after a single ask.

Run on mote: go vet ./internal/provider ./internal/gateway; go test
-timeout 45m -count=1 ./internal/provider (ok 150s) ./internal/gateway
(ok 712s). gofmt -l clean. Broken by hand: at origin/main's min 0.1.23,
TestKiroMoverHasTheTooLongFix fails. A probe with 0.1.23's 502 body
showed Fail other, a rest, and a vendor 502 for the lone provider.
Not run: the full ./... suite (another session's full suite held mote),
and a real Kiro account pushed past its window.
2026-11-01 11:30:12 +08:00

19 lines
670 B
Go

package provider
import (
"testing"
"github.com/yetone/magpie/internal/update"
)
// Kiro's plugin before 0.1.24 answered a too-long conversation that Kiro
// said in its event stream with a 502, and a reply Kiro stopped for a
// full window as a finished one, so magpie never read either as an
// overflow (TestKiroPluginOverflowGoesToAMemberWithRoom in the gateway).
// The mover keeps every moved user on a version that says it.
func TestKiroMoverHasTheTooLongFix(t *testing.T) {
if update.Newer("0.1.24", movers["kiro"].min) {
t.Fatalf("the Kiro mover installs opencode-kiro-auth %s, which answers Kiro's too-long stream with a 502", movers["kiro"].min)
}
}