{"record":{"id":"7fc8791d0ce96647","repo":"chenhg5/cc-connect","slug":"unsupported-app-type-q-only-claude-and-codex-are","errorCode":null,"errorMessage":"unsupported app_type %q (only claude and codex are supported)","messagePattern":"unsupported app_type %q \\(only claude and codex are supported\\)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cc-connect/provider.go","lineNumber":363,"sourceCode":"}\n\nfunc convertCCSwitchProvider(row ccSwitchRow) (config.ProviderConfig, error) {\n\tvar sc map[string]any\n\tif err := json.Unmarshal([]byte(row.SettingsConfig), &sc); err != nil {\n\t\treturn config.ProviderConfig{}, fmt.Errorf(\"invalid settings_config JSON: %w\", err)\n\t}\n\n\tp := config.ProviderConfig{\n\t\tName: strings.ToLower(strings.ReplaceAll(strings.TrimSpace(row.Name), \" \", \"-\")),\n\t}\n\n\tswitch row.AppType {\n\tcase \"claude\":\n\t\treturn convertClaudeProvider(p, sc)\n\tcase \"codex\":\n\t\treturn convertCodexProvider(p, sc)\n\tdefault:\n\t\treturn config.ProviderConfig{}, fmt.Errorf(\"unsupported app_type %q (only claude and codex are supported)\", row.AppType)\n\t}\n}\n\nfunc convertClaudeProvider(p config.ProviderConfig, sc map[string]any) (config.ProviderConfig, error) {\n\tenv, _ := sc[\"env\"].(map[string]any)\n\tif env == nil {\n\t\treturn p, fmt.Errorf(\"no env in settings_config\")\n\t}\n\n\tif key, ok := env[\"ANTHROPIC_AUTH_TOKEN\"].(string); ok && key != \"\" {\n\t\tp.APIKey = key\n\t}\n\tif url, ok := env[\"ANTHROPIC_BASE_URL\"].(string); ok && url != \"\" {\n\t\tp.BaseURL = url\n\t}\n\tif model, ok := env[\"ANTHROPIC_MODEL\"].(string); ok && model != \"\" {\n\t\tp.Model = model\n\t}","sourceCodeStart":345,"sourceCodeEnd":381,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/cmd/cc-connect/provider.go#L345-L381","documentation":"convertCCSwitchProvider only knows how to convert providers whose app_type is \"claude\" or \"codex\"; any other value hits the default branch and produces this error. It is a deliberate whitelist so unsupported cc-switch app types are rejected rather than mis-converted.","triggerScenarios":"A cc-switch providers row has app_type set to something else — e.g. \"gemini\", \"cursor\", empty string, or mixed case like \"Claude\" — and the importer calls convertCCSwitchProvider on it.","commonSituations":"Newer cc-switch versions storing app types cc-connect does not support yet; rows created by other tools sharing the DB; case differences from manual edits.","solutions":["Delete or ignore rows whose app_type is not claude/codex before importing.","Normalize app_type casing in the DB (or make the switch case-insensitive with strings.EqualFold).","Filter in the SQL query: add `WHERE app_type IN ('claude','codex')`.","Upgrade cc-connect if support for the new app type was added upstream."],"exampleFix":"// before\nquery := \"SELECT id, app_type, name, settings_config, is_current FROM providers\"\n// after (pre-filter unsupported rows)\nquery := \"SELECT id, app_type, name, settings_config, is_current FROM providers WHERE app_type IN ('claude','codex')\"","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"claude\": true, \"codex\": true}\nrows, _ := queryCCSwitchDB(dbPath, \"\")\nfor _, r := range rows {\n    if !allowed[strings.ToLower(r.AppType)] {\n        fmt.Printf(\"skipping unsupported app_type %q\\n\", r.AppType)\n        continue\n    }\n}","typeGuard":null,"tryCatchPattern":"p, err := convertCCSwitchProvider(row)\nif err != nil {\n    var unsupportedErr string = \"unsupported app_type\"\n    if strings.Contains(err.Error(), unsupportedErr) {\n        slog.Info(\"skipping provider with unsupported app_type\", \"app_type\", row.AppType)\n        continue\n    }\n    return err\n}","preventionTips":["Pre-filter SQL with WHERE app_type IN ('claude','codex').","Normalize app_type to lowercase at write time in cc-switch data.","Check the cc-switch version for newly supported app types before importing.","Skip unsupported rows rather than failing the entire import run."],"tags":["go","validation","cc-switch","enum"],"backgroundTag":"invalid-enum-value","analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}