chenhg5/cc-connect · error
iflow process failed: %w
Error message
iflow process failed: %w
What it means
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.
Source
Thrown at agent/iflow/session.go:870
for _, line := range strings.Split(stderrText, "\n") {
line = strings.TrimSpace(line)
if line == "" {
continue
}
if strings.HasPrefix(line, "<Execution Info>") || strings.HasPrefix(line, "</Execution Info>") {
continue
}
if strings.HasPrefix(line, "{") || strings.HasPrefix(line, "}") || strings.HasPrefix(line, "\"") {
continue
}
if utf8.RuneCountInString(line) > 300 {
line = string([]rune(line)[:300]) + "..."
}
return fmt.Errorf("%s", line)
}
}
if waitErr != nil {
return fmt.Errorf("iflow process failed: %w", waitErr)
}
return fmt.Errorf("iflow API request failed")
}
func (s *iflowSession) RespondPermission(_ string, _ core.PermissionResult) error {
return nil
}
func (s *iflowSession) Events() <-chan core.Event {
return s.events
}
func (s *iflowSession) CurrentSessionID() string {
v, _ := s.sessionID.Load().(string)
return v
}
func (s *iflowSession) Alive() bool {View on GitHub (pinned to 4000b2338a)
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
Example fix
// before
err := session.Send(ctx, prompt, nil)
log.Print(err)
// after
if err := session.Send(ctx, prompt, nil); err != nil {
log.Printf("iflow send failed: %v (cause: %v)", err, errors.Unwrap(err))
} Defensive patterns
Strategy: try-catch
Try / catch
if err := session.Send(ctx, msg, nil); err != nil {
if strings.Contains(err.Error(), "iflow process failed") {
cause := errors.Unwrap(err)
var ee *exec.ExitError
if errors.As(cause, &ee) { log.Printf("exit code: %d", ee.ExitCode()) }
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- %s
- iflow API request failed
- claudeSession: start: %w
- copilot: %q CLI not found in PATH, please install it first
- session is closed
AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06).
Data as JSON: /api/errors/2de5f0c4e566b049.
Report an issue: GitHub.