chenhg5/cc-connect · error

config: %s.references.marker_style has unsupported value %q

Error message

config: %s.references.marker_style has unsupported value %q

What it means

CC-Connect validates `[projects.references].marker_style` against a fixed set: "", "none", "ascii", "emoji". Any other value makes validateReferenceConfig reject the config, quoting the value. It controls how reference markers (e.g. [1], ①) are rendered next to citations.

Source

Thrown at config/config.go:1153

func validateReferenceConfig(prefix string, rc ReferenceConfig) error {
	for _, v := range rc.NormalizeAgents {
		key := strings.ToLower(strings.TrimSpace(v))
		if _, ok := supportedReferenceAgents[key]; !ok {
			return fmt.Errorf("config: %s.references.normalize_agents has unsupported value %q", prefix, v)
		}
	}
	for _, v := range rc.RenderPlatforms {
		key := strings.ToLower(strings.TrimSpace(v))
		if _, ok := supportedReferencePlatforms[key]; !ok {
			return fmt.Errorf("config: %s.references.render_platforms has unsupported value %q", prefix, v)
		}
	}
	if _, ok := supportedReferenceDisplayPaths[strings.ToLower(strings.TrimSpace(rc.DisplayPath))]; !ok {
		return fmt.Errorf("config: %s.references.display_path has unsupported value %q", prefix, rc.DisplayPath)
	}
	if _, ok := supportedReferenceMarkerStyles[strings.ToLower(strings.TrimSpace(rc.MarkerStyle))]; !ok {
		return fmt.Errorf("config: %s.references.marker_style has unsupported value %q", prefix, rc.MarkerStyle)
	}
	if _, ok := supportedReferenceEnclosureStyles[strings.ToLower(strings.TrimSpace(rc.EnclosureStyle))]; !ok {
		return fmt.Errorf("config: %s.references.enclosure_style has unsupported value %q", prefix, rc.EnclosureStyle)
	}
	return nil
}

// validateUsersConfig checks the [projects.users] section for consistency.
func validateUsersConfig(prefix string, u *UsersConfig) error {
	if u == nil {
		return nil
	}
	if len(u.Roles) == 0 {
		return fmt.Errorf("config: %s.users has no roles defined", prefix)
	}
	wildcardCount := 0
	seenUserIDs := make(map[string]string) // userID → role name
	for roleName, rc := range u.Roles {

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Use one of: "none", "ascii", "emoji", or empty string for default
  2. If you wanted bracket-style wrapping, set enclosure_style = "bracket" and keep marker_style valid
  3. Fix casing/typos — value must match the allowlist after trim+lowercase

Example fix

# before
[projects.references]
marker_style = "number"

# after
[projects.references]
marker_style = "ascii"
Defensive patterns

Strategy: validation

Validate before calling

var markerStyles = map[string]bool{"": true, "none": true, "ascii": true, "emoji": true}
if !markerStyles[strings.ToLower(strings.TrimSpace(rc.MarkerStyle))] {
    return fmt.Errorf("marker_style %q unsupported", rc.MarkerStyle)
}

Type guard

func isValidMarkerStyle(v string) bool {
    switch strings.ToLower(strings.TrimSpace(v)) {
    case "", "none", "ascii", "emoji":
        return true
    }
    return false
}

Prevention

When it happens

Trigger: Loading config.toml with marker_style set to something like "number", "bracket", or "unicode" instead of an allowed value. Matching is case-insensitive and trimmed, so "ASCII" would pass.

Common situations: Confusing marker_style with enclosure_style vocabularies (bracket/angle belong to enclosure_style, not marker_style); guessing names; typos.

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


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/78ccce7fecfadd45. Report an issue: GitHub.