Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6ca4efa
fix(groups): make profit control upstream's again in the backend
Oct 3, 2026
9494e8a
fix(groups): restore upstream's profit control section in the group d…
Oct 3, 2026
af9c1eb
docs(downstream): record that group profit control is upstream's again
Oct 3, 2026
b6badac
feat(reasoning): add the 推理恢复 page and drop the per-account reasoning…
Oct 3, 2026
c6e5b86
chore(settings): delete the two retired API-key compatibility settings
Oct 3, 2026
8df0a1c
docs(downstream): state what the three follow-ups ship on one tree
Oct 3, 2026
eb7199c
fix(codex): keep the models manifest outside the profit gate
Oct 3, 2026
3f15f06
docs(downstream): correct the v0.2.13 review after the follow-up review
Oct 3, 2026
2224b35
fix(reasoning): drop Reload from 推理恢复 and give its entry an own icon
Oct 3, 2026
a09078a
test(accounts): drop the absent-selector cases, pin noFieldsSelected …
Oct 3, 2026
41ea24f
fix(accounts): TypeSafe wording, and one rule for the upstream model …
Oct 3, 2026
1e1a321
fix(system-prompts): no binding where no prompt can be injected
Oct 3, 2026
2056493
fix(system-prompts): keep the page intro on one line
Oct 3, 2026
ded984b
docs(downstream): record the changes after the owner's preview
Oct 3, 2026
e080edf
fix(system-prompts): offer bulk binding only where an account can tak…
Oct 3, 2026
31d58ae
fix(system-prompts): close the other writers of an account's binding
Oct 3, 2026
d9b578c
docs(downstream): record the binding fixes after the review
Oct 3, 2026
0d36a52
refactor(openai): delete Chat reasoning replay
Oct 3, 2026
22e4208
test(openai): pin the Chat tool round on the first turn's ciphertext
Oct 3, 2026
aeeb04b
perf(openai): run the rejected-cipher memory on the shared Redis pool
Oct 3, 2026
1313c0d
refactor(openai): make reasoning recovery one global switch
Oct 3, 2026
31e47a6
chore(migrations): purge the per-account reasoning options (267)
Oct 3, 2026
cbfc2b4
docs(downstream): describe the reasoning recovery switch
Oct 3, 2026
c5f9355
fix(openai): end rejected-cipher memory I/O at the budget deadline
Oct 3, 2026
1341290
refactor(openai): drop the retired policy_unavailable stop reason
Oct 3, 2026
987199e
test(openai): delete the live reasoning diagnostic harness
Oct 3, 2026
4f1528a
test(openai): read the recovery switch from the frozen harness snapshot
Oct 3, 2026
d7c9d09
test(openai): restore the live reasoning diagnostic harness
Oct 4, 2026
f0b8f11
fix(openai): close the rejected-cipher memory client with the gateway…
Oct 4, 2026
b8d9d58
fix(ops): drop the policy_unavailable text from the continuation diag…
Oct 4, 2026
67a804f
chore(ci): drop the deleted Cindy spec from the frontend critical list
Oct 4, 2026
ca51c93
docs(downstream): describe the assembled v0.2.13 release tree
Oct 4, 2026
c3be4f0
docs(downstream): record the vet run on the dependent test packages
Oct 4, 2026
d848f77
chore(migrations): cite v0.2.11-codexrip.9 in the headers of 266 and 267
Oct 4, 2026
ceaa990
test(openai): drop the replay key search from the Chat tool round test
Oct 4, 2026
6992955
fix(reasoning): one zh term per thing on 推理恢复 and in the Ops diagnostics
Oct 4, 2026
208fee4
docs(downstream): state what the review of the assembled tree found
Oct 4, 2026
9b6dfa0
test(openai): delete the dated live reasoning diagnostic
Oct 4, 2026
798d90b
fix(reasoning): keep the owner-approved zh texts of 推理恢复
Oct 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .downstream/gpt6-models-and-prompts.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ ChatGPT 边缘自 2026-09-23 起不再为 `/backend-api/codex/responses` 的流

侧栏“扩展功能 → 系统提示词”:一个全局开关、一个站点默认提示词和提示词库(名称、正文 ≤64 KiB、位置 prepend/append、角色 auto/system/developer,最多 50 条)。整份配置存为 `settings.system_prompts` 一行 JSON;`GET/PUT /api/v1/admin/system-prompts` 读写整份配置并返回账号使用统计,删除仍被自定义账号使用的提示词返回 409。

