{"record":{"id":"aee1153e98c3a607","repo":"chenhg5/cc-connect","slug":"read-stdout-w-aee115","errorCode":null,"errorMessage":"read stdout: %w","messagePattern":"read stdout: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/qoder/session.go","lineNumber":213,"sourceCode":"\t\tselect {\n\t\tcase qs.events <- evt:\n\t\tcase <-qs.ctx.Done():\n\t\t}\n\t} else if exitErr != nil {\n\t\t// Process failed with no usable output.\n\t\tstderrMsg := strings.TrimSpace(stderrBuf.String())\n\t\tif stderrMsg == \"\" {\n\t\t\tstderrMsg = exitErr.Error()\n\t\t}\n\t\tslog.Error(\"qoderSession: process failed with no result\", \"error\", exitErr, \"stderr\", truncStr(stderrMsg, 200))\n\t\tevt := core.Event{Type: core.EventError, Error: fmt.Errorf(\"%s\", stderrMsg)}\n\t\tselect {\n\t\tcase qs.events <- evt:\n\t\tcase <-qs.ctx.Done():\n\t\t}\n\t} else if scanErr != nil {\n\t\t// Scanner error with no output.\n\t\tevt := core.Event{Type: core.EventError, Error: fmt.Errorf(\"read stdout: %w\", scanErr)}\n\t\tselect {\n\t\tcase qs.events <- evt:\n\t\tcase <-qs.ctx.Done():\n\t\t}\n\t} else {\n\t\t// Process exited cleanly but produced nothing at all.\n\t\tslog.Warn(\"qoderSession: process exited with no output and no result event\")\n\t\tevt := core.Event{Type: core.EventResult, Content: \"\", SessionID: qs.CurrentSessionID(), Done: true}\n\t\tselect {\n\t\tcase qs.events <- evt:\n\t\tcase <-qs.ctx.Done():\n\t\t}\n\t}\n}\n\n// ── stream-json event structures ─────────────────────────────\n\ntype streamEvent struct {","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/qoder/session.go#L195-L231","documentation":"Wraps a scanner/stdout read failure in the qoder readLoop: the JSON event stream from the qoder CLI could not be read (broken pipe, early process exit with no usable output). Emitted as an EventError for the in-flight turn.","triggerScenarios":"Thrown at agent/qoder/session.go:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether the qoder process crashed (see adjacent stderr events)","Retry the message after confirming the CLI works manually","Report persistent stream failures upstream"],"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"}