Skip to content

[Feat] Add custom request fields for OpenAI-compatible providers - #1350

Merged
edelauna merged 12 commits into
mainfrom
roomote/openai-extra-body-visual-baseline
Sep 3, 2026
Merged

[Feat] Add custom request fields for OpenAI-compatible providers#1350
edelauna merged 12 commits into
mainfrom
roomote/openai-extra-body-visual-baseline

Conversation

@zoomote

@zoomote zoomote Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

What changed

OpenAI-compatible provider profiles now include a localized Extra Body JSON editor for provider-specific request fields. Zoo Code validates the JSON, rejects runtime-managed and prototype-sensitive keys, persists it only for OpenAI-compatible profiles, and merges safe fields into streaming, non-streaming, O-family, and single-completion requests.

The settings control uses VS Code-themed components, accessible validation feedback, translations for every supported locale, and unclipped full-height visual baselines for dark, light, high-contrast, and high-contrast-light themes. The visual tests apply each theme after the shared gallery mount so every baseline exercises its intended VS Code theme.

Focused assertions cover the Extra Body copy, placeholder, ARIA relationships, reserved-key formatting, and non-OpenAI bypass.

Why this change was made

Providers such as Sail Research require request-body metadata to select features such as the balanced completion window. Custom headers cannot express those fields, so users previously needed a proxy. This closes #1104.

Impact

Users can configure provider-specific fields such as { "metadata": { "completion_window": "balanced" } } directly in an OpenAI-compatible profile without allowing custom JSON to override Zoo Code's model, messages, tools, streaming, reasoning, temperature, or token limits.

Related PRs

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna
edelauna marked this pull request as ready for review August 28, 2026 01:11
@edelauna
edelauna force-pushed the roomote/openai-extra-body-visual-baseline branch from 97e9415 to 5bf75a2 Compare August 28, 2026 01:11
@github-actions github-actions Bot added awaiting-review PR changes are ready and waiting for maintainer re-review has-conflicts PR has merge conflicts with the base branch and removed awaiting-review PR changes are ready and waiting for maintainer re-review has-conflicts PR has merge conflicts with the base branch labels Aug 28, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Review process

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

  1. Required CI checks pass.
  2. The workflow starts CodeRabbit automatically.
  3. For eligible human-authored PRs, CodeRabbit reviews and approves the latest commit.
  4. A human maintainer reviews and approves after CodeRabbit.

Current step: The required review sequence passed. Remaining merge requirements apply.

@github-actions github-actions Bot added awaiting-review PR changes are ready and waiting for maintainer re-review has-conflicts PR has merge conflicts with the base branch awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed has-conflicts PR has merge conflicts with the base branch awaiting-review PR changes are ready and waiting for maintainer re-review awaiting-maintainer CodeRabbit approved; waiting for a human maintainer labels Aug 29, 2026
@zoomote
zoomote Bot force-pushed the roomote/openai-extra-body-visual-baseline branch from 9b78833 to 2423f86 Compare September 3, 2026 03:36
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed awaiting-maintainer CodeRabbit approved; waiting for a human maintainer labels Sep 3, 2026
@zoomote
zoomote Bot force-pushed the roomote/openai-extra-body-visual-baseline branch from 6b437a1 to a865df1 Compare September 3, 2026 12:32
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed awaiting-maintainer CodeRabbit approved; waiting for a human maintainer labels Sep 3, 2026
@edelauna

edelauna commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: f03d122a-4bbb-4a54-aa00-d30c01cb8182

📥 Commits

Reviewing files that changed from the base of the PR and between b2f63d3 and a865df1.

