Skip to content

feat: 上游对齐 — Qoder 指纹 / Codex UA 0.164 / Turn 头透传 - #382

Merged
caigee-cmd merged 4 commits into
mainfrom
feat/upstream-qoder-codex-align
Oct 24, 2026
Merged

caigee-cmd merged 4 commits into
mainfrom
feat/upstream-qoder-codex-align

Conversation

@caigee-cmd

Copy link
Copy Markdown
Owner

摘要

一次 PR、三个清晰提交,对齐上游指纹 / UA / 头透传。不合并;用户经调研 bot 批准。

  1. Qoder Cosy 指纹(对标 shuishuipingan/qoder2api-hub PR docs: freeze changelog for v0.2.35 #75 / v1.7.3)

    • Cosy CLI 1.1.32 → 1.1.75;桌面签到 Cosy-Version 0.3.4 → 0.4.8
    • Reasoning UA → undici(取消 edition 拆分)
    • 增加 cosy-business-* / cosy-scene / cosy-clientip;cosy-data-policy 小写 agree
    • cosy-machineos 全 COSY 请求;cosy-machinehostname 仅 SSE
    • 未移植:hub feat: add request stats and traffic charts to Overview #10 省略派生 machine 头、Origin/Referer 剥离(CN 风险)
  2. Codex 出站 UA → 官方稳定 0.164.0(rust-v0.164.0;CPA 仍偏旧,按用户要求跟官方)

  3. Codex 头透传(对标 CLIProxyAPI EnsureHeader)

    • 仅 X-Codex-Turn-Metadata / X-Codex-Turn-State / X-Codex-Window-Id
    • gateway prepare 入 context → 非 SIWC 上游请求写出;不扩大到 Session-Id / Beta / Originator

架构

插入既有 qauth / Codex adapter / prepare context;无并行框架、无新冷却机、无 provider 专属 console 页。自动签到仍走原有 per-tick / rate-limit,未改并发节流。

测试

go test:./internal/providers/qoder/... ./internal/providers/codex/... ./internal/providers/ ./internal/executor/ ./internal/gateway/

风险

  • CN 签到:桌面 Cosy-Version 升至 0.4.8;若上游对旧版更宽松,偶发拒绝需回看。签到调度未改,不会一次打满账号。
  • Codex UA:跟官方 0.164.0 可能与 CPA 行为略有差异;cloaking 仍用 codex-tui Originator。
  • 透传:仅官方 Codex 客户端会带这些头;curl/OpenAI SDK 路径无影响。SIWC 路径故意不透传(与 CPA 一致)。

未做

WorkBuddy #643、Devin、#375、ProvidersPage custom-row density。

Bump Cosy CLI to 1.1.75 and desktop Cosy-Version to 0.4.8. Use undici
User-Agent for reasoning; send cosy-machineos on all COSY requests and
hostname on SSE only. Add cosy-business-*/scene/clientip; lowercase
cosy-data-policy agree. Port only what fits existing qauth adapters.
Follow official Codex CLI rust-v0.164.0 stable even though CLIProxyAPI
still pins an older spoof. Keeps Originator as codex-tui.
Stash inbound X-Codex-Turn-Metadata, X-Codex-Turn-State, and
X-Codex-Window-Id in gateway prepare (same context path as Client UA)
and apply on non-SIWC Codex upstream requests. Scope matches CLIProxyAPI
EnsureHeader for those three only — no Session-Id / Beta / Originator
widening. Changelog covers all three upstream-align items.
@caigee-cmd
caigee-cmd merged commit 8694ba4 into main Oct 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant