{"record":{"id":"8a1b5d279467ba5c","repo":"chenhg5/cc-connect","slug":"pi-s-not-found-in-path-install-with-npm-inst","errorCode":null,"errorMessage":"pi: '%s' not found in PATH, install with: npm install -g @mariozechner/pi-coding-agent","messagePattern":"pi: '(.+?)' not found in PATH, install with: npm install -g @mariozechner/pi-coding-agent","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/pi/pi.go","lineNumber":51,"sourceCode":"\tsessionEnv   []string\n\tmu           sync.Mutex\n}\n\nfunc New(opts map[string]any) (core.Agent, error) {\n\tworkDir, _ := opts[\"work_dir\"].(string)\n\tif workDir == \"\" {\n\t\tworkDir = \".\"\n\t}\n\tmodel, _ := opts[\"model\"].(string)\n\tmode, _ := opts[\"mode\"].(string)\n\tmode = normalizeMode(mode)\n\tthinking, _ := opts[\"thinking\"].(string)\n\trpc, _ := opts[\"rpc\"].(bool)\n\n\tcmd, extraArgs := core.ParseCmdOpts(opts, \"pi\")\n\n\tif _, err := exec.LookPath(cmd); err != nil {\n\t\treturn nil, fmt.Errorf(\"pi: '%s' not found in PATH, install with: npm install -g @mariozechner/pi-coding-agent\", cmd)\n\t}\n\n\t// If model not specified in opts, try defaultModel from settings.json\n\tif model == \"\" {\n\t\tif def, err := readDefaultModel(); err == nil && def != \"\" {\n\t\t\tmodel = def\n\t\t}\n\t}\n\n\treturn &Agent{\n\t\tcmd:          cmd,\n\t\tcliExtraArgs: extraArgs,\n\t\tconfigEnv:    core.ParseConfigEnv(opts),\n\t\tworkDir:      workDir,\n\t\tmodel:        model,\n\t\tmode:         mode,\n\t\tthinking:     thinking,\n\t\trpc:          rpc,","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/pi/pi.go#L33-L69","documentation":"An event payload in the opencode readLoop teardown: when the process wrote non-empty stderr, the text (after special handling of stale 'Session not found' IDs, which are cleared) is emitted as core.EventError via fmt.Errorf(\"%s\", ...), relaying opencode's own error output to the user.","triggerScenarios":"Thrown at agent/pi/pi.go:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the stderr text — it is opencode's own complaint","Fix the cause and resend; stale session IDs are auto-cleared","Run opencode manually to reproduce persistent errors"],"exampleFix":null,"handlingStrategy":"fallback","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"}