ai: split OpenAI Responses and compatible providers - #475
martinhoyer wants to merge 3 commits into
Conversation
|
Note This review was generated with the assistance of an AI tool. Overall looks great and well-architected! A few quick observations and potential regression risks:
|
Thanks, already noticed 4096 is too low. Trying 16k and it was quite enough for sol with xhigh reasoning for a patch review. Wouldn't 65k be an overkill? |
|
@rgushchin adressing feedback in fixup commits, thanks.
|
|
Can you please rebase it and also squash fixups into corresponding commits? Thanks |
c7b1248 to
2657135
Compare
@rgushchin Done 🫡 |
2657135 to
bfb30a8
Compare
|
@rgushchin Rebased once more. Please let me know if you want me to keep it in sync with main or I shouldn't bother. |
|
Sorry, was busy with merging some other stuff. Can you, please, check some findings here? |
bfb30a8 to
9f0dfae
Compare
Thanks, addressed and rebased. I'm not sure about the "Missing validation in commit message" - did I miss some commit message requirements other than being signed? |
Sashiko review — v2Commit 2/3 —
|
Add a dedicated [ai.openai] settings table for the official OpenAI Responses API, separate from [ai.openai_compat], which remains tied to Chat Completions compatible services. Expose optional base URL, context window, output token limit, and reasoning effort settings while allowing the provider to select model-specific defaults when values are omitted. Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
Introduce a dedicated client for OpenAI's /v1/responses endpoint and select it for provider = "openai", while keeping the existing Chat Completions client behind provider = "openai-compatible". Preserve every response output item as opaque, versioned continuation state so reasoning data and server-issued function call identifiers are replayed exactly across tool turns. Keep this state out of persisted review logs and invalidate older cache entries that cannot provide lossless continuation. Bound response bodies, continuation metadata, and persistent cache payloads. Validate function call identifiers, arguments, and tool-result correlation before provider continuation. Preserve compatible JSON schemas without rewriting caller semantics, and prevent endpoint redirects. Allow compatible Chat Completions deployments to select the required token limit field explicitly. Also classify Responses API retryable errors, account for cached input tokens, satisfy JSON mode's prompt requirement, use current GPT-5.6 context defaults, and preserve legacy configurations without [ai.openai] with a deprecation warning. Validation: - make check-pr RANGE=upstream/main..HEAD Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
Document the dedicated OpenAI Responses provider, its configuration, and the migration from legacy [ai.openai_compat] settings. Update the checked-in settings and standalone example to use the new [ai.openai] table. Describe lossless output-item replay, JSON mode, cached-token accounting, and function call identifier handling. Refresh GPT-5.6 reasoning effort values and context limits to match the current API documentation. Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
9f0dfae to
20dc7e9
Compare
|
@rgushchin I've addressed the v2 review and then started dogfooding |
Sashiko review — v3Commit 2/3 —
|
Summary
Split the existing OpenAI integration into two distinct providers:
Motivation
Using OpenAI API with gpt-5.6 models currently fails on:
Shoehorning special temperature handling into the existing compatible provider did not solve the underlying problem. Modern OpenAI reasoning and tool-calling workflows ultimately need the Responses API, while third-party OpenAI-compatible services generally continue to expose Chat Completions.
Splitting openai and openai-compatible therefore seemed like the most practical and maintainable approach.
Changes
Not sure if there should be separate design doc as well.