chenhg5/cc-connect · error
unsupported app_type %q (only claude and codex are supported
Error message
unsupported app_type %q (only claude and codex are supported)
What it means
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.
Source
Thrown at cmd/cc-connect/provider.go:363
}
func convertCCSwitchProvider(row ccSwitchRow) (config.ProviderConfig, error) {
var sc map[string]any
if err := json.Unmarshal([]byte(row.SettingsConfig), &sc); err != nil {
return config.ProviderConfig{}, fmt.Errorf("invalid settings_config JSON: %w", err)
}
p := config.ProviderConfig{
Name: strings.ToLower(strings.ReplaceAll(strings.TrimSpace(row.Name), " ", "-")),
}
switch row.AppType {
case "claude":
return convertClaudeProvider(p, sc)
case "codex":
return convertCodexProvider(p, sc)
default:
return config.ProviderConfig{}, fmt.Errorf("unsupported app_type %q (only claude and codex are supported)", row.AppType)
}
}
func convertClaudeProvider(p config.ProviderConfig, sc map[string]any) (config.ProviderConfig, error) {
env, _ := sc["env"].(map[string]any)
if env == nil {
return p, fmt.Errorf("no env in settings_config")
}
if key, ok := env["ANTHROPIC_AUTH_TOKEN"].(string); ok && key != "" {
p.APIKey = key
}
if url, ok := env["ANTHROPIC_BASE_URL"].(string); ok && url != "" {
p.BaseURL = url
}
if model, ok := env["ANTHROPIC_MODEL"].(string); ok && model != "" {
p.Model = model
}View on GitHub (pinned to 4000b2338a)
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.
Example fix
// before
query := "SELECT id, app_type, name, settings_config, is_current FROM providers"
// after (pre-filter unsupported rows)
query := "SELECT id, app_type, name, settings_config, is_current FROM providers WHERE app_type IN ('claude','codex')" Defensive patterns
Strategy: validation
Validate before calling
allowed := map[string]bool{"claude": true, "codex": true}
rows, _ := queryCCSwitchDB(dbPath, "")
for _, r := range rows {
if !allowed[strings.ToLower(r.AppType)] {
fmt.Printf("skipping unsupported app_type %q\n", r.AppType)
continue
}
} Try / catch
p, err := convertCCSwitchProvider(row)
if err != nil {
var unsupportedErr string = "unsupported app_type"
if strings.Contains(err.Error(), unsupportedErr) {
slog.Info("skipping provider with unsupported app_type", "app_type", row.AppType)
continue
}
return err
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- invalid platform type %q (want feishu or lark)
- antigravity: invalid permission behavior %q
- auth.json missing tokens.access_token
- auth.json missing tokens.account_id
- tmux: 'session' option is required (name of the tmux session
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/7fc8791d0ce96647.
Report an issue: GitHub.