{"record":{"id":"bd0190dd20aaeb26","repo":"chenhg5/cc-connect","slug":"reasonix-start-session-w","errorCode":null,"errorMessage":"reasonix: start session: %w","messagePattern":"reasonix: start session: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/reasonix/reasonix.go","lineNumber":84,"sourceCode":"\tcase \"yolo\", \"auto\", \"force\":\n\t\treturn \"yolo\"\n\tcase \"plan\":\n\t\treturn \"plan\"\n\tdefault:\n\t\treturn \"default\"\n\t}\n}\n\nfunc (a *Agent) Name() string { return \"reasonix\" }\n\n// StartSession creates a session connected to reasonix serve.\n// It establishes an SSE connection to /events and waits for it to be ready.\nfunc (a *Agent) StartSession(ctx context.Context, sessionID string) (core.AgentSession, error) {\n\tslog.Info(\"reasonix: starting session\", \"session_id\", sessionID)\n\n\ts, err := newSession(ctx, a.serveURL, a.workDir, sessionID, a.mode)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"reasonix: start session: %w\", err)\n\t}\n\treturn s, nil\n}\n\n// ListSessions returns nil because reasonix doesn't expose session listing.\nfunc (a *Agent) ListSessions(_ context.Context) ([]core.AgentSessionInfo, error) {\n\treturn nil, nil\n}\n\n// Stop shuts down the agent.\nfunc (a *Agent) Stop() error { return nil }\n\n// ── WorkDirSwitcher ──────────────────────────────────────────────\n\nfunc (a *Agent) SetWorkDir(dir string) {\n\ta.mu.Lock()\n\tdefer a.mu.Unlock()\n\ta.workDir = dir","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/reasonix/reasonix.go#L66-L102","documentation":"A thin wrapper in reasonix Agent.StartSession around newSession failures: creating the HTTP/SSE session against the reasonix serve instance failed (network unreachable, /new rejected, SSE setup error). The wrapped error carries the actual cause.","triggerScenarios":"Thrown at agent/reasonix/reasonix.go:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the reasonix serve instance is running at serve_url","Check network/firewall access from cc-connect to the serve host","Read the wrapped error for the HTTP-level cause"],"exampleFix":null,"handlingStrategy":"try-catch","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"}