Skip to content

feat(ai): add responses api format support for custom chat models - #8774

Open
SwamiKedar wants to merge 11 commits into
usebruno:mainfrom
SwamiKedar:feature/bruno-ai-responses-support
Open

SwamiKedar wants to merge 11 commits into
usebruno:mainfrom
SwamiKedar:feature/bruno-ai-responses-support

Conversation

@SwamiKedar

@SwamiKedar SwamiKedar commented Jul 25, 2026

Copy link
Copy Markdown

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:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Summary by CodeRabbit

  • New Features
    • Added per-model API format selection for OpenAI-compatible endpoints: Chat Completions or Responses.
    • Model selectors and the AI chat sidebar now indicate when the Responses API is active.
    • AI chat requests now use each model’s selected API format.
  • Bug Fixes
    • Existing model configurations default to Chat Completions when no format is specified.
    • Added validation to prevent unsupported API format selections.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7e5ac626-7233-442b-986e-e2035b54f8aa

📥 Commits

Reviewing files that changed from the base of the PR and between 7b4cae3 and bc12df0.

📒 Files selected for processing (1)
  • packages/bruno-electron/src/store/preferences.js

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

Adds selectable chat-completions and responses formats for AI models. Preferences, model metadata, chat submission, Electron IPC, and SDK dispatch now carry and apply the selected format. Existing models default to Chat Completions.

Changes

AI API format support

Layer / File(s) Summary
API format configuration
packages/bruno-app/src/components/Preferences/AI/*, packages/bruno-app/src/components/AiChatSidebar/index.js, packages/bruno-electron/src/store/preferences.js
Preferences validate and migrate apiFormat. Model settings select the format, and model labels identify Responses API entries.
Model metadata and dispatch
packages/bruno-electron/src/ipc/ai/providers.js
Built-in and custom models expose API formats. getModel selects the Responses or Chat Completions SDK method.
Chat request propagation
packages/bruno-app/src/providers/ReduxStore/slices/chat.js, packages/bruno-electron/src/ipc/ai/*
The selected format passes through Redux, IPC, resolveModel, and getModel during chat submission.

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
Loading

Merge Risk: ⚪ Minimal · up to bc12d

No actionable merge-blocking risk is established by the available review evidence.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Responses API support for custom AI chat models.
Linked Issues check ✅ Passed The changes satisfy #8773. The configuration stores and validates apiFormat values chat-completions and responses. New and migrated models default to chat-completions. The UI provides the form…
Out of Scope Changes check ✅ Passed The reported changes remain within #8773 scope. They update model configuration, validation, persistence, UI selection, IPC propagation, model resolution, and API dispatch for the requested Chat Compl…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 path_filters to narrow the review scope.


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.

❤️ Share

Models choose their pathway bright
Chat or Responses, set just right
Preferences keep the format known
IPC carries what was shown
SDK calls follow the selected tone
Existing models keep their home

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between c70c5fe and f7f78bd.

📒 Files selected for processing (8)
  • packages/bruno-app/src/components/AiChatSidebar/index.js
  • packages/bruno-app/src/components/Preferences/AI/CompatEndpointCard.js
  • packages/bruno-app/src/components/Preferences/AI/index.js
  • packages/bruno-app/src/providers/ReduxStore/slices/chat.js
  • packages/bruno-electron/src/ipc/ai/chat.js
  • packages/bruno-electron/src/ipc/ai/index.js
  • packages/bruno-electron/src/ipc/ai/providers.js
  • packages/bruno-electron/src/store/preferences.js

Comment thread packages/bruno-electron/src/ipc/ai/providers.js Outdated
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Azure OpenAI Responses API (POST /responses) in Bruno AI Chat

1 participant