refactor: improve error handling and code formatting

- Enhanced error messages in Rust backend to include file paths
- Improved provider switching error handling with detailed messages
- Added MCP button placeholder in UI (functionality TODO)
- Applied code formatting across frontend components
- Extended error notification duration to 6s for better readability
This commit is contained in:
Jason
2025-10-08 21:22:56 +08:00
parent 6afc436946
commit e9833e9a57
20 changed files with 335 additions and 237 deletions

View File

@@ -32,7 +32,7 @@ export function generateThirdPartyAuth(apiKey: string): Record<string, any> {
export function generateThirdPartyConfig(
providerName: string,
baseUrl: string,
modelName = "gpt-5-codex"
modelName = "gpt-5-codex",
): string {
// 清理供应商名称确保符合TOML键名规范
const cleanProviderName =
@@ -71,7 +71,7 @@ export const codexProviderPresets: CodexProviderPreset[] = [
config: generateThirdPartyConfig(
"packycode",
"https://codex-api.packycode.com/v1",
"gpt-5-codex"
"gpt-5-codex",
),
// Codex 请求地址候选(用于地址管理/测速)
endpointCandidates: [