{"record":{"id":"fee0a8e1249abed0","repo":"chenhg5/cc-connect","slug":"acp-stdin-pipe-w","errorCode":null,"errorMessage":"acp: stdin pipe: %w","messagePattern":"acp: stdin pipe: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/acp/session.go","lineNumber":104,"sourceCode":"\t\tworkDir:       absWorkDir,\n\t\tevents:        make(chan core.Event, 128),\n\t\tctx:           sessionCtx,\n\t\tcancel:        cancel,\n\t\tpermByID:      make(map[string]permState),\n\t\ttoolInputByID: make(map[string]string),\n\t\tacpSessID:     cfg.resumeSessionID,\n\t\tcallbacks:     cfg.callbacks,\n\t}\n\ts.alive.Store(true)\n\n\tcmd := exec.CommandContext(sessionCtx, cfg.command, cfg.args...)\n\tcmd.Dir = absWorkDir\n\tcmd.Env = core.MergeEnv(os.Environ(), cfg.extraEnv)\n\n\tstdin, err := cmd.StdinPipe()\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"acp: stdin pipe: %w\", err)\n\t}\n\tstdout, err := cmd.StdoutPipe()\n\tif err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"acp: stdout pipe: %w\", err)\n\t}\n\tvar stderrBuf bytes.Buffer\n\tcmd.Stderr = io.MultiWriter(&stderrBuf, os.Stderr)\n\n\ts.cmd = cmd\n\ts.tr = newTransport(stdout, stdin, s.onNotification, s.onServerRequest)\n\n\tif err := cmd.Start(); err != nil {\n\t\tcancel()\n\t\treturn nil, fmt.Errorf(\"acp: start %s: %w\", cfg.command, err)\n\t}\n\n\ts.wg.Add(1)","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/acp/session.go#L86-L122","documentation":"Raised in newACPSession when exec.Cmd.StdinPipe() fails while wiring pipes to the freshly-built agent process command. It fires before the process is even started — an OS-level pipe allocation failure, which is rare and usually indicates exhausted file descriptors or process limits.","triggerScenarios":"Thrown at agent/acp/session.go:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the process/file-descriptor limit (ulimit -n) and raise it if low","Reduce the number of concurrently running agent sessions","Reboot or investigate system-wide fd exhaustion if it persists"],"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"}