{"record":{"id":"30605c12c8ecbc18","repo":"chenhg5/cc-connect","slug":"codexsession-start-w","errorCode":null,"errorMessage":"codexSession: start: %w","messagePattern":"codexSession: start: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/codex/session.go","lineNumber":168,"sourceCode":"\n\tcmd := exec.CommandContext(cs.ctx, bin, args...)\n\tcmd.Dir = cs.workDir\n\tprepareCmdForKill(cmd)\n\tif len(cs.extraEnv) > 0 {\n\t\tcmd.Env = core.MergeEnv(os.Environ(), cs.extraEnv)\n\t}\n\tcmd.Stdin = strings.NewReader(prompt)\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"codexSession: stdout 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\treturn fmt.Errorf(\"codexSession: start: %w\", err)\n\t}\n\tcs.addCmd(cmd)\n\n\tcs.wg.Add(1)\n\tgo cs.readLoop(cmd, stdout, &stderrBuf)\n\n\treturn nil\n}\n\nfunc (cs *codexSession) stageImages(prompt string, images []core.ImageAttachment) (string, []string, error) {\n\tif len(images) == 0 {\n\t\treturn prompt, nil, nil\n\t}\n\n\timgDir := filepath.Join(cs.workDir, \".cc-connect\", \"images\")\n\tif err := os.MkdirAll(imgDir, 0o755); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"codexSession: create image dir: %w\", err)\n\t}","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/codex/session.go#L150-L186","documentation":"Wraps a failed cmd.Start() in codexSession.Send: the codex binary could not be spawned for this turn. It fires when the binary is missing/not executable at spawn time (e.g. uninstalled after agent creation), the workDir is invalid, or the OS refuses the exec.","triggerScenarios":"Thrown at agent/codex/session.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the codex binary is installed and executable","Check that the session workDir exists","Look at the wrapped error for exec-specific causes (permission, ENOENT)"],"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-14T00:17:10.932Z"}