{"record":{"id":"e734e67471a31e7b","repo":"chenhg5/cc-connect","slug":"reasonix-serve-url-is-required","errorCode":null,"errorMessage":"reasonix: serve_url is required","messagePattern":"reasonix: serve_url is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/reasonix/reasonix.go","lineNumber":39,"sourceCode":"\tcore.RegisterAgent(\"reasonix\", New)\n}\n\n// Agent drives a remote reasonix serve instance.\ntype Agent struct {\n\tmu       sync.RWMutex\n\tserveURL string // e.g. \"http://localhost:8080\"\n\tworkDir  string // local project directory (for /dir and display)\n\tmode     string // permission mode: \"default\", \"yolo\", \"plan\"\n}\n\n// New creates a Reasonix agent.\n// Required opts key: \"serve_url\".\nfunc New(opts map[string]any) (core.Agent, error) {\n\tserveURL, _ := opts[\"serve_url\"].(string)\n\tserveURL = strings.TrimRight(serveURL, \"/\")\n\t// Strip trailing slashes so path-join never produces \"//submit\".\n\tif serveURL == \"\" {\n\t\treturn nil, fmt.Errorf(\"reasonix: serve_url is required\")\n\t}\n\tif _, err := url.Parse(serveURL); err != nil {\n\t\treturn nil, fmt.Errorf(\"reasonix: invalid serve_url %q: %w\", serveURL, err)\n\t}\n\n\tworkDir, _ := opts[\"work_dir\"].(string)\n\tif workDir == \"\" {\n\t\tworkDir = \".\"\n\t}\n\n\tmode := normalizeMode(opts)\n\n\tslog.Info(\"reasonix: agent created\", \"serve_url\", serveURL, \"work_dir\", workDir, \"mode\", mode)\n\treturn &Agent{\n\t\tserveURL: serveURL,\n\t\tworkDir:  workDir,\n\t\tmode:     mode,\n\t}, nil","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/reasonix/reasonix.go#L21-L57","documentation":"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.","triggerScenarios":"Thrown at agent/reasonix/reasonix.go:39 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set serve_url in the agent options in config.toml (e.g. http://localhost:8080)","Ensure the reasonix serve instance is running at that URL","Restart cc-connect after fixing config"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}