ai: split OpenAI Responses and compatible providers - #475
Conversation
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. 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 reject legacy-only [ai.openai_compat] configurations with an actionable migration error. 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>
|
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? |
…actory Raise the default output budget to 16K and include the provider-reported reason and output-token usage when a response is incomplete. Treat failed, nonterminal, and contradictory response states as typed provider errors, while tolerating null usage accounting in error responses. Normalize recognized API roots to the Responses endpoint and forward sampling temperature outside known GPT-5 and o-series reasoning families. Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
…actory Keep the legacy request hash for providers whose response representation did not change, preserving their existing cache entries. Apply the versioned salt only to the dedicated OpenAI Responses provider, where older cached tool responses lack lossless continuation metadata. Add coverage for exact legacy hashes and provider-specific format selection. Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
…plit Set the recommended and documented output budget to 16K, explaining that reasoning and visible output share the Responses API limit. Document the static default endpoint, proxy-root normalization, model-aware temperature handling, failed-response errors, incomplete diagnostics, and provider-scoped cache compatibility behavior. Signed-off-by: Martin Hoyer <mhoyer@redhat.com>
|
@rgushchin adressing feedback in fixup commits, thanks.
|
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.