⛔ Files ignored due to path filters (5)
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-compatible-azure-guidance-dark.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-compatible-extra-body-dark.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-compatible-extra-body-high-contrast-light.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-compatible-extra-body-high-contrast.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
  • webview-ui/src/components/settings/providers/__tests__/__screenshots__/openai-compatible-extra-body-light.png is excluded by !**/*.png, !webview-ui/**/__screenshots__/**
📒 Files selected for processing (33)
  • packages/types/src/__tests__/provider-settings.test.ts
  • packages/types/src/provider-settings.ts
  • packages/types/src/provider-settings/index.ts
  • packages/types/src/provider-settings/openai.ts
  • src/api/providers/__tests__/openai.spec.ts
  • src/api/providers/openai.ts
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • webview-ui/src/utils/validate.ts

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

📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (10)
Treat model, provider, MCP, path, command, and tool data as untrusted.

⚙️ CodeRabbit configuration file

Files:

  • src/api/providers/__tests__/openai.spec.ts
  • src/api/providers/openai.ts
For persisted settings, verify the complete schema/storage/runtime/webview round trip, shared default semantics, and focused true plus false/unset tests.

⚙️ CodeRabbit configuration file

Files:

  • packages/types/src/provider-settings.ts
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • packages/types/src/provider-settings/index.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • packages/types/src/provider-settings/openai.ts
  • packages/types/src/__tests__/provider-settings.test.ts
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • src/api/providers/__tests__/openai.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • packages/types/src/__tests__/provider-settings.test.ts
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • packages/types/src/provider-settings.ts
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • packages/types/src/provider-settings/index.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • src/api/providers/__tests__/openai.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • src/api/providers/openai.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • packages/types/src/provider-settings/openai.ts
  • packages/types/src/__tests__/provider-settings.test.ts
  • webview-ui/src/utils/validate.ts
Check React state and effect dependencies, cleanup, accessibility, i18n, and light/dark theme behavior.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • webview-ui/src/i18n/locales/pl/settings.json
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • webview-ui/src/i18n/locales/id/settings.json
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/utils/validate.ts
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.

⚙️ CodeRabbit configuration file

Files:

  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • src/api/providers/__tests__/openai.spec.ts
  • src/api/providers/openai.ts
Act as an adversarial second-opinion reviewer.

⚙️ CodeRabbit configuration file

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • packages/types/src/provider-settings.ts
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • webview-ui/src/i18n/locales/vi/settings.json
  • webview-ui/src/i18n/locales/zh-CN/settings.json
  • webview-ui/src/i18n/locales/ca/settings.json
  • webview-ui/src/i18n/locales/it/settings.json
  • webview-ui/src/i18n/locales/fr/settings.json
  • webview-ui/src/i18n/locales/en/settings.json
  • packages/types/src/provider-settings/index.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/i18n/locales/ru/settings.json
  • webview-ui/src/i18n/locales/es/settings.json
  • webview-ui/src/i18n/locales/nl/settings.json
  • webview-ui/src/i18n/locales/pt-BR/settings.json
  • webview-ui/src/i18n/locales/zh-TW/settings.json
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • webview-ui/src/i18n/locales/pl/settings.json
  • src/api/providers/__tests__/openai.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • webview-ui/src/i18n/locales/ja/settings.json
  • webview-ui/src/i18n/locales/tr/settings.json
  • src/api/providers/openai.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • packages/types/src/provider-settings/openai.ts
  • webview-ui/src/i18n/locales/id/settings.json
  • packages/types/src/__tests__/provider-settings.test.ts
  • webview-ui/src/i18n/locales/hi/settings.json
  • webview-ui/src/utils/validate.ts
  • webview-ui/src/i18n/locales/ko/settings.json
  • webview-ui/src/i18n/locales/de/settings.json
Add focused tests for UI binding and save behavior, persistence or normalization, and the value returned by `getStateToPostToWebview()`, including true and false/unset cases when defaults could hide omissions.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • src/api/providers/__tests__/openai.spec.ts
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • packages/types/src/__tests__/provider-settings.test.ts
Fix lint violations in new TypeScript code instead of suppressing them.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • webview-ui/playwright/gallery/stories.tsx
  • packages/types/src/provider-settings.ts
  • webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx
  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • packages/types/src/provider-settings/index.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.spec.tsx
  • webview-ui/src/components/settings/providers/OpenAICompatible.tsx
  • src/api/providers/__tests__/openai.spec.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.tsx
  • webview-ui/src/utils/__tests__/validate.spec.ts
  • src/api/providers/openai.ts
  • webview-ui/src/components/settings/providers/__tests__/OpenAICompatible.visual.fixture.tsx
  • packages/types/src/provider-settings/openai.ts
  • packages/types/src/__tests__/provider-settings.test.ts
  • webview-ui/src/utils/validate.ts
After editing a file, run ESLint with pruning and zero warnings for that relative file, and confirm its suppression count did not increase.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • src/core/config/__tests__/ProviderSettingsManager.spec.ts
  • src/api/providers/__tests__/openai.spec.ts
  • src/api/providers/openai.ts
🔇 Additional comments (17)
webview-ui/src/i18n/locales/en/settings.json (1)

543-544: LGTM!

Also applies to: 1121-1125

webview-ui/src/i18n/locales/ca/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/de/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/pt-BR/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/ru/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/tr/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/vi/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/zh-CN/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/es/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/fr/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/hi/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/id/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/it/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/ja/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/ko/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/nl/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045

webview-ui/src/i18n/locales/pl/settings.json (1)

463-464: LGTM!

Also applies to: 1041-1045


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added an optional Extra Body JSON field for OpenAI-compatible providers.
    • Extra Body parameters are merged into API requests while provider-managed fields remain protected.
    • Added validation for malformed JSON, non-object values, and reserved fields, with inline localized error messages.
    • Added localized settings text across supported languages.
  • Tests

    • Added coverage for configuration persistence, request handling, validation, and visual rendering.

Walkthrough

Adds an optional openAiExtraBody JSON setting for OpenAI-compatible providers. The change validates and filters reserved fields, persists compatible configuration, merges allowed fields into requests, and adds UI, localization, visual coverage, and tests.

Changes

OpenAI-compatible extra request body

Layer / File(s) Summary
Extra body parsing and provider schema
packages/types/src/provider-settings/*, packages/types/src/__tests__/provider-settings.test.ts
Adds JSON parsing, object validation, reserved-key filtering, Zod integration, public exports, and parser tests.
Configuration validation and persistence
webview-ui/src/utils/validate.ts, webview-ui/src/utils/__tests__/validate.spec.ts, src/core/config/__tests__/ProviderSettingsManager.spec.ts, webview-ui/src/i18n/locales/*/settings.json
Validates extra body values for OpenAI-compatible providers, formats localized errors, verifies provider-specific persistence, and adds translations.
Extra body API request merging
src/api/providers/openai.ts, src/api/providers/__tests__/openai.spec.ts
Merges allowed extra fields into chat, completion, and O3-family requests. Request-owned fields take precedence.
Extra body settings UI and coverage
webview-ui/src/components/settings/providers/OpenAICompatible.tsx, webview-ui/src/components/settings/providers/__tests__/*, webview-ui/src/components/settings/__tests__/ApiOptions.spec.tsx, webview-ui/playwright/gallery/stories.tsx
Adds the editable Extra Body textarea, validation state, visual fixture and story, theme screenshots, component mocks, and UI tests.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: ⚪ Minimal · up to a865d

The extra request-body setting is validated, persisted for applicable profiles, and merged across supported request paths without an unresolved material issue.

Sequence Diagram(s)

sequenceDiagram
  participant ProviderSettings
  participant OpenAiHandler
  participant OpenAIAPI
  ProviderSettings->>OpenAiHandler: provide openAiExtraBody
  OpenAiHandler->>OpenAiHandler: merge extra fields with request options
  OpenAiHandler->>OpenAIAPI: submit request with request-owned fields preserved
Loading

Suggested reviewers: webmad

🚥 Pre-merge checks | ✅ 5 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 15 files. (18 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Regression Evidence ⚠️ Warning The new Extra Body validation call in validateApiConfigurationExcludingModelErrors lacks a focused non-OpenAI bypass test. The implementation calls validateOpenAiExtraBody at `webview-ui/src/utils… Add a focused test in webview-ui/src/utils/__tests__/validate.spec.ts with a non-OpenAI configuration and invalid openAiExtraBody, then assert that validateApiConfigurationExcludingModelErrors returns undefined. Keep the existing `v…
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the feature, motivation, implementation scope, validation behavior, request integration, testing coverage, and linked issue. It does not use the repository template he…
Linked Issues check ✅ Passed The implementation satisfies the primary requirements in [#1104]. It adds an Extra Body JSON editor, validates object input, preserves user-defined fields such as provider metadata, rejects reserved r…
Out of Scope Changes check ✅ Passed The changes remain focused on the linked feature. Type definitions, request handling, configuration persistence, UI validation, localization, tests, and visual coverage all support the Extra Body capa…
Title check ✅ Passed The title clearly and concisely describes the primary change: adding custom request fields for OpenAI-compatible providers.
Trust And Persistence Invariants ✅ Passed No explicit trust or persistence failure is introduced. parseOpenAiExtraBody parses only JSON objects, rejects invalid/non-object input, and removes prototype-sensitive and request-owned keys before…
Full details: Description check

Explanation

The description clearly explains the feature, motivation, implementation scope, validation behavior, request integration, testing coverage, and linked issue. It does not use the repository template headings or provide explicit reproducible test steps and checklist selections, but the content is sufficiently complete.

Full details: Linked Issues check

Explanation

The implementation satisfies the primary requirements in [#1104]. It adds an Extra Body JSON editor, validates object input, preserves user-defined fields such as provider metadata, rejects reserved request-owned and prototype-sensitive keys, and merges safe fields into OpenAI-compatible requests. It also persists the setting only for applicable profiles.

Full details: Out of Scope Changes check

Explanation

The changes remain focused on the linked feature. Type definitions, request handling, configuration persistence, UI validation, localization, tests, and visual coverage all support the Extra Body capability.

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 15 files. (18 skipped: 18 unsupported.)

Full details: Regression Evidence

Explanation

The new Extra Body validation call in validateApiConfigurationExcludingModelErrors lacks a focused non-OpenAI bypass test. The implementation calls validateOpenAiExtraBody at webview-ui/src/utils/validate.ts:353, and the guard must ignore invalid openAiExtraBody for non-OpenAI providers. The added test at webview-ui/src/utils/__tests__/validate.spec.ts:338 checks this only through validateApiConfiguration; the exclusion entry point has tests for invalid OpenAI input but no equivalent non-OpenAI case. A regression that removes or misroutes the new exclusion-path call would therefore pass the focused tests. The other request-path tests and all four Extra Body Playwright snapshots are present.

Resolution

Add a focused test in webview-ui/src/utils/__tests__/validate.spec.ts with a non-OpenAI configuration and invalid openAiExtraBody, then assert that validateApiConfigurationExcludingModelErrors returns undefined. Keep the existing validateApiConfiguration bypass assertion so both public validation entry points are covered.

Full details: Trust And Persistence Invariants

Explanation

No explicit trust or persistence failure is introduced. parseOpenAiExtraBody parses only JSON objects, rejects invalid/non-object input, and removes prototype-sensitive and request-owned keys before OpenAiHandler merges the remaining fields. Request fields are spread after the extra body, so managed values retain precedence. The provider schema and saveConfig discriminated parsing preserve the field only for the OpenAI provider and strip it for other providers. saveConfig awaits the locked store operation, and the UI includes the field in the existing awaited profile-save path. No changed code logs, executes, or automatically discloses secrets or PII.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch roomote/openai-extra-body-visual-baseline

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/types/src/__tests__/provider-settings.test.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

packages/types/src/provider-settings.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

packages/types/src/provider-settings/index.ts

ESLint skipped: the matched ESLint configuration already failed (missing-dependency).

  • 12 others

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

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

@edelauna
edelauna added this pull request to the merge queue Sep 3, 2026
@github-actions github-actions Bot removed the awaiting-maintainer CodeRabbit approved; waiting for a human maintainer label Sep 3, 2026
Merged via the queue into main with commit d033a14 Sep 3, 2026
21 of 22 checks passed
@edelauna
edelauna deleted the roomote/openai-extra-body-visual-baseline branch September 3, 2026 22:24
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.

Feature Request: Support custom request body parameters (extra_body) for API providers

2 participants