Skip to content

fix: resolve issue where some models do not use modelInfo parameter - #15830

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/model-provider-0609
Jun 9, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/model-provider-0609

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

What problem does this PR solve?

fix: resolve issue where some models do not use modelInfo parameter

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. 🐞 bug Something isn't working, pull request that fix bug. labels Jun 9, 2026
@dcc123456
dcc123456 marked this pull request as draft June 9, 2026 03:41
@dcc123456
dcc123456 marked this pull request as ready for review June 9, 2026 03:41
@coderabbitai

coderabbitai Bot commented Jun 9, 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 43170e0b-dd79-4a8b-9679-76f49fc789dd

📥 Commits

Reviewing files that changed from the base of the PR and between 93e4f6b and 1dcd47d.

📒 Files selected for processing (7)
  • web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/local-llm-configs.ts
  • web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/provider-config-map.ts
  • web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/utils.ts
  • web/src/pages/user-setting/setting-model/modal/provider-modal/hooks/use-list-models-picker.ts
  • web/src/pages/user-setting/setting-model/modal/provider-modal/hooks/use-provider-modal-actions.ts
  • web/src/pages/user-setting/setting-model/modal/provider-modal/types.ts
  • web/src/pages/user-setting/setting-model/payload-utils.ts

📝 Walkthrough

Walkthrough

This PR refactors the provider modal configuration transform contract across the LLM provider setup flow. The core change consolidates modelInfo assembly from separate function parameters into form values, introduces a new buildModelInfoFromValues() utility, and updates all provider transforms and their callers to pass single merged payload objects instead of multiple arguments.

Changes

Provider Modal Transform Unification

Layer / File(s) Summary
Type contract and buildModelInfoFromValues utility
web/src/pages/user-setting/setting-model/modal/provider-modal/types.ts, web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/utils.ts
ProviderConfig.verifyTransform and submitTransform signatures change from (values, modelInfo) to (values). New exported utility buildModelInfoFromValues(values) constructs IModelInfo[] from form values using resolution order: direct model_info array, fallback to model_name/model_type/max_tokens, and optional is_tools extra field.
Hook callers update verifyTransform/submitTransform invocations
web/src/pages/user-setting/setting-model/modal/provider-modal/hooks/use-provider-modal-actions.ts, web/src/pages/user-setting/setting-model/modal/provider-modal/hooks/use-list-models-picker.ts
handleVerify, handleSubmit, and handleListOpenChange now call transforms with merged payload { ...values, model_info: modelInfoList } instead of separate (values, modelInfoList) arguments.
Local LLM configs refactor with new signature
web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/local-llm-configs.ts
buildLocalConfig() now accepts optional customFields and docLink parameters; merges customFields into default fields by replacing same-name entries and appending new ones; returns docLink metadata in config. Embedded verifyTransform/submitTransform use buildModelInfoFromValues(values) instead of receiving modelInfo parameter. TokenPony factory entry removed.
Provider-specific transform implementations
web/src/pages/user-setting/setting-model/modal/provider-modal/field-config/provider-config-map.ts
Updates verifyTransform/submitTransform across all providers (Azure OpenAI, VolcEngine, Google Cloud, Tencent Cloud, XunFei Spark, Baidu YiYan, Fish Audio, OpenDataLoader, PaddleOCR, MinerU) to use buildModelInfoFromValues(values) instead of parameter-based modelInfo. Changes several providers' apiKey/api_key from JSON strings to nested objects. OpenDataLoader opendataloader_apiserver label changed to baseUrl.
Payload splitting and structuring
web/src/pages/user-setting/setting-model/payload-utils.ts
splitProviderPayload() refactored to destructure instance fields (instance_name, llm_factory, base_url, api_base, region, model_info) and spread remaining fields into instancePayload, preserving model_info propagation.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • infiniflow/ragflow#15768: Refactors the provider-modal config transform contract by moving modelInfo assembly into verifyTransform/submitTransform and updating callers to pass merged payloads, with overlapping changes to the modal and list-models picker hooks.

Suggested labels

🐞 bug, 🧰 typescript, size:L

Suggested reviewers

  • wangq8
  • JinHai-CN

Poem

A rabbit hops through modal views,
Transforms unified, old paths renewed.
model_info finds its rightful place,
Inside the form's now-single grace. 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description is minimal and lacks substantive detail about the problem, solution, or affected components despite the template requiring background context. Expand the description to explain what the modelInfo parameter issue was, how it manifested, and which specific providers/models were affected.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring how modelInfo is handled across multiple provider configurations by removing it as a separate parameter.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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 and usage tips.

@dcc123456 dcc123456 added the ci Continue Integration label Jun 9, 2026
@dcc123456
dcc123456 marked this pull request as draft June 9, 2026 03:42
@dcc123456
dcc123456 marked this pull request as ready for review June 9, 2026 03:42
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.16%. Comparing base (93e4f6b) to head (1dcd47d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15830   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          668      668           
  Misses         29       29           
  Partials       20       20           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@wangq8
wangq8 merged commit 298a23f into infiniflow:main Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants