chenhg5/cc-connect · error

must be full, compact, or quiet

Error message

must be full, compact, or quiet

What it means

Validation error from the display-mode setting setter: the supplied value was not one of the accepted modes "full", "compact", or "quiet". The setter rejects anything else before persisting the display configuration.

Source

Thrown at core/engine.go:15113

			descZh: "显示模式: full, compact, quiet",
			getFunc: func() string {
				if e.display.Mode == "" {
					return "full"
				}
				return e.display.Mode
			},
			setFunc: func(v string) error {
				switch v {
				case "full":
					e.display.Mode = "full"
					e.display.ThinkingMessages = true
					e.display.ToolMessages = true
				case "compact", "quiet":
					e.display.Mode = v
					e.display.ThinkingMessages = false
					e.display.ToolMessages = false
				default:
					return fmt.Errorf("must be full, compact, or quiet")
				}
				if e.displaySaveFunc != nil {
					tm := e.display.ThinkingMessages
					tool := e.display.ToolMessages
					return e.displaySaveFunc(&v, &tm, nil, nil, &tool)
				}
				return nil
			},
		},
		{
			key:    "thinking_messages",
			desc:   "Whether thinking messages are shown (true/false)",
			descZh: "是否显示思考消息 (true/false)",
			getFunc: func() string {
				return fmt.Sprintf("%t", e.display.ThinkingMessages)
			},
			setFunc: func(v string) error {
				b, err := strconv.ParseBool(v)

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Use exactly one of: full, compact, or quiet (lowercase).
  2. Check config.toml for the display mode entry and correct the value.
  3. If migrating from an older version, map deprecated mode names to the current three.

Example fix

// before
e.setDisplayMode("minimal")
// after
e.setDisplayMode("compact")
Defensive patterns

Strategy: validation

Validate before calling

var mode = strings.ToLower(strings.TrimSpace(v))
if mode != "full" && mode != "compact" && mode != "quiet" { return fmt.Errorf("must be full, compact, or quiet") }

Try / catch

if err := setDisplayMode(v); err != nil {
    if strings.Contains(err.Error(), "must be full, compact, or quiet") { /* prompt user for a valid mode */ }
    return err
}

Prevention

When it happens

Trigger: Setting the display mode config option with any value other than full/compact/quiet, e.g. `set display.mode minimal` or a misspelled value.

Common situations: Typo in the value in config.toml or an interactive set command; copying an example config that used an older/renamed mode value.

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/6240d1e5987f2c00. Report an issue: GitHub.