{"record":{"id":"c0a418cbbf81fe02","repo":"chenhg5/cc-connect","slug":"telegram-invalid-progress-style-q-want-legacy","errorCode":null,"errorMessage":"telegram: invalid progress_style %q (want legacy, compact, or card)","messagePattern":"telegram: invalid progress_style %q \\(want legacy, compact, or card\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"platform/telegram/telegram.go","lineNumber":181,"sourceCode":"\tgroupReplyAll, _ := opts[\"group_reply_all\"].(bool)\n\tshareSessionInChannel, _ := opts[\"share_session_in_channel\"].(bool)\n\tenableReactions, _ := opts[\"enable_reactions\"].(bool)\n\n\t// Default to \"compact\" so streaming edits work out of the box. Telegram has\n\t// no rich card UI, so \"card\" is normalized to \"compact\". Users can opt out\n\t// via progress_style = \"legacy\" to restore the old \"send full text once\"\n\t// behavior.\n\tprogressStyle := \"compact\"\n\tif v, ok := opts[\"progress_style\"].(string); ok {\n\t\tswitch strings.ToLower(strings.TrimSpace(v)) {\n\t\tcase \"\":\n\t\t\t// keep default\n\t\tcase \"legacy\":\n\t\t\tprogressStyle = \"legacy\"\n\t\tcase \"compact\", \"card\":\n\t\t\tprogressStyle = \"compact\"\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"telegram: invalid progress_style %q (want legacy, compact, or card)\", v)\n\t\t}\n\t}\n\n\treturn &Platform{\n\t\ttoken:                 token,\n\t\tallowFrom:             allowFrom,\n\t\tgroupReplyAll:         groupReplyAll,\n\t\tshareSessionInChannel: shareSessionInChannel,\n\t\tenableReactions:       enableReactions,\n\t\tprogressStyle:         progressStyle,\n\t\thttpClient:            httpClient,\n\t}, nil\n}\n\nfunc (p *Platform) Name() string { return \"telegram\" }\n\n// ProgressStyle reports the streaming-progress style for this platform.\n//","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/platform/telegram/telegram.go#L163-L199","documentation":"telegram.New() validates the optional 'progress_style' option against an allowlist (\"legacy\", \"compact\", \"card\"; empty/unset keeps the default). Any other value fails construction with this error listing the valid choices.","triggerScenarios":"Calling telegram.New(opts) with opts[\"progress_style\"] set to a string not in the set {legacy, compact, card} — e.g. \"progress\", \"cards\", \"Compact\" (case-sensitive), or a leftover value from an older config schema.","commonSituations":"Config written against a different version whose style names differed; typo; capitalization mismatch since the match is case-sensitive; copy-pasting an example from another platform adapter.","solutions":["Change progress_style in config to one of: \"legacy\", \"compact\", or \"card\" (lowercase)","Remove the progress_style line entirely to use the default style","Check the README/config.example.toml of your cc-connect version for the accepted values"],"exampleFix":"// before\nprogress_style = \"Card\"\n# after\nprogress_style = \"card\"","handlingStrategy":"validation","validationCode":"style, _ := opts[\"progress_style\"].(string)\nswitch style {\ncase \"\", \"legacy\", \"compact\", \"card\":\n    // ok\ndefault:\n    return fmt.Errorf(\"unsupported progress_style %q\", style)\n}","typeGuard":null,"tryCatchPattern":"p, err := telegram.New(opts)\nif err != nil {\n    slog.Error(\"telegram init failed (check progress_style)\", \"err\", err)\n    return err\n}","preventionTips":["Use only lowercase legacy/compact/card values in config","Omit progress_style to get the default","Consult config.example.toml for your cc-connect version"],"tags":["telegram","config","enum","validation"],"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"}