Skip to content

fix: Build fix for provider config#2391

Merged
akshaydeo merged 1 commit intov1.5.0from
03-30-fix_build_fix_for_provider_config
Apr 6, 2026
Merged

fix: Build fix for provider config#2391
akshaydeo merged 1 commit intov1.5.0from
03-30-fix_build_fix_for_provider_config

Conversation

@roroghost17
Copy link
Copy Markdown
Contributor

@roroghost17 roroghost17 commented Mar 30, 2026

Summary

Refactored OpenAI configuration form to use a centralized utility function for building provider update payloads, improving code consistency and maintainability.

Changes

  • Replaced inline object construction in OpenAIConfigFormFragment with buildProviderUpdatePayload utility function
  • Added openai_config field support to the buildProviderUpdatePayload function
  • Minor formatting improvements to help text for better readability

Type of change

  • Refactor
  • Bug fix
  • Feature
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Verify that OpenAI provider configuration updates work correctly:

  1. Navigate to workspace providers settings
  2. Configure OpenAI provider settings
  3. Toggle the "Disable Store" option
  4. Save the configuration
  5. Verify the settings are persisted correctly
# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

N/A - Internal refactoring with no visual changes

Breaking changes

  • Yes
  • No

Related issues

N/A

Security considerations

No security implications - this is an internal refactoring that maintains the same functionality.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 30, 2026

📝 Walkthrough

Walkthrough

buildProviderUpdatePayload now includes openai_config; the OpenAI config form imports that util (import order changed only). A new exported Zod schema/type openaiConfigFormSchema/OpenAIConfigFormSchema were added and addProviderRequestSchema/updateProviderRequestSchema accept optional openai_config.

Changes

Cohort / File(s) Summary
Form Fragment
ui/app/workspace/providers/fragments/openaiConfigFormFragment.tsx
Import ordering adjusted to import buildProviderUpdatePayload earlier; paragraph helper text reflowed without changing wording or form behavior (submit, mutation, toast, reset, switch unchanged).
Utility Update
ui/app/workspace/providers/views/utils.ts
buildProviderUpdatePayload(provider, updates) now includes openai_config: updates.openai_config ?? provider.openai_config in the returned payload.
Schemas / Types
ui/lib/types/schemas.ts
Added exported openaiConfigFormSchema (with disable_store: boolean) and OpenAIConfigFormSchema; extended addProviderRequestSchema and updateProviderRequestSchema to accept optional top-level openai_config?: openaiConfigFormSchema.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through imports, neat and spry,
Tucked configs where the payloads lie.
A schema added, tidy, bright,
I twitched my nose and bounded light. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title "fix: Build fix for provider config" is vague and uses generic language like "Build fix" that doesn't clearly convey the specific change, which is refactoring OpenAI config form to use a centralized utility function. Consider a more specific title such as "refactor: Centralize OpenAI config payload construction" or "fix: Use centralized utility for provider config updates" to better describe the actual changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description covers all required template sections with appropriate detail: summary, changes, type of change, affected areas, testing steps, breaking changes status, and checklist items are all completed.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 03-30-fix_build_fix_for_provider_config

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

Copy link
Copy Markdown
Contributor Author

roroghost17 commented Mar 30, 2026

@roroghost17 roroghost17 marked this pull request as ready for review March 30, 2026 11:51
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 30, 2026

Confidence Score: 5/5

  • Safe to merge — the build fix is correct and functional behaviour is unchanged.
  • All remaining findings are P2 style/maintenance suggestions; no P0 or P1 defects were identified. The core fix (moving the schema declaration and adding the openai_config field) is correct and self-consistent.
  • ui/lib/types/schemas.ts — schema reuse and missing field in modelProviderConfigSchema are worth a follow-up, but do not block this PR.

Important Files Changed

Filename Overview
ui/app/workspace/providers/fragments/openaiConfigFormFragment.tsx Import reordered (alphabetically) and help-text line breaks reformatted; no functional logic changes.
ui/app/workspace/providers/views/utils.ts Adds openai_config passthrough to buildProviderUpdatePayload; correctly uses ?? to prefer the incoming update over the existing provider value.
ui/lib/types/schemas.ts Moves openaiConfigFormSchema earlier to fix a temporal-dead-zone build error, then adds openai_config to both request schemas; however, the form schema (required disable_store) is reused where the API type treats the field as optional, and modelProviderConfigSchema/formModelProviderConfigSchema are not updated to include the new field.

Reviews (5): Last reviewed commit: "fix/Build fix for provider config" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/app/workspace/providers/views/utils.ts`:
- Line 18: The Zod schema updateProviderRequestSchema is missing the optional
openai_config field declared in the TypeScript UpdateProviderRequest interface;
add openai_config: z.optional(OpenAIConfig schema) (use the same OpenAIConfig
schema used elsewhere in ui/lib/types/schemas.ts) to updateProviderRequestSchema
so it matches the type and the payload produced by buildProviderUpdatePayload(),
ensuring the field is optional and uses the correct schema name.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 477327f3-f440-433b-ba9f-e560e8d0927a

📥 Commits

Reviewing files that changed from the base of the PR and between c390fac and 0e05b67.

📒 Files selected for processing (2)
  • ui/app/workspace/providers/fragments/openaiConfigFormFragment.tsx
  • ui/app/workspace/providers/views/utils.ts

Comment thread ui/app/workspace/providers/views/utils.ts
@impoiler impoiler force-pushed the 03-30-fix_build_fix_for_provider_config branch from 0e05b67 to adbf239 Compare March 30, 2026 13:56
@roroghost17 roroghost17 force-pushed the 03-30-fix_build_fix_for_provider_config branch from adbf239 to a6d801f Compare March 31, 2026 07:01
coderabbitai[bot]
coderabbitai Bot previously approved these changes Mar 31, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 1, 2026
@roroghost17 roroghost17 changed the title fix/Build fix for provider config fix: Build fix for provider config Apr 3, 2026
Copy link
Copy Markdown
Contributor

akshaydeo commented Apr 6, 2026

Merge activity

  • Apr 6, 8:14 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 6, 8:14 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo merged commit b88477f into v1.5.0 Apr 6, 2026
16 of 17 checks passed
@akshaydeo akshaydeo deleted the 03-30-fix_build_fix_for_provider_config branch April 6, 2026 08:14
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.

3 participants