mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-10-05 12:28:22 +00:00
The exact-match endpoint allowlist in the proxy omitted `messages/count_tokens`, so every Claude Code / Anthropic SDK request was 404'd with `Path '/v1/messages/count_tokens' not found` before it ever reached the (fully supported) forwarding path. Add the endpoint to `_ALLOWED_ENDPOINTS` and a regression test that pins it as always reachable on POST. Regression history: -933ba105"add missing messages endpoint" (2026-04-01): added messages/count_tokens handling to the forwarding layer. -164ed775"support /message/count_tokens endpoint" (2026-05-09): added the local count_tokens handler. -96661384"update not found proxy" (2026-05-14): only GET was gated, so POST count_tokens passed implicitly. -0217002e"Gate proxy forwarding behind a segment-anchored API path allowlist" (2026-08-23): POST gated, but the "v1/" prefix still carried count_tokens. -5af04364"Restrict proxy forwarding to an exact method/path allowlist" (2026-08-24): switched to an exact table, added "messages" but omitted "messages/count_tokens". This is where the endpoint got locked out.