Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 11 additions & 1 deletion desktop-tauri/i18n/i18n-src/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1017,5 +1017,15 @@
",替换前的数据已备份为 {name}": ", the pre-replace data was backed up as {name}",
",自定义提供商新增 {added} 个、更新 {updated} 个": ", custom providers: {added} added, {updated} updated",
";开关关闭时词表不执行": "; rules do not run while masking is disabled",
";网页管理面板已一并开放(浏览器打开同一地址)": "; the web admin panel is also open (open the same address in a browser)"
";网页管理面板已一并开放(浏览器打开同一地址)": "; the web admin panel is also open (open the same address in a browser)",
"第三方模型回答完自动折叠过程": "Collapse third-party model work after the answer",
"Codex 桌面端在收到带 phase: \"final_answer\" 的助手消息时,才会把这一轮的推理、命令与过程消息收进可折叠的「已处理 X 分钟」;官方模型逐条给出 final_answer / commentary,第三方模型通常不带这个字段,整轮过程就一直展开。开启本项后,网关在重建 Responses 响应时给助手消息补阶段标记:本轮没有工具调用的最后一条消息补 final_answer,之前的正文与过程消息补 commentary。只对经本网关的 Codex 来源 /v1/responses 请求生效,改的是下发给客户端的响应字节;个别上游或客户端不认识这个字段时关掉即可。默认关闭。": "Codex Desktop only collapses this turn's reasoning, commands, and process messages into a collapsible \"Worked for X minutes\" when it receives an assistant message with phase: \"final_answer\"; official models emit final_answer / commentary per message, while third-party models usually omit the field and the whole turn stays expanded. When enabled, the gateway adds phase markers while rebuilding the Responses response: the last message of a turn with no tool call gets final_answer, and earlier text and process messages get commentary. It only applies to Codex-origin /v1/responses requests through this gateway and changes the response bytes sent to the client; turn it off if an upstream or client does not recognize the field. Off by default.",
"给 Codex 的响应补阶段标记,回答完后像官方模型一样把推理与命令过程折叠起来": "Add phase markers to Codex responses so reasoning and commands collapse after the answer, like official models",
"✅ 第三方模型回答完自动折叠过程已开启": "✅ Collapse third-party model work after the answer enabled",
"已关闭第三方模型回答完自动折叠过程": "Collapse third-party model work after the answer disabled",
"第三方模型回答完自动折叠过程设置已刷新": "Third-party reasoning collapse setting refreshed",
"未能读取第三方模型回答完自动折叠过程设置,请稍后重试": "Could not read the third-party reasoning collapse setting, please try again later",
"正在补阶段标记:Codex 桌面端会把这一轮的推理与命令过程折叠起来。": "Adding phase markers: Codex Desktop will collapse this turn's reasoning and commands.",
"未开启,第三方模型的推理与命令过程会一直展开。": "Off: third-party models' reasoning and commands stay expanded.",
"默认关闭。开启后下一次 Codex 请求立即生效,不用重启;只对 Codex 来源的 /v1/responses 请求补阶段标记,其它客户端与 /v1/chat/completions 不受影响。": "Off by default. Enabling takes effect on the next Codex request without a restart; phase markers are only added to Codex-origin /v1/responses requests, other clients and /v1/chat/completions are unaffected."
}
12 changes: 11 additions & 1 deletion desktop-tauri/i18n/i18n-src/ja/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1019,5 +1019,15 @@
",替换前的数据已备份为 {name}": "、置き換え前のデータは {name} としてバックアップ済みです",
",自定义提供商新增 {added} 个、更新 {updated} 个": "、カスタムプロバイダーは新規 {added} 件、更新 {updated} 件",
";开关关闭时词表不执行": ";無効時はルールを実行しません",
";网页管理面板已一并开放(浏览器打开同一地址)": ";Web 管理パネルも併せて公開されています(ブラウザーで同じアドレスを開いてください)"
";网页管理面板已一并开放(浏览器打开同一地址)": ";Web 管理パネルも併せて公開されています(ブラウザーで同じアドレスを開いてください)",
"第三方模型回答完自动折叠过程": "サードパーティモデルの回答後の工程を自動で折りたたむ",
"Codex 桌面端在收到带 phase: \"final_answer\" 的助手消息时,才会把这一轮的推理、命令与过程消息收进可折叠的「已处理 X 分钟」;官方模型逐条给出 final_answer / commentary,第三方模型通常不带这个字段,整轮过程就一直展开。开启本项后,网关在重建 Responses 响应时给助手消息补阶段标记:本轮没有工具调用的最后一条消息补 final_answer,之前的正文与过程消息补 commentary。只对经本网关的 Codex 来源 /v1/responses 请求生效,改的是下发给客户端的响应字节;个别上游或客户端不认识这个字段时关掉即可。默认关闭。": "Codex デスクトップは phase: \"final_answer\" を含むアシスタントメッセージを受け取ったときだけ、このターンの推論・コマンド・工程メッセージを折りたたみ可能な「X 分処理しました」にまとめます。公式モデルは final_answer / commentary を逐次返しますが、サードパーティモデルは通常このフィールドを返さないため、ターン全体が展開されたままになります。本項目を有効にすると、ゲートウェイは Responses レスポンスを再構築する際にアシスタントメッセージへフェーズマーカーを補います。ツール呼び出しのないターンの最後のメッセージには final_answer、それ以前の本文や工程メッセージには commentary を付けます。本ゲートウェイ経由の Codex 由来 /v1/responses リクエストにのみ作用し、変更されるのはクライアントへ送るレスポンスバイトです。アップストリームやクライアントがこのフィールドを認識しない場合はオフにしてください。デフォルトはオフです。",
"给 Codex 的响应补阶段标记,回答完后像官方模型一样把推理与命令过程折叠起来": "Codex へのレスポンスにフェーズマーカーを補い、回答後に公式モデルと同様に推論とコマンドの工程を折りたたむ",
"✅ 第三方模型回答完自动折叠过程已开启": "✅ サードパーティモデルの回答後の工程の自動折りたたみを有効にしました",
"已关闭第三方模型回答完自动折叠过程": "サードパーティモデルの回答後の工程の自動折りたたみを無効にしました",
"第三方模型回答完自动折叠过程设置已刷新": "サードパーティモデルの回答後の工程の自動折りたたみ設定を更新しました",
"未能读取第三方模型回答完自动折叠过程设置,请稍后重试": "サードパーティモデルの回答後の工程の自動折りたたみ設定を読み取れませんでした。しばらくしてから再試行してください",
"正在补阶段标记:Codex 桌面端会把这一轮的推理与命令过程折叠起来。": "フェーズマーカーを補っています:Codex デスクトップはこのターンの推論とコマンドの工程を折りたたみます。",
"未开启,第三方模型的推理与命令过程会一直展开。": "オフの場合、サードパーティモデルの推論とコマンドの工程は展開されたままになります。",
"默认关闭。开启后下一次 Codex 请求立即生效,不用重启;只对 Codex 来源的 /v1/responses 请求补阶段标记,其它客户端与 /v1/chat/completions 不受影响。": "デフォルトはオフ。有効にすると次回の Codex リクエストから再起動なしで反映されます。フェーズマーカーは Codex 由来の /v1/responses リクエストにのみ補われ、その他のクライアントと /v1/chat/completions は影響を受けません。"
}
12 changes: 11 additions & 1 deletion desktop-tauri/i18n/i18n-src/ko/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1019,5 +1019,15 @@
",替换前的数据已备份为 {name}": ", 교체 전 데이터는 {name}(으)로 백업되어 있습니다",
",自定义提供商新增 {added} 个、更新 {updated} 个": ", 커스텀 제공자 {added}개 추가, {updated}개 업데이트",
";开关关闭时词表不执行": "; 스위치가 꺼져 있으면 규칙을 실행하지 않습니다",
";网页管理面板已一并开放(浏览器打开同一地址)": "; 웹 관리 패널도 함께 공개되었습니다(브라우저에서 같은 주소를 여세요)"
";网页管理面板已一并开放(浏览器打开同一地址)": "; 웹 관리 패널도 함께 공개되었습니다(브라우저에서 같은 주소를 여세요)",
"第三方模型回答完自动折叠过程": "타사 모델의 답변 후 과정 자동 접기",
"Codex 桌面端在收到带 phase: \"final_answer\" 的助手消息时,才会把这一轮的推理、命令与过程消息收进可折叠的「已处理 X 分钟」;官方模型逐条给出 final_answer / commentary,第三方模型通常不带这个字段,整轮过程就一直展开。开启本项后,网关在重建 Responses 响应时给助手消息补阶段标记:本轮没有工具调用的最后一条消息补 final_answer,之前的正文与过程消息补 commentary。只对经本网关的 Codex 来源 /v1/responses 请求生效,改的是下发给客户端的响应字节;个别上游或客户端不认识这个字段时关掉即可。默认关闭。": "Codex 데스크톱은 phase: \"final_answer\"가 있는 어시스턴트 메시지를 받을 때만 이번 턴의 추론, 명령과 과정 메시지를 접을 수 있는 「X분 동안 처리함」으로 모읍니다. 공식 모델은 final_answer / commentary를 메시지마다 내보내지만, 타사 모델은 보통 이 필드가 없어 턴 전체가 펼쳐진 상태로 남습니다. 이 항목을 켜면 게이트웨이가 Responses 응답을 다시 만들 때 어시스턴트 메시지에 단계 표시를 보강합니다. 도구 호출이 없는 턴의 마지막 메시지에는 final_answer, 그 앞의 본문과 과정 메시지에는 commentary를 붙입니다. 이 게이트웨이를 거치는 Codex 출처 /v1/responses 요청에만 적용되며, 변경되는 것은 클라이언트로 보내는 응답 바이트입니다. 업스트림이나 클라이언트가 이 필드를 인식하지 못하면 끄면 됩니다. 기본값은 꺼짐입니다.",
"给 Codex 的响应补阶段标记,回答完后像官方模型一样把推理与命令过程折叠起来": "Codex 응답에 단계 표시를 보강해 답변 후 공식 모델처럼 추론과 명령 과정을 접기",
"✅ 第三方模型回答完自动折叠过程已开启": "✅ 타사 모델의 답변 후 과정 자동 접기를 켰습니다",
"已关闭第三方模型回答完自动折叠过程": "타사 모델의 답변 후 과정 자동 접기를 껐습니다",
"第三方模型回答完自动折叠过程设置已刷新": "타사 모델의 답변 후 과정 자동 접기 설정을 새로 고쳤습니다",
"未能读取第三方模型回答完自动折叠过程设置,请稍后重试": "타사 모델의 답변 후 과정 자동 접기 설정을 읽지 못했습니다. 잠시 후 다시 시도하세요",
"正在补阶段标记:Codex 桌面端会把这一轮的推理与命令过程折叠起来。": "단계 표시를 보강하는 중: Codex 데스크톱이 이번 턴의 추론과 명령 과정을 접습니다.",
"未开启,第三方模型的推理与命令过程会一直展开。": "꺼져 있어 타사 모델의 추론과 명령 과정이 계속 펼쳐진 상태로 표시됩니다.",
"默认关闭。开启后下一次 Codex 请求立即生效,不用重启;只对 Codex 来源的 /v1/responses 请求补阶段标记,其它客户端与 /v1/chat/completions 不受影响。": "기본값은 꺼짐입니다. 켜면 다음 Codex 요청부터 재시작 없이 적용되며, 단계 표시는 Codex 출처 /v1/responses 요청에만 보강되고 다른 클라이언트와 /v1/chat/completions는 영향을 받지 않습니다."
}
12 changes: 11 additions & 1 deletion desktop-tauri/i18n/i18n-src/pt-BR/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1019,5 +1019,15 @@
",替换前的数据已备份为 {name}": ", os dados pré-substituição foram backupados como {name}",
",自定义提供商新增 {added} 个、更新 {updated} 个": ", provedores personalizados: {added} adicionados, {updated} atualizados",
";开关关闭时词表不执行": "; as regras não são executadas quando o mascaramento está desativado",
";网页管理面板已一并开放(浏览器打开同一地址)": "; o painel de administração web também está aberto (acesse pelo mesmo endereço no navegador)"
";网页管理面板已一并开放(浏览器打开同一地址)": "; o painel de administração web também está aberto (acesse pelo mesmo endereço no navegador)",
"第三方模型回答完自动折叠过程": "Recolher automaticamente o trabalho de modelos de terceiros após a resposta",
"Codex 桌面端在收到带 phase: \"final_answer\" 的助手消息时,才会把这一轮的推理、命令与过程消息收进可折叠的「已处理 X 分钟」;官方模型逐条给出 final_answer / commentary,第三方模型通常不带这个字段,整轮过程就一直展开。开启本项后,网关在重建 Responses 响应时给助手消息补阶段标记:本轮没有工具调用的最后一条消息补 final_answer,之前的正文与过程消息补 commentary。只对经本网关的 Codex 来源 /v1/responses 请求生效,改的是下发给客户端的响应字节;个别上游或客户端不认识这个字段时关掉即可。默认关闭。": "O Codex Desktop só recolhe o raciocínio, os comandos e as mensagens de processo deste turno em um “Trabalhou por X minutos” recolhível quando recebe uma mensagem do assistente com phase: \"final_answer\"; modelos oficiais emitem final_answer / commentary por mensagem, enquanto modelos de terceiros normalmente omitem o campo e o turno inteiro fica expandido. Quando ativado, o gateway adiciona marcadores de fase ao reconstruir a resposta Responses: a última mensagem de um turno sem chamada de ferramenta recebe final_answer, e o texto e as mensagens de processo anteriores recebem commentary. Só vale para requisições /v1/responses com origem Codex através deste gateway e altera os bytes da resposta enviada ao cliente; desative se algum upstream ou cliente não reconhecer o campo. Desativado por padrão.",
"给 Codex 的响应补阶段标记,回答完后像官方模型一样把推理与命令过程折叠起来": "Adicionar marcadores de fase às respostas do Codex para recolher o raciocínio e os comandos após a resposta, como nos modelos oficiais",
"✅ 第三方模型回答完自动折叠过程已开启": "✅ Recolhimento automático do trabalho de modelos de terceiros após a resposta ativado",
"已关闭第三方模型回答完自动折叠过程": "Recolhimento automático do trabalho de modelos de terceiros após a resposta desativado",
"第三方模型回答完自动折叠过程设置已刷新": "Configuração de recolhimento do trabalho de modelos de terceiros atualizada",
"未能读取第三方模型回答完自动折叠过程设置,请稍后重试": "Não foi possível ler a configuração de recolhimento do trabalho de modelos de terceiros; tente novamente mais tarde",
"正在补阶段标记:Codex 桌面端会把这一轮的推理与命令过程折叠起来。": "Adicionando marcadores de fase: o Codex Desktop recolherá o raciocínio e os comandos deste turno.",
"未开启,第三方模型的推理与命令过程会一直展开。": "Desativado: o raciocínio e os comandos de modelos de terceiros permanecem expandidos.",
"默认关闭。开启后下一次 Codex 请求立即生效,不用重启;只对 Codex 来源的 /v1/responses 请求补阶段标记,其它客户端与 /v1/chat/completions 不受影响。": "Desativado por padrão. Ao ativar, vale já na próxima requisição do Codex, sem reiniciar; os marcadores de fase são adicionados apenas a requisições /v1/responses com origem Codex, e outros clientes e /v1/chat/completions não são afetados."
}
12 changes: 11 additions & 1 deletion desktop-tauri/i18n/i18n-src/zh-Hant/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,5 +973,15 @@
",替换前的数据已备份为 {name}": "",
",自定义提供商新增 {added} 个、更新 {updated} 个": "",
";开关关闭时词表不执行": "",
";网页管理面板已一并开放(浏览器打开同一地址)": ""
";网页管理面板已一并开放(浏览器打开同一地址)": "",
"第三方模型回答完自动折叠过程": "",
"Codex 桌面端在收到带 phase: \"final_answer\" 的助手消息时,才会把这一轮的推理、命令与过程消息收进可折叠的「已处理 X 分钟」;官方模型逐条给出 final_answer / commentary,第三方模型通常不带这个字段,整轮过程就一直展开。开启本项后,网关在重建 Responses 响应时给助手消息补阶段标记:本轮没有工具调用的最后一条消息补 final_answer,之前的正文与过程消息补 commentary。只对经本网关的 Codex 来源 /v1/responses 请求生效,改的是下发给客户端的响应字节;个别上游或客户端不认识这个字段时关掉即可。默认关闭。": "",
"给 Codex 的响应补阶段标记,回答完后像官方模型一样把推理与命令过程折叠起来": "",
"✅ 第三方模型回答完自动折叠过程已开启": "",
"已关闭第三方模型回答完自动折叠过程": "",
"第三方模型回答完自动折叠过程设置已刷新": "",
"未能读取第三方模型回答完自动折叠过程设置,请稍后重试": "",
"正在补阶段标记:Codex 桌面端会把这一轮的推理与命令过程折叠起来。": "",
"未开启,第三方模型的推理与命令过程会一直展开。": "",
"默认关闭。开启后下一次 Codex 请求立即生效,不用重启;只对 Codex 来源的 /v1/responses 请求补阶段标记,其它客户端与 /v1/chat/completions 不受影响。": ""
}
4 changes: 4 additions & 0 deletions desktop-tauri/src-tauri/server/src/server/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ pub(crate) mod request_prepare;
// 同形的单开关端点,转换实施点在 `core::upstream::payload` 的 send_body,
// 见该文件模块头
pub mod role_compat;
// 第三方模型回答完自动折叠过程开关(GET/PUT /api/reasoning-collapse):与
// /api/developer-role-compat 同形的单开关端点,实施点在
// `core::protocol::responses` 的 Responses 事件重建层,见该文件模块头
pub mod reasoning_collapse;
pub mod routing_api;
pub mod routing_flow;
pub mod routing_groups;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ fn translate_completion(
},
TestProtocol::Responses => {
let response_body =
responses::responses_from_chat(&chat_completion, model, protocol_request);
responses::responses_from_chat(&chat_completion, model, protocol_request, false);
let raw_response = pipeline::capture_raw_json(&response_body);
if response_body.get("status").and_then(Value::as_str) == Some("failed") {
let message = response_body
Expand Down
Loading