BigPizzaV3/CodexPlusPlus · error
供应商名称为空
Error message
供应商名称为空
What it means
Thrown by normalize_request in crates/codex-plus-core/src/provider_import.rs when a provider import request's name field is empty after trimming. Every imported provider becomes a RelayProfile whose name is required, so the import aborts before creating config/auth contents. Input reaches this function either from the manager UI or from request_from_url parsing the name query parameter of a share link.
Source
Thrown at crates/codex-plus-core/src/provider_import.rs:223
model_vlm: String::new(),
vlm_api_key: String::new(),
vlm_model: String::new(),
vlm_base_url: String::new(),
user_agent: String::new(),
sub2api_enabled: false,
sub2api_multiplier: String::new(),
model_routes: Vec::new(),
}
}
fn normalize_request(mut request: ProviderImportRequest) -> anyhow::Result<ProviderImportRequest> {
request.name = request.name.trim().to_string();
request.base_url = request.base_url.trim().trim_end_matches('/').to_string();
request.api_key = request.api_key.trim().to_string();
request.wire_api = request.wire_api.trim().to_ascii_lowercase();
request.relay_mode = request.relay_mode.trim().to_ascii_lowercase();
if request.name.is_empty() {
anyhow::bail!("供应商名称为空");
}
if request.base_url.is_empty() {
anyhow::bail!("Base URL 为空");
}
if request.api_key.is_empty() {
anyhow::bail!("API Key 为空");
}
request.config_contents = build_config_toml(
&request.base_url,
&request.api_key,
relay_protocol(&request.wire_api),
);
request.auth_contents = build_auth_json(&request.api_key);
Ok(request)
}
fn relay_protocol(value: &str) -> RelayProtocol {
match value.trim().to_ascii_lowercase().as_str() {View on GitHub (pinned to 1f431ae49b)
Solutions
- Provide a non-empty provider name (any non-whitespace text) in the import request
- For URL imports, check the share link contains name=YourProvider (URL-encoded if it has spaces)
- Fix the frontend to require the name field before submitting the import
Example fix
# before https://app/import?name=&baseUrl=https%3A%2F%2Fapi.vendor.com&apiKey=sk-... # after https://app/import?name=VendorAI&baseUrl=https%3A%2F%2Fapi.vendor.com&apiKey=sk-...
Defensive patterns
Strategy: validation
Validate before calling
fn import_request_valid(req: &ProviderImportRequest) -> bool {
!req.name.trim().is_empty()
} Prevention
- Make the name field required in the import UI before submit
- When generating share links, omit the link or warn if name is empty
- URL-encode name values containing spaces or non-ASCII characters
When it happens
Trigger: POSTing an import request with name omitted, blank, or only whitespace; importing from a share URL whose name= query parameter is empty (e.g. ?name=&baseUrl=...); URL-encoding issue dropping the name value.
Common situations: Share links generated with an unset name; frontend form submitted before the name field was filled; percent-encoding bugs where name resolves to empty.
Related errors
- Base URL 为空
- API Key 为空
- CDP WebSocket URL must include an explicit port
- Responses 请求体不是 UTF-8:{error}
- downloaded openai/plugins marketplace is invalid
AI-assisted analysis of BigPizzaV3/CodexPlusPlus@1f431ae49b (2026-08-16).
Data as JSON: /api/errors/32c177ff42450f60.
Report an issue: GitHub.