fix(aggregate-api): 修复强校验供应商连通性测试 - #451
Open
goubo wants to merge 1 commit into
Open
Conversation
部分供应商仅接受 Codex 官方客户端标识,原有 probe 请求缺少完整指纹,导致已配置路由被误判为不可用。
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.
变更摘要
User-Agent。User-Agent、originator、session-id、thread-id、x-client-request-id、x-codex-window-id;正常 route 转发逻辑保持不变。改动范围
主要文件
crates/service/src/aggregate_api.rs:按设置为 Codex probe 构建官方客户端标识或自定义 UA。crates/service/src/app_settings/aggregate_api.rs:新增设置默认值、持久化、模式与 UA 校验。crates/service/src/aggregate_api_tests.rs、crates/service/src/app_settings/aggregate_api_settings_tests.rs:覆盖默认 Codex profile、自定义 UA 与设置校验。apps/src/app/aggregate-api/page.tsx:新增连通性测试设置入口与响应式配置 Dialog。apps/src/types/settings.ts、apps/src/lib/api/normalize.ts、apps/src/lib/store/useAppStore.ts:同步前端设置类型、normalize 与默认状态。docs/zh-CN/report/聚合API请求规则与配置说明.md:补充设置语义和请求头说明。验证
pnpm -C apps run testpnpm -C apps run buildpnpm -C apps run test:uicargo test --workspace已执行的实际验证:
未执行的验证与原因:
风险与影响面
User-Agent,不会附加 Codex fingerprint headers。未拆分说明
crates/service/src/aggregate_api.rs是现有 probe 请求构建入口,本次只在原add_codex_probe_headers中选择 header profile;设置校验与持久化已拆到新的app_settings/aggregate_api.rs,继续拆分请求构建会扩大调用边界而没有减少本次风险。apps/src/app/aggregate-api/page.tsx当前低于 800 行强制拆分阈值;本次 Dialog 直接复用页面已有 app settings 状态和 mutation,保持局部修改,未引入新的跨页面业务抽象。备注
agent-work-dir/未包含在提交中。