Sibling of the previous commit (echo_ts's colon-joined item ids). When a
Codex or Chat conversation moves to a Messages upstream, buildAnthropic put
each call's id in tool_use.id and tool_result.tool_use_id as it came.
Anthropic takes those only of [A-Za-z0-9_-] and refuses the whole request
over one with another character, which another vendor's calls can have
(Devin's "Bash:0#a65b…", #1304; a relay's or a plugin's). Both now go
through anthropicOutID, the encoding Anthropic clients already get
(mp_ + base64url, stateless, the same on every request), so a call and its
result keep matching; a safe id (toolu_…, call_…) goes byte for byte, and
an id a Claude Code client sent back as mp_… is decoded on the way in and
encoded the same way out.
Test: TestAnthropicUpstreamTakesAnotherVendorsCallIDs (Codex input with
Devin's literal call id and a toolu_ one, to a Messages upstream). On the
old code it fails: tool_use "Bash:0#a65b6a5e02194b87bbc796c4428c946d".
Run: go test -tags nogui ./... (sandbox HOME, pinned caches; every package
ok but internal/gateway, which hit the 10m default at load average ~145,
then passed alone with -timeout 40m in 683s), gofmt -l,
GOOS=linux / GOOS=windows go vet -tags nogui ./internal/gateway/.
Not run against Anthropic's real API.