Skip to content

Fix compile error by #2615#2619

Closed
shenjackyuanjie wants to merge 1 commit into
Hmbown:mainfrom
shenjackyuanjie:fix-provider
Closed

Fix compile error by #2615#2619
shenjackyuanjie wants to merge 1 commit into
Hmbown:mainfrom
shenjackyuanjie:fix-provider

Conversation

@shenjackyuanjie
Copy link
Copy Markdown

@shenjackyuanjie shenjackyuanjie commented Jun 3, 2026

Summary

Testing

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features
  • cargo test --workspace --all-features

fixing #2618

Greptile Summary

This PR fixes compile errors introduced by #2615, which added the SiliconflowCN/SiliconflowCn provider variant. The fixes are mechanical: removing duplicate match arms, adding missing exhaustive arms, correcting a spurious leading | on a pattern, and reformatting long lines to satisfy rustfmt.

  • crates/cli/src/lib.rs: Adds the two missing ProviderKind::SiliconflowCN arms in provider_slot and provider_env_vars, resolving non-exhaustive match errors.
  • crates/tui/src/config.rs: Removes multiple duplicate SiliconflowCn arms (some at wrong indentation levels) that caused "unreachable pattern" compile errors.
  • crates/tui/src/tui/notifications.rs: Removes the erroneous leading | from the ContentBlock::ImageUrl arm, and the remaining files receive formatting-only adjustments.

Confidence Score: 5/5

Safe to merge — every change is either removing a duplicate unreachable match arm, adding a missing exhaustive arm, or reformatting to meet line-length limits.

All changes are narrowly scoped to fixing the broken state left by #2615: no new logic is introduced, duplicated arms are simply deduplicated, and the new SiliconflowCN arms in the CLI mirror the pattern used by every other provider.

No files require special attention. crates/tui/src/config.rs had the most edits (three sets of duplicate arm removals) but the result is straightforwardly correct.

Important Files Changed

Filename Overview
crates/cli/src/lib.rs Adds missing ProviderKind::SiliconflowCN arms in provider_slot and provider_env_vars, fixing non-exhaustive match compile errors.
crates/config/src/lib.rs Reformats two long Siliconflow
crates/tui/src/client.rs Reformats three Siliconflow
crates/tui/src/config.rs Removes duplicate SiliconflowCn match arms (some at wrong indentation), fixes rustfmt line-length violations, and deduplicates entries in save_api_key_for and provider_config_key.
crates/tui/src/main.rs Reformats two long Siliconflow
crates/tui/src/tui/notifications.rs Removes the spurious leading
crates/tui/src/tui/session_picker.rs Collapses a three-line ImageUrl match arm body to a single line for formatting consistency; purely cosmetic.
crates/tui/src/tui/ui.rs Reformats the Siliconflow

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[SiliconflowCN provider added in #2615] --> B{Compile errors in 8 files}
    B --> C[cli/src/lib.rs\nMissing match arms]
    B --> D[tui/src/config.rs\nDuplicate SiliconflowCn arms]
    B --> E[tui/src/tui/notifications.rs\nSpurious leading pipe]
    B --> F[Other files\nLine-length violations]
    C --> G[All checks pass:\ncargo fmt / clippy / test]
    D --> G
    E --> G
    F --> G
Loading

Reviews (1): Last reviewed commit: "Fix compile error by #2615" | Re-trigger Greptile

Copilot AI review requested due to automatic review settings June 3, 2026 05:26
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Thanks @shenjackyuanjie for taking the time to contribute.

This repository is currently observing a maintainer-managed contribution gate in dry-run mode, so this pull request is staying open. When enforcement is enabled, pull requests from contributors who are not listed in .github/APPROVED_CONTRIBUTORS will be closed automatically.

Please read CONTRIBUTING.md for the expected contribution shape. A maintainer can grant PR access by commenting /lgtm on a pull request.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds support for the SiliconflowCN provider across the CLI, config, and TUI modules, mapping it to the appropriate environment variables and slots. It also cleans up duplicate match arms for SiliconflowCn in the configuration and applies general formatting improvements. A review comment suggests grouping consecutive match arms that return None in crates/tui/src/tui/notifications.rs to simplify the code and improve readability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines 701 to +702
| ContentBlock::CodeExecutionToolResult { .. } => None,
| ContentBlock::ImageUrl { .. } => None,
ContentBlock::ImageUrl { .. } => None,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Since both match arms return None, they can be grouped together into a single match arm to simplify the code and improve readability.

Suggested change
| ContentBlock::CodeExecutionToolResult { .. } => None,
| ContentBlock::ImageUrl { .. } => None,
ContentBlock::ImageUrl { .. } => None,
| ContentBlock::CodeExecutionToolResult { .. }
| ContentBlock::ImageUrl { .. } => None,

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR appears to primarily standardize/format match arms around the Siliconflow/SiliconflowCn variants and add CLI handling for the SiliconflowCN provider kind.

Changes:

  • Reformats several match/matches! usages involving Siliconflow/SiliconflowCn across TUI/config/client code.
  • Simplifies a ContentBlock::ImageUrl match arm formatting in the session picker and notifications.
  • Adds CLI mappings for ProviderKind::SiliconflowCN (slot + env var list).

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
crates/tui/src/tui/ui.rs Reformats provider display-name match arm for Siliconflow.
crates/tui/src/tui/session_picker.rs Condenses ImageUrl match arm to a single line.
crates/tui/src/tui/notifications.rs Adjusts ImageUrl match arm formatting in assistant text extraction.
crates/tui/src/main.rs Reformats provider match arms related to Siliconflow/SiliconflowCn.
crates/tui/src/config.rs Reformats parsing/normalization and removes duplicate SiliconflowCn match arms.
crates/tui/src/client.rs Reformats provider match arms in apply_reasoning_effort.
crates/config/src/lib.rs Reformats ProviderKind::Siliconflow/SiliconflowCN match arms.
crates/cli/src/lib.rs Adds ProviderKind::SiliconflowCN slot/env-var handling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/cli/src/lib.rs
Comment on lines 749 to 753
ProviderKind::Sglang => "sglang",
ProviderKind::Vllm => "vllm",
ProviderKind::Ollama => "ollama",
ProviderKind::SiliconflowCN => "siliconflow",
}
@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented Jun 3, 2026

Thanks @shenjackyuanjie for catching #2615 and sending the narrow compile repair. I reproduced the failure on main with cargo check --workspace --all-features --locked: missing ProviderKind::SiliconflowCN arms in crates/cli/src/lib.rs, plus duplicate/unreachable SiliconflowCn arms in the TUI config path.

I am carrying this repair into the v0.8.52 stabilization branch and will keep #2618 open until the fix is merged/released. Sorry this landed broken on main.

@Hmbown
Copy link
Copy Markdown
Owner

Hmbown commented Jun 3, 2026

Closing as superseded by #2626, which is now merged on main at c8ce2b8. The SiliconFlow-CN compile repair from this PR is included and credited in the v0.8.52 stabilization release notes. Thanks again @shenjackyuanjie for catching the break quickly.

@Hmbown Hmbown closed this Jun 3, 2026
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