Skip to content

fix(omni): 纯音频模型的多模态验证改用静音探测 - #1311

Open
Breadswim wants to merge 2 commits into
Open-Less:betafrom
Breadswim:fix/omni-verify-audio-only-models
Open

Breadswim wants to merge 2 commits into
Open-Less:betafrom
Breadswim:fix/omni-verify-audio-only-models

Conversation

@Breadswim

@Breadswim Breadswim commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

摘要

Fixes #1305

多模态「验证」对只接受音频输入的模型(OpenAI gpt-audio-1.5)改用静音音频探测,不再因纯文本探测被拒而误报失败;设置页对这类模型显示与探测方式一致的提示。

修复 / 新增 / 改进

  • validate_shared_omni_provider:
    • OpenAI 名称含 audio 的模型直接用 0.5 秒合成静音探测,与 Gemini 专用转写分支相同;
    • 其它模型仍先发文本探测;若以 4xx 拒绝(401 / 403 / 404 / 429 除外)且错误内容提到 audio / 音频(OpenAI:This model requires that either input content or output modality contain audio.),再用静音探测一次;
    • 静音的回复为空也视为通过。
  • 设置页(ProvidersSection):上述 OpenAI 音频模型与 Gemini 专用转写一样走 audioValidation,提示显示「手动发起一次真实请求…」,成功时显示「已通过短静音音频的连接验证…」,不再显示「文本连通性通过」。沿用现有文案,未新增翻译。

兼容

测试计划

  • 命令:cargo test --locked -p openless-core;cargo clippy --locked -p openless-core --all-targets -- -D warnings;npm run build
  • 结果:全部通过(1,654 个测试,其中库测试 1,418 个)。新增 3 个本地 HTTP 服务测试:OpenAI 音频模型直接静音探测;文本探测因需要音频被拒后改用静音探测;与音频无关的 400 原样报错且不重试(服务端备有第二个成功响应,一旦重试测试即失败)。
  • 前端:npm run build 通过,src 下 65 个前端单元测试文件全部通过(含审查后的修改)。scripts/frontend-test-runner.mjs 中的 ci-changed-areas 合同测试在本地未改动的代码上同样失败(38 项,与本地环境有关),与本 PR 无关。
  • 本地打包实测(macOS):前一版本(文本探测被拒后回退静音)中 gpt-audio-1.5、gpt-audio-mini 点击「验证」均通过;最终版本对这类模型直接用静音探测,由新增测试覆盖。

审查后的修改

第二个提交 d99519e4 处理了 Codex 的意见:未填写模型时,设置页按预设默认模型 gpt-4o-audio-preview 判断,与 Core 的回退一致。

🤖 Generated with Claude Code

多模态「验证」对通用模型只发纯文本探测。OpenAI gpt-audio-1.5 要求输入
或输出至少一方包含音频,纯文本请求必然返回 HTTP 400,配置正确也显示
验证失败。

- OpenAI 名称含 audio 的模型直接用 0.5 秒合成静音探测,与 Gemini 专用转写
  分支相同;设置页对这类模型也显示静音探测的说明和成功提示,不再显示
  「文本连通性通过」。
- 其它模型仍先发文本探测;若以 4xx 拒绝(鉴权、不存在、限流除外)且错误
  提到 audio / 音频,再用静音探测一次。
- 静音的回复为空也视为通过;其它错误照常报错,不重试。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-31T07:21:18.607532Z
We couldn’t complete this review. Comment @codex review to try again.
d99519e New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d7ad22d105

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

// OpenAI audio chat models reject text-only requests, so Verify probes them with
// short silence too (issue #1305).
const openaiAudio =
committedOmniProvider === 'openai' && omniModel.trim().toLowerCase().includes('audio');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Classify the effective default OpenAI model as audio

When omni.model is unset or cleared for the built-in OpenAI preset, this expression sees an empty string even though Core falls back to default_omni_model("openai") in crates/openless-core/src/provider_rules.rs:746-749, which is gpt-4o-audio-preview; validate_shared_omni_provider therefore sends silence while the settings page takes the non-audio branch and reports a text-only check. Use the effective preset/default model here so this supported default configuration gets the audio hint and success message.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修复(d99519e4):未填写模型时,设置页按预设默认模型 gpt-4o-audio-preview 判断,与 Core 的回退一致,会显示静音探测的提示和成功文案。

未填写模型时,Core 使用 OpenAI 预设的默认模型 gpt-4o-audio-preview,
「验证」因此直接用静音探测;设置页之前按空模型判断,仍显示文本连通性
的提示。现在与 Core 一致,未填写时按预设默认模型判断。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[omni] 多模态「验证」对 OpenAI gpt-audio-1.5 必然返回 400

1 participant