feat(ai): add responses api format support for custom chat models - #8774
SwamiKedar wants to merge 11 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughAdds selectable ChangesAI API format support
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant AiChatSidebar
participant ReduxChat
participant ElectronIPC
participant ModelResolver
participant VercelAISDK
AiChatSidebar->>ReduxChat: submit selected model API format
ReduxChat->>ElectronIPC: send renderer:ai-chat-stream payload
ElectronIPC->>ModelResolver: resolve model with apiFormatOverride
ModelResolver->>VercelAISDK: call responses or chat API
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking risk is established by the available review evidence. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Models choose their pathway bright Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js`:
- Around line 406-414: Add an accessible name to the API format select in the
model row by associating it with a visually hidden label or supplying a
descriptive aria-label that identifies the model’s API format; preserve the
existing value, change handler, options, and disabled behavior.
In `@packages/bruno-electron/src/ipc/ai/providers.js`:
- Around line 231-243: Validate apiFormatOverride/format in the provider
dispatch logic before selecting an API, allowing only 'chat-completions' and
'responses'. Throw a clear unsupported-format error for any other non-empty
value, while preserving the existing Responses API and Chat Completions dispatch
behavior for valid formats.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 345dfe17-a63d-4d37-a54c-101125680c50
📒 Files selected for processing (8)
packages/bruno-app/src/components/AiChatSidebar/index.jspackages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.jspackages/bruno-app/src/components/Preferences/AI/index.jspackages/bruno-app/src/providers/ReduxStore/slices/chat.jspackages/bruno-electron/src/ipc/ai/chat.jspackages/bruno-electron/src/ipc/ai/index.jspackages/bruno-electron/src/ipc/ai/providers.jspackages/bruno-electron/src/store/preferences.js
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Description
This PR adds support for the OpenAI/Azure Responses API format for custom AI chat models.
Previously, Bruno AI Chat only supported the Chat Completions API (
POST /chat/completions) for custom models. However, newer Azure OpenAI models such as GPT-5-Codex only support the Responses API (POST /responses) and cannot be used with the existing implementation.This change introduces support for both request formats by allowing the custom chat model configuration to specify the API format. The existing Chat Completions API remains the default to ensure full backward compatibility, while models that require the Responses API can now be configured accordingly.
This enables Bruno AI Chat to work seamlessly with newer Azure OpenAI deployments and other providers that expose the Responses API.
Related Issue: Closes #8773
Contribution Checklist:
Publishing to New Package Managers
Summary by CodeRabbit