账号绑定存于 `accounts.extra.system_prompt`(`inherit`、`off`、`custom` + `prompt_id`,缺省为继承)。账号编辑、行菜单和批量栏(≤1000 个)通过 `PUT /api/v1/admin/system-prompts/bindings` 写入,普通账号编辑保留该键。继承的账号在所有平台使用站点默认;全局开关关闭时一律不注入。
账号绑定存于 `accounts.extra.system_prompt`(`inherit`、`off`、`custom` + `prompt_id`,缺省为继承)。账号编辑、行菜单和批量栏(≤1000 个)通过 `PUT /api/v1/admin/system-prompts/bindings` 写入,普通账号编辑保留该键。继承的账号使用站点默认;全局开关关闭时一律不注入。

绑定只属于请求有注入点的平台,即 `service.SystemPromptPlatforms` 的十个平台(下表四种最终协议)。TypeSafe 只走 System One,请求没有 system / instructions 字段,转发时原样发送,所以它的账号不注入、不计入使用统计、不持有绑定:

- 账号编辑和行菜单不提供该入口;批量栏在选中的账号都已加载且都不可注入时也不提供。选中的是一组 ID,可以包含其他页、全部结果或导入结果里未加载的账号,这类选择保留入口,批量弹窗提示 TypeSafe 账号会被跳过。
- 绑定接口跳过这类账号并返回实际写入的账号数。
- 创建账号(数据导入、复制账号同此路径)时丢弃这类账号带入的 `extra.system_prompt`;批量编辑和 extra 合并接口在任何平台都不写该键,已有账号的绑定只由绑定接口写入。
- 迁移 `268_purge_system_prompt_bindings_without_insertion_point.sql` 一次性删除它们已存的绑定。

请求路径只读内存快照(保存即替换,60 秒后台刷新以同步多实例)和调度账号自带的绑定,不查询数据库;配置不可用时不注入并告警,不向客户端返回错误。每个最终协议只注入一次:

Expand All @@ -53,6 +60,14 @@ Claude OAuth 伪装系统块只由上游设置决定:设置 → 网关的 `ena

侧栏“Codex 运行设置”(`/admin/codex-runtime`)有一个开关“压缩 Codex Responses 请求体”:开启时 OAuth 账号发往 ChatGPT Codex 后端的流式 `/responses` 请求体以 zstd 压缩发送,compact、models 等其他请求保持明文。保存沿用 TOTP 二次验证,对应 `GET/PUT /api/v1/admin/settings/codex-runtime` 的 `{"request_zstd": <bool>}`;接口契约与未保存时的默认值见 [native domains](native-domains.md)。

## 失效推理密文恢复

侧栏“扩展功能 → 推理恢复”(`/admin/reasoning-recovery`):一个全局开关和保存按钮,默认开启,没有账号级选项;页面打开时读取一次,读取失败时显示错误、不显示开关。存为 `settings.reasoning_recovery_config` 一行 JSON(`{"enabled": <bool>}`),没有该行即开启;`GET/PUT /api/v1/admin/reasoning-recovery` 以标准响应封装读写 `{"enabled": <bool>}`,管理员认证、无二次验证,保存记入操作审计,请求体不是严格的 `{"enabled": <bool>}` 时返回 400 且不保存。请求路径只读内存中的布尔值(保存即替换,60 秒后台刷新以同步多实例),不查询数据库,每次转发开始时读取一次。启动时读取失败或存储值不是严格的 `{"enabled": <bool>}` 则停止启动;运行中刷新失败保留当前值。

开启时,OpenAI 平台的 API Key、OAuth 和 Setup Token 账号(含自动透传)在原生 Responses(含 compact)与 Chat Completions 转 Responses 的 HTTP 请求上生效:上游以结构化错误码 `invalid_encrypted_content` 或 `thinking_signature_invalid` 拒绝、且尚无语义输出时,去掉被拒推理项的 `encrypted_content`,在同一账号重发一次;被拒密文按来源在 Redis 记忆 24 小时,期间同源请求发送前即去掉。Messages 桥接与 WebSocket 不恢复。关闭时不重发也不预先去除,签名拒绝仍作为请求级终态返回,不切换账号。

迁移 `267_purge_account_reasoning_options.sql` 一次性删除各账号 `extra` 中原有的两个账号级推理选项键(键名见该文件);此后没有代码读写它们,已存的账号级取值不带入全局开关。Chat Completions 转 Responses 的请求只由客户端消息转换而来,网关不保存响应中的推理项。

## 账号连接测试与批量测试

单账号、批量和定时测试共用同一测试路径,错误按上游 v0.2.8 原样显示:`API returned <状态码>: <原始响应>`、`Request failed: <错误>` 及流内 `error`/`response.failed` 的上游 message;服务日志 `Account test error:` 与界面文本相同。成功仍要求有效协议终态和可见文本,失败终态附上游原始内容,例如 `stream ended before terminal (last event: …)`、`completed without visible text (finish_reason=…)`、`finish_reason=…`。
Expand Down
Loading
Loading