Commit Graph
1 Commits
Author SHA1 Message Date
yetone 51f2f22ce1 gateway: the Qoder plugin's nameless tool call rests nobody (plugins#579)
Qoder plugin 0.2.51 answers 502 "the model's native tool call has no
name; it is not sent on as a tool" when qfmodel twice began a native
tool call without a name before anything of the reply was sent. That is
the model's glitch, not the account's, but failure() read it as
failOther and restAfterMarked rested the account for fallbackCooldown
(a minute), so the user's next turn skipped it.

cutWords now also matches that sentence, so the 502 takes the failCut
lane the plugins' cut-short error already has (#2873): asked again once
where it stood (cutReasks), then the next account or group member, with
no rest and no failure counted. The match is the plugin's whole clause,
not "has no name", so other bodies keep their lanes.

Siblings: failCut is decided in failure() alone, and read by
restAfterMarked (no rest) and the serve loop's retry (gateway.go); both
take the new words through it. No other plugin in magpie-community/
plugins says these words (grep of packages/*.mjs at 5403c21).

Run (on mote, at bbdd9eb55 + this change; rebased onto 2640ac0f0,
which touches internal/provider/migrate_qoder.go only):
- go test -count=1 -timeout 45m ./internal/gateway: ok (764s)
- gofmt -l internal/gateway: clean
- go vet ./internal/gateway for darwin, GOOS=linux, GOOS=windows: ok

Broken by hand: with routing.go from origin/main,
TestPluginNamelessCallFailsOverNotRested fails (try 0 Fail "other" with
a Rest set) and TestPluginNamelessWords fails for the 502 body and the
stream error event; TestPluginOrdinary502StillRests passes on both.

Not tried: a real qoder-cn account that hits the glitch; the tests use a
scripted upstream with the plugin's errorResponse bytes, not the plugin
host.
2026-11-01 07:33:46 +08:00