chenhg5/cc-connect · error
reasonix: invalid serve_url %q: %w
Error message
reasonix: invalid serve_url %q: %w
What it means
A config-time validation in the reasonix agent factory: the provided serve_url fails URL parsing after trailing-slash normalization. The quoted %q is the rejected value; the agent cannot be built around a malformed endpoint.
Source
Thrown at agent/reasonix/reasonix.go:42
// 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
}
func normalizeMode(opts map[string]any) string {View on GitHub (pinned to 4000b2338a)
Solutions
- Correct serve_url to a full valid URL including scheme (http/https)
- Remove stray characters or whitespace
- Restart cc-connect after fixing config
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at agent/reasonix/reasonix.go:42 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/58a567e0b2d1f773.
Report an issue: GitHub.