{"record":{"id":"161e0d69cf2a856c","repo":"chenhg5/cc-connect","slug":"cursorsession-start-w","errorCode":null,"errorMessage":"cursorSession: start: %w","messagePattern":"cursorSession: start: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/cursor/session.go","lineNumber":160,"sourceCode":"\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cursorSession: stdout pipe: %w\", err)\n\t}\n\n\t// Set up a stdin pipe so we can write interaction_query responses back to Cursor.\n\t// Without a connected stdin, Cursor gets EOF and auto-rejects all permission requests.\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cursorSession: stdin pipe: %w\", err)\n\t}\n\n\tvar stderrBuf bytes.Buffer\n\tcmd.Stderr = &stderrBuf\n\n\tif err := cmd.Start(); err != nil {\n\t\t_ = stdin.Close()\n\t\treturn fmt.Errorf(\"cursorSession: start: %w\", err)\n\t}\n\n\tcs.stdinMu.Lock()\n\tcs.stdin = stdin\n\tcs.stdinMu.Unlock()\n\n\tcs.wg.Add(1)\n\tgo cs.readLoop(cmd, stdout, &stderrBuf)\n\n\treturn nil\n}\n\nfunc (cs *cursorSession) readLoop(cmd *exec.Cmd, stdout io.ReadCloser, stderrBuf *bytes.Buffer) {\n\tdefer cs.wg.Done()\n\tdefer func() {\n\t\t// Close stdin so Cursor knows the input stream is finished.\n\t\tcs.stdinMu.Lock()\n\t\tif cs.stdin != nil {","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/cursor/session.go#L142-L178","documentation":"Wraps a failed cmd.Start() in cursorSession.Send: the Cursor CLI could not be spawned for this turn. Fires on missing/non-executable binary at spawn time, invalid workDir, or OS exec refusal; the stdin pipe is closed and the turn aborted.","triggerScenarios":"Thrown at agent/cursor/session.go:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the cursor-agent binary is installed and executable","Check the session workDir exists","Read the wrapped error for the exec failure 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"}