fix(MOC-153): catalog 写非空 base_instructions 修第三方切真 GPT 400#419
Merged
Conversation
第三方模型起步的会话切真 GPT 后报 400 `Instructions are required`。根因: transfer 给 Codex model catalog 每个 entry 写空串 `base_instructions`,Codex 在会话创建时把它冻结进 session_meta;之后切真 GPT 直连 chatgpt.com(不经 proxy), OpenAI Responses 后端硬校验顶层 instructions 非空 → 400。真 GPT 不经 proxy, 只能让会话出生即带非空 base_instructions。 - registry 新增共享常量 CAS_BASE_INSTRUCTIONS(写入/剥离两端 single source of truth) - model_catalog.rs 给每个 catalog entry 写该非空值(替代旧 "") - responses/request.rs adapter 对第三方请求精确剥离该 sentinel,第三方行为字节级不变 - 4 单测(catalog 非空 / 第三方剥离 string+object / 非 sentinel 不误剥) - README FAQ + CHANGELOG 同步 2026-06-07 isolated `codex exec` 真机实测坐实:catalog base_instructions 原样冻结进 session_meta(空→空 / 非空→非空)。 Refs MOC-153
This was referenced Jun 7, 2026
Closed
Cmochance
added a commit
that referenced
this pull request
Jun 7, 2026
#419(catalog base_instructions 路线)采纳了 @Alpaca233114514 在 #396/#398 里 的 MOC-153 贡献:第三方切 GPT 报 `Instructions are required` 400 的根因诊断 (顶层 instructions 空)+ 注入非空 instructions 的核心思路。#419 已 squash-merge 进 main、无法 amend,故在此 follow-up commit 以 Co-Authored-By 形式署名。 Co-Authored-By: ALPACA LI <alpaca8570@outlook.com>
Cmochance
added a commit
that referenced
this pull request
Jun 7, 2026
#419(catalog base_instructions 路线)采纳了 @Alpaca233114514 在 #396/#398 里 的 MOC-153 贡献:第三方切 GPT 报 `Instructions are required` 400 的根因诊断 (顶层 instructions 空)+ 注入非空 instructions 的核心思路。#419 已 squash-merge 进 main、无法 amend,故在此 follow-up commit 以 Co-Authored-By 形式署名。 Co-Authored-By: ALPACA LI <alpaca8570@outlook.com>
Cmochance
added a commit
that referenced
this pull request
Jun 7, 2026
#419(catalog base_instructions 路线)采纳了 @Alpaca233114514 在 #396/#398 里 的 MOC-153 贡献:第三方切 GPT 报 `Instructions are required` 400 的根因诊断 (顶层 instructions 空)+ 注入非空 instructions 的核心思路。#419 已 squash-merge 进 main、无法 amend,故在此 follow-up commit 以 Co-Authored-By 形式署名。 Co-authored-by: ALPACA LI <alpaca8570@outlook.com>
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.
问题
第三方模型(MiniMax / MiMo 等)起步的会话切换到真 GPT(
gpt-5.5)后发消息,Codex 内联报 400Instructions are required、对话卡死。根因(真机实测坐实)
transfer 给 Codex
model_catalog_json每个 entry 写base_instructions: ""。Codex 在会话创建时把它冻结进session_meta.base_instructions、跨 resume 不重解析(isolatedcodex exec实测:catalog 写什么字符串 session_meta 就原样冻结)。第三方会话起步顶层 instructions 一直空;之后切真 GPT 直连 chatgpt.com 不经 proxy,OpenAI Responses 后端硬校验顶层 instructions 非空 → 400。真 GPT 不经 proxy → 唯一可行修法是让会话出生即带非空 base_instructions。改动
registry:新增共享常量CAS_BASE_INSTRUCTIONS(写入/剥离两端 single source of truth)。model_catalog.rs:每个 catalog entry 写该非空值(替代旧"")。responses/request.rs:adapter 对第三方请求精确剥离该 sentinel,第三方对话行为不变。用户影响
废弃 #418
#418 是方向 B(在
/backend-apipassthrough 注入),前提"GPT 经 transfer"被用户场景"停 transfer 切真 GPT"证伪(真 GPT 直连、proxy 够不着)。本 PR 取代之,#418 将关闭。详细排查记录见 Linear。Refs MOC-153