Skip to content

fix: resolve provider aliases for extractor models - #19824

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:go057
Sep 18, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
buua436:go057

Conversation

@buua436

@buua436 buua436 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix Extractor model resolution for providers whose configured provider name differs from the runtime driver name, such as ZHIPU-AI and zhipu.

GetPreconfiguredDriver now falls back to matching the registered driver name, allowing models such as glm-4-flash to be used for automatic question and keyword extraction.

Type of change

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

@buua436
buua436 requested a review from wangq8 September 18, 2026 05:09
@buua436 buua436 added the ci Continue Integration label Sep 18, 2026
@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 6468f1e6-73c4-4226-af88-07638a7c1978

📥 Commits

Reviewing files that changed from the base of the PR and between 2018079 and 78425ad.

📒 Files selected for processing (2)
  • internal/entity/models/get_driver.go
  • internal/entity/models/get_driver_test.go

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


📝 Walkthrough

Walkthrough

GetPreconfiguredDriver now falls back to a case-insensitive runtime driver name match when the direct provider lookup is unavailable. A test verifies the fallback with the Zhipu AI provider.

Changes

Driver lookup

Layer / File(s) Summary
Runtime driver name fallback
internal/entity/models/get_driver.go, internal/entity/models/get_driver_test.go
GetPreconfiguredDriver scans configured providers when the direct provider or its ModelDriver is nil. The test verifies that "zhipu" returns a *ZhipuAIModel without an error.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 78425

The driver lookup now supports configured provider names that differ from runtime driver names, including the tested Zhipu case. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: resolving provider aliases for extractor models.
Description check ✅ Passed The description explains the problem, provides background, describes the fix, and identifies the change as a bug fix. It satisfies the required summary content.
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.
  • Fix all pre-merge checks with AI

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

A rabbit checks the driver trail
When direct paths fail, the fallback sets sail
Names match softly, case by case
Zhipu arrives in the proper place
Tests nod twice with quiet grace

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

@wangq8
wangq8 merged commit 563a108 into infiniflow:main Sep 18, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants