Skip to content

fix: 修复 insecure TLS 开关引入的 Rust 编译错误(E0599) - #38

Merged
NingNing0111 merged 2 commits into
OpenFuckJob:masterfrom
afterexam:fix/rig-reqwestclient-wrap
Sep 17, 2026
Merged

NingNing0111 merged 2 commits into
OpenFuckJob:masterfrom
afterexam:fix/rig-reqwestclient-wrap

Conversation

@afterexam

Copy link
Copy Markdown
Contributor

背景

#37 合并后 CI 的 Cargo check (Rust) 挂了,15 个 E0599。

根因

rig 0.40 的 ClientBuilder::http_client() 要求参数实现 HttpClientExt trait,但原生 reqwest::Client 没有该实现(实现只在官方包装类型 rig::http_client::ReqwestClient 上),导致 .build() 处 trait bound 不满足。

改动(最小)

  • src-tauri/src/llm/service.rs:新增 rig_http_client_for(),用 rig::http_client::ReqwestClient::new(...) 包一层;LlmService 构建处改用它。
  • src-tauri/src/command/llm_provider.rs:模型列表构建处改用 rig_http_client_for()。

底层仍是同一个 reqwest client,insecure 开关的 TLS 行为不变;fetch_openai_compatible_models 用的原生 client 未动。

rig 0.40 的 ClientBuilder::http_client 要求参数实现 HttpClientExt,
原生 reqwest::Client 不满足该约束导致 15 个 E0599 编译错误。
用官方 rig::http_client::ReqwestClient 包一层,底层仍是同一个
client,insecure 开关的 TLS 行为不变。
rig-core 0.40 depends on reqwest 0.13 while the app uses reqwest 0.12;
HttpClientExt is only implemented for rig's 0.13 Client, so construct the
client via rig::http_client::ReqwestClient::builder() instead of wrapping
the app's 0.12 client (ReqwestClient is a type alias, not a wrapper).
@NingNing0111
NingNing0111 merged commit 015b30b into OpenFuckJob:master Sep 17, 2026
1 check passed
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.

2 participants