feat(config): validate provider existence before auxiliary fields - #1093
Merged
lizhengfeng101 merged 2 commits intoAug 28, 2026
Merged
Conversation
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 1 selected item(s). |
Qiyuanqiii
commented
Aug 27, 2026
Qiyuanqiii
left a comment
Contributor
Author
There was a problem hiding this comment.
我认为当前错误提示仍有两个需要处理的边界问题:
-
新测试将
custom_providers.openai.url作为同名冲突场景的修复方式,但运行时解析会先通过LookupProvider判断名称;只要名称命中内置 preset,便只读取providers.openai,不会读取custom_providers.openai。这样提示创建的自定义配置实际上无法被选中。这里是否应该直接拒绝与 preset 同名的自定义 provider,并提示用户换名,而不是引导其创建一个不会生效的配置项? -
错误信息固定推荐执行
.url <endpoint>,但受支持的自定义anthropic-bedrockprovider 明确不需要 URL,应该先配置protocol等核心字段。是否可以将修复建议改成对所有协议都成立的表述,或者根据 provider 类型提供对应示例?
除此之外,存在性检查的位置、失败时不写入配置以及新增测试整体上没有发现其他问题。
Contributor
Author
|
已处理这两个边界问题,更新在
本地已重新通过 |
Qiyuanqiii
marked this pull request as ready for review
August 27, 2026 15:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
extra_body,extra_headers, andretry_codeswhen a custom provider has not been configured yet.custom_providers.<preset-name>entries because runtime resolution always treats those names as presets, and point users to the canonicalproviders.*path or a different custom name.protocolfirst so the remediation works for URL-based providers and URL-less custom Bedrock providers.Type of Change
How Has This Been Tested?
make testpasses locallyAdditional validation:
make checkmake coverage(90.9% total)ocr review --audience agent(0 findings after the review follow-up)Checklist
go fmt,go vet)Related Issues
Closes #1092