1. 17 Mar, 2026 1 commit
  2. 12 Mar, 2026 1 commit
  3. 05 Mar, 2026 1 commit
  4. 28 Feb, 2026 1 commit
  5. 26 Feb, 2026 3 commits
    • alfadb's avatar
    • alfadb's avatar
      fix(gateway): return 404 instead of fake 200 for unsupported count_tokens endpoint · 94895314
      alfadb authored
      PR #635 returned HTTP 200 with {"input_tokens": 0} when upstream doesn't
      support count_tokens (404). This caused Claude Code CLI to trust the zero
      value, believing context uses 0 tokens, so auto-compression never triggers.
      
      Fix: return 404 with proper error body so CLI falls back to its local
      tokenizer for accurate estimation. Return nil (not error) to avoid
      polluting ops error metrics with expected 404s.
      
      Affected paths:
      - Passthrough APIKey accounts: upstream 404 now passed through as 404
      - Antigravity accounts: same fix (was also returning fake 200)
      94895314
    • alfadb's avatar
      fix: count_tokens 端点不支持时降级返回空值 (404 only) · 03bcd94a
      alfadb authored
      第三方 Anthropic 中转站通常不支持 /v1/messages/count_tokens 端点,
      上游返回 404 时降级返回 {input_tokens: 0},客户端 fallback 到本地估算。
      
      - 仅匹配 404 状态码,语义明确:端点不存在
      - 其他错误 (400/429/500) 保留原始处理链和 ops 遥测
      - 无需解析错误消息内容,不依赖字符串匹配
      - 新增 table-driven 测试覆盖 fallback 和 non-fallback 路径
      03bcd94a
  6. 21 Feb, 2026 2 commits