{"record":{"id":"4ba725ff861549dc","repo":"chenhg5/cc-connect","slug":"opencodesession-start-w","errorCode":null,"errorMessage":"opencodeSession: start: %w","messagePattern":"opencodeSession: start: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/opencode/session.go","lineNumber":109,"sourceCode":"\tcmd := exec.CommandContext(s.ctx, s.cmd, args...)\n\tcmd.Dir = s.workDir\n\tenv := os.Environ()\n\tif len(s.extraEnv) > 0 {\n\t\tenv = core.MergeEnv(env, s.extraEnv)\n\t}\n\tcmd.Env = env\n\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"opencodeSession: stdout pipe: %w\", err)\n\t}\n\n\tvar stderrBuf bytes.Buffer\n\tcmd.Stderr = &stderrBuf\n\tcmd.Stdin = strings.NewReader(prompt)\n\n\tif err := cmd.Start(); err != nil {\n\t\treturn fmt.Errorf(\"opencodeSession: start: %w\", err)\n\t}\n\n\ts.wg.Add(1)\n\tgo s.readLoop(cmd, stdout, &stderrBuf)\n\n\treturn nil\n}\n\nfunc (s *opencodeSession) 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(s.workDir, \".cc-connect\", \"images\")\n\tif err := os.MkdirAll(imgDir, 0o755); err != nil {\n\t\treturn \"\", nil, fmt.Errorf(\"opencodeSession: create image dir: %w\", err)\n\t}\n","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/opencode/session.go#L91-L127","documentation":"Wraps a failed cmd.Start() in opencodeSession.Send: the opencode binary could not be spawned for this turn. Fires on a missing/non-executable binary at spawn time, invalid workDir, or OS exec refusal; the turn aborts before the read loop starts.","triggerScenarios":"Thrown at agent/opencode/session.go:109 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the opencode binary is installed and runnable","Check the session workDir exists","Read the wrapped error for the exec 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"}