Commit Graph
2 Commits
Author SHA1 Message Date
yetone f2412fd599 gateway: the Claude Code and Codex header tests expect another agent's own User-Agent
abe7b0063 (v0.1.3237) made a key+URL provider receive the agent's own
User-Agent by default. Two tests still asserted that a non-Claude-Code
or non-Codex agent ("opencode/1.0") reaches the relay as magpie/..., so
internal/gateway was red in the full suite on mote at abe7b0063. They
now assert the agent's own UA. They still check that none of Claude
Code's or Codex's own headers is copied.

Run (mote): go test -run
'TestClaudeCodeHeadersReachAnthropicRelay|TestCodexHeadersReachKeyedRelay'
./internal/gateway: ok. The full ./... run at abe7b0063 had no other red
(87 packages ok).

Reported-by: nb5p on Discord
2026-11-07 18:40:57 +08:00
yetone 57bcccc980 gateway: Claude Code's own headers reach a key+URL Anthropic provider (#179: 403 packy: This API endpoint is only accessible via the official Claude CLI) — magpie sent Claude Code's request on with only anthropic-version and anthropic-beta and its own User-Agent, so a relay that serves only Claude Code, telling it by claude-cli/ and x-app, refused it. Now a request from Claude Code to a provider without an account goes on with its User-Agent, x-app, anthropic-*, X-Stainless-* and x-claude-code-* headers and ?beta=true as it sent them; its key to magpie never does, the provider's own is set. Tested against a fake upstream: the headers and query arrive, the provider's key and not magpie's, another agent still goes as magpie 2026-09-29 11:04:45 +08:00