Repository navigation
fix: 对齐 CPA 的 BPS 授权用户头与请求层级契约 - #819
Merged
Merged
Conversation
5 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题与行为变化
CPA/BPS 0.5.31 会发送授权用户头并保留显式 processing tier;本项目原 BPS 请求缺少
X-Openai-Account-User-Id,转换时还丢弃service_tier,且提前进入 BPS 路径会跳过原生转发器的 Fast 策略。现在用户头从本次实际 bearer 的用户声明投影;BPS 先执行现有 Fast 策略,再将 auto/default/priority(fast→priority)送到上游。缺省不升级,其他 tier 明确拒绝。请求模型、xhigh、工具续轮保持一致,并区分请求层级与上游终态声明层级;上游声明 Luna 时不改名成 Astra。
这是 #812 的协议缺口交付,不表示 Team 二轮账号“不降智”已经验证。真实账号质量、长期保持、第三方插件整体兼容性仍未完成;不修改密文绑定、默认强度或账号路由策略。
关联记录与来源
422e0b524c28818c0b711efc5771532b19cff55a;head:feat/bps-catalog-effort-contract-812。aaee30218e174e5a6c495b935d20d4014d432f49,.soSHA-2568ad011f9952a2f5deedafe88ad14b77a26c89a0f2579ec9182cfb61342b3b0d1。静态定位用户头写入0x4110e0、tier 校验0x3f1732与写入0x3f3b16;首轮与续篇见 issue。独立修改现有 Go adapter,未复制第三方代码、加载二进制或引用外部提交。管理员新功能提示
提示 ID 与登记项:不适用;修复已有协议和 Fast 配置的执行路径。
所有 NewFeatureBadge 展示位置:不适用;没有新增 UI/菜单/设置。
关闭行为:不适用;没有公告状态改动。
ID 沿用 / 重新公告:不适用;不重置已有提示。
必要回归:不适用;原管理员策略由后端回归覆盖。
A→B 新提示:不适用,无新提示。
多入口同步隐藏:不适用,无提示改动。
刷新/登录保持:不适用,无提示状态改动。
C 正常显示及旧提示不复活:不适用,无 ID 变化。
复现与验收
以虚构的当前 BPS bearer user 与父账号 stale Codex user、客户端伪造 user 头构造请求。账号别名映射到 gpt-6-astra、请求 xhigh + priority,假上游终态声明 gpt-5.6-luna/default。
验收:出站用户只来自实际 bearer,模型/explicit/xhigh/priority 保持;上游 Luna/default 如实返回和记录。测试覆盖 stream 与非 stream、priority/fast/auto/default/缺省、分组强制、全局过滤/拒绝、未知 tier、非法头值,以及工具修正期间 tier 保持。
协议、调度或传输改动补充
/basispoints/api/responses,HTTP/SSE;通用请求构造器同时覆盖目录、附件、图片的身份头。实际验证
当前 head:
79c628e67e5ec2bf65a989cc2f54eb9b9a6164ae。最终 head 全部检查已完成:44 个 check success、39 个条件 skipped;18 个 workflow success、15 个条件 skipped。定向协议/网关、完整单测/集成、前端、lint、安全与相关专项回归均通过。/home/ranxi/projects/sub2api-bps-cpa-812-20261113:git diff --checkgo test ./internal/service/basispoints -count=1兼容性与运行影响
文档与用户可见变化
更新 docs/excel-bps.md 的协议契约、tier 行为与验证边界。无页面改动。合并不表示发布/部署。
Agent 使用声明
提交前自查