chenhg5/cc-connect · error
discord: invalid progress_style %q (want legacy, compact, or
Error message
discord: invalid progress_style %q (want legacy, compact, or card)
What it means
The Discord adapter validates the optional "progress_style" option against a fixed set: legacy, compact, or card (case-insensitive; default compact for unset/empty). Any other non-empty value is rejected at construction time with this error naming the offending value.
Source
Thrown at platform/discord/discord.go:114
groupReplyAllGuilds = []string{"*"}
}
shareSessionInChannel, _ := opts["share_session_in_channel"].(bool)
threadIsolation, _ := opts["thread_isolation"].(bool)
respondToAtEveryoneAndHere, _ := opts["respond_to_at_everyone_and_here"].(bool)
// Default to "compact" so streaming edits work out of the box (Discord
// supports MessageUpdater.UpdateMessage). Users can opt back into the old
// "send entire reply at once" behavior with progress_style = "legacy".
progressStyle := "compact"
if v, ok := opts["progress_style"].(string); ok {
switch strings.ToLower(strings.TrimSpace(v)) {
case "":
// keep default
case "legacy":
progressStyle = "legacy"
case "compact", "card":
progressStyle = strings.ToLower(strings.TrimSpace(v))
default:
return nil, fmt.Errorf("discord: invalid progress_style %q (want legacy, compact, or card)", v)
}
}
var proxyU *url.URL
if proxyStr, _ := opts["proxy"].(string); proxyStr != "" {
u, err := url.Parse(proxyStr)
if err != nil {
return nil, fmt.Errorf("discord: invalid proxy URL %q: %w", proxyStr, err)
}
if user, _ := opts["proxy_username"].(string); user != "" {
pass, _ := opts["proxy_password"].(string)
u.User = url.UserPassword(user, pass)
}
proxyU = u
}
base := &Platform{
token: token,View on GitHub (pinned to 4000b2338a)
Solutions
- Set progress_style in the discord platform config to exactly one of: legacy, compact, or card (case-insensitive).
- Remove the progress_style option entirely to use the default (compact).
- Check the platform docs/changelog if you relied on a style name that no longer exists.
- Correct any trailing punctuation or typos in the TOML string value.
Example fix
// before progress_style = "fancy" // after progress_style = "card"
Defensive patterns
Strategy: validation
Validate before calling
var validProgressStyles = map[string]bool{"legacy": true, "compact": true, "card": true}
func progressStyleValid(v string) bool {
return v == "" || validProgressStyles[strings.ToLower(strings.TrimSpace(v))]
} Try / catch
p, err := discord.New(opts)
if err != nil && strings.Contains(err.Error(), "invalid progress_style") {
log.Fatalf("config error: %v (use legacy|compact|card)", err)
} Prevention
- Copy style values verbatim from the docs: legacy, compact, card
- Omit progress_style to accept the default
- Trim whitespace and keep values lowercase in config
- Add a config lint step that checks option values before deploy
When it happens
Trigger: Calling discord.New(opts) with opts["progress_style"] set to a string that, after trimming and lowercasing, is not one of "legacy", "compact", or "card" — e.g. "minimal", "bar", "Compact " would be fine but "fancy" fails.
Common situations: Typo in config.toml (progress_style = "progres"); copying a style name from another platform adapter that supports different values; older config using a value removed in a version change.
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
- unsupported app_type %q (only claude and codex are supported
- invalid platform type %q (want feishu or lark)
- invalid session_mode %q (want reuse, new_per_run, or new-per
- invalid mode %q (want default, bypassPermissions, acceptEdit
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/948d26047fd9bf8a.
Report an issue: GitHub.