chenhg5/cc-connect · error

iflow API request failed

Error message

iflow API request failed

What it means

summarizeIFlowError's fallback: returned when no parseable error line was found in the CLI output and the process wait produced no error either — the iflow process failed its API request without explaining why. It is a last-resort generic error.

Source

Thrown at agent/iflow/session.go:872

			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 {
	return s.alive.Load()
}

View on GitHub (pinned to 4000b2338a)

Solutions

  1. Enable debug/verbose logging of the iflow CLI output to capture the raw JSON error
  2. Check iflow service status / network connectivity
  3. Upgrade or patch the summarizer to also inspect JSON error lines if the CLI changed format
  4. Retry the turn; transient upstream API failures often resolve
Defensive patterns

Strategy: retry

Try / catch

if err := session.Send(ctx, msg, nil); err != nil {
    if err.Error() == "iflow API request failed" {
        if attempt < maxAttempts { time.Sleep(backoff); retry() }
        else { notifyUserUpstreamOutage() }
    }
}

Prevention

When it happens

Trigger: readLoop calls summarizeIFlowError and the iflow CLI produced no parsable text and exited without a wait error, e.g. it printed only JSON error objects that the summarizer skips.

Common situations: Upstream iflow API outage returning JSON error bodies; CLI output format changed so the summarizer's heuristics no longer match; empty output with non-zero logical failure.

Related errors


AI-assisted analysis of chenhg5/cc-connect@4000b2338a (2026-09-06). Data as JSON: /api/errors/d5a86affc3b7a0d6. Report an issue: GitHub.