{"record":{"id":"2de5f0c4e566b049","repo":"chenhg5/cc-connect","slug":"iflow-process-failed-w","errorCode":null,"errorMessage":"iflow process failed: %w","messagePattern":"iflow process failed: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/iflow/session.go","lineNumber":870,"sourceCode":"\t\tfor _, line := range strings.Split(stderrText, \"\\n\") {\n\t\t\tline = strings.TrimSpace(line)\n\t\t\tif line == \"\" {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif strings.HasPrefix(line, \"<Execution Info>\") || strings.HasPrefix(line, \"</Execution Info>\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif strings.HasPrefix(line, \"{\") || strings.HasPrefix(line, \"}\") || strings.HasPrefix(line, \"\\\"\") {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif utf8.RuneCountInString(line) > 300 {\n\t\t\t\tline = string([]rune(line)[:300]) + \"...\"\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"%s\", line)\n\t\t}\n\t}\n\tif waitErr != nil {\n\t\treturn fmt.Errorf(\"iflow process failed: %w\", waitErr)\n\t}\n\treturn fmt.Errorf(\"iflow API request failed\")\n}\n\nfunc (s *iflowSession) RespondPermission(_ string, _ core.PermissionResult) error {\n\treturn nil\n}\n\nfunc (s *iflowSession) Events() <-chan core.Event {\n\treturn s.events\n}\n\nfunc (s *iflowSession) CurrentSessionID() string {\n\tv, _ := s.sessionID.Load().(string)\n\treturn v\n}\n\nfunc (s *iflowSession) Alive() bool {","sourceCodeStart":852,"sourceCodeEnd":888,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/iflow/session.go#L852-L888","documentation":"summarizeIFlowError returns this when it found no usable plain-text error line in the CLI output but the iflow process exited non-zero (waitErr != nil). The original exit error is wrapped as the cause.","triggerScenarios":"readLoop calls summarizeIFlowError after the process died with a non-zero exit status while its output contained only JSON lines (or nothing parseable), e.g. a crash, signal, or silent failure.","commonSituations":"iflow CLI segfault or panic; OOM kill of the process; CLI updated to a new output format with no plain-text error line; process killed by timeout/exit signal.","solutions":["Inspect the wrapped waitErr (exit status/signal) with errors.Unwrap or %v of the cause","Run the same iflow command manually to reproduce and see full output","Check dmesg/logs for OOM or signal kills","Pin/rollback the iflow CLI version if a recent upgrade changed output format"],"exampleFix":"// before\nerr := session.Send(ctx, prompt, nil)\nlog.Print(err)\n// after\nif err := session.Send(ctx, prompt, nil); err != nil {\n    log.Printf(\"iflow send failed: %v (cause: %v)\", err, errors.Unwrap(err))\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := session.Send(ctx, msg, nil); err != nil {\n    if strings.Contains(err.Error(), \"iflow process failed\") {\n        cause := errors.Unwrap(err)\n        var ee *exec.ExitError\n        if errors.As(cause, &ee) { log.Printf(\"exit code: %d\", ee.ExitCode()) }\n    }\n}","preventionTips":["Pin the iflow CLI version to one whose output format is understood","Set memory/process limits to avoid OOM kills of the CLI","Capture full CLI output at debug level for post-mortem"],"tags":["go","process-exit","cli","iflow"],"backgroundTag":"command-exited-nonzero","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"}