Files
magpie/internal
yetoneandggbdpq e3ea77f828 provider, gateway: a name cut to its byte limit is cut where a character begins — an import link's Chinese name= ended in a broken character (#2416, ggbdpq)
parseImport cut name= at 80 bytes, which lands mid-character for a
name in Chinese (3 bytes each: 80 bytes is 26⅔ characters), so the
provider's name ended in U+FFFD. It now steps back to the byte where a
character begins (utf8.RuneStart). The MCP tool names namedTools cuts to
64 bytes (with and without the de-dup suffix) had the same cut and use
the same helper, cutName.

Tests: TestParseImportNameCutKeepsCharactersWhole (30×"鱼"+"-relay"
keeps 26 whole characters) and TestToolNameCutKeepsCharactersWhole; each
fails with the old byte cut put back by hand.
gofmt clean; vet darwin, linux, windows (-tags nogui).
Full suite: go test -tags nogui -count=1 -timeout 45m ./internal/provider/
./internal/gateway/ ok (116.6s, 477.8s); other packages untouched.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-10-16 00:16:43 +08:00
..
…
…
…