chenhg5/cc-connect · error

reasonix: serve_url is required

Error message

reasonix: serve_url is required

What it means

A config-time validation in the reasonix agent factory (New): the required serve_url option is missing or empty after trimming. The reasonix agent is a remote-HTTP driver, so without a base URL there is nothing to connect to and construction aborts.

Source

Thrown at agent/reasonix/reasonix.go:39

	core.RegisterAgent("reasonix", New)
}

// Agent drives a remote reasonix serve instance.
type Agent struct {
	mu       sync.RWMutex
	serveURL string // e.g. "http://localhost:8080"
	workDir  string // local project directory (for /dir and display)
	mode     string // permission mode: "default", "yolo", "plan"
}

// New creates a Reasonix agent.
// Required opts key: "serve_url".
func New(opts map[string]any) (core.Agent, error) {
	serveURL, _ := opts["serve_url"].(string)
	serveURL = strings.TrimRight(serveURL, "/")
	// Strip trailing slashes so path-join never produces "//submit".
	if serveURL == "" {
		return nil, fmt.Errorf("reasonix: serve_url is required")
	}
	if _, err := url.Parse(serveURL); err != nil {
		return nil, fmt.Errorf("reasonix: invalid serve_url %q: %w", serveURL, err)
	}

	workDir, _ := opts["work_dir"].(string)
	if workDir == "" {
		workDir = "."
	}

	mode := normalizeMode(opts)

	slog.Info("reasonix: agent created", "serve_url", serveURL, "work_dir", workDir, "mode", mode)
	return &Agent{
		serveURL: serveURL,
		workDir:  workDir,
		mode:     mode,
	}, nil

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Set serve_url in the agent options in config.toml (e.g. http://localhost:8080)
  2. Ensure the reasonix serve instance is running at that URL
  3. Restart cc-connect after fixing config
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at agent/reasonix/reasonix.go:39 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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