Skip to content

feat(models): add OpenAI Codex reasoning provider - #40

Merged
Luhaozhu merged 2 commits into
mainfrom
feat/openai-codex-reasoning-provider
Jul 28, 2026
Merged

feat(models): add OpenAI Codex reasoning provider#40
Luhaozhu merged 2 commits into
mainfrom
feat/openai-codex-reasoning-provider

Conversation

@Luhaozhu

@Luhaozhu Luhaozhu commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary / 概述

  • Add a dedicated OpenAI / Codex provider preset for OpenAI Responses-backed Chat Completions gateways.
  • Send reasoning_effort at the request root for that provider while retaining the nested chat_template_kwargs compatibility controls.
  • Mark dedicated OpenAI streams as structured-reasoning streams so ordinary response text stays in the answer when the model emits no reasoning_content.
  • Preserve the existing generic OpenAI 兼容 inline <think> behavior and add regression coverage for both protocols.

Validation:

  • PYTHONPATH=src/backend pytest -q src/backend/tests/llm/test_openai_provider.py src/backend/tests/orchestration/test_structured_reasoning_protocol.py src/backend/tests/api/test_model_connection_probe.py src/backend/tests/services/test_user_model_selection.py — 11 passed.
  • Frontend i18n check, TypeScript production build, and targeted ESLint for src/hooks/chatStream.ts passed.
  • A live streaming gateway check with reasoning_effort=max produced both ThinkingBlock and TextBlock; no reasoning text or credentials are included here.
  • git diff --check passed. The repository has no root npm run preflight script, so the relevant backend and frontend checks above were used.

Related issue / 关联 Issue

Follow-up to #39.

Type of change / 变更类型

  • 📖 Documentation (document/**, README*.md)
  • 🧩 Example / sample (examples/**)
  • 🔧 Repo meta (CI, templates, .github/**)
  • Other (please describe / 请说明): Maintainer sync of an upstream provider adaptation and streaming display fix.

Checklist / 检查项

  • My change only touches non-generated paths (docs / examples / repo meta). 仅改动非生成路径。
  • Links and code snippets were verified. 链接与代码片段已验证。
  • For bilingual docs, I updated both document/en/** and document/zh-CN/** where applicable. 双语文档已同步更新(如适用)。 Not applicable; no documentation changed.
  • I read CONTRIBUTING.md. 我已阅读贡献指南。

@Luhaozhu
Luhaozhu merged commit 33c6e15 into main Jul 28, 2026
3 checks passed
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.

1 